Skip to content

Instantly share code, notes, and snippets.

@bioid
Created March 17, 2016 22:13
Show Gist options
  • Save bioid/e7bba98e547c124d135f to your computer and use it in GitHub Desktop.
Save bioid/e7bba98e547c124d135f to your computer and use it in GitHub Desktop.
20:44:30 < bai> P is paste onto current line
20:44:32 < bai> p is paste onto next line
21:27:15 < j> v is the standard starting at this character, just start selecting
21:27:23 < j> shift+v is select only whole lines
21:27:27 < j> ctrl+v is the "box" select
21:28:19 < j> you know undo is u right
21:28:22 < j> and redo is R
21:29:07 < j> if you use visual select, it sets the anchors for you right
21:29:10 < j> that you would normally set using ,
21:29:26 < j> but if you say select a block of text and hit : it will automatically fill in what you need to make your command only apply to
those lines
21:29:34 < j> so you can select a bunch of text and like :s/butts/dicks/g
21:30:14 < j> if you want to do the whole file
21:30:21 < j> :%s/whatever/whatever
21:30:26 < j> the % means the whole file
indents
21:31:42 < j> you know you can do more than one right
21:31:47 < j> like select a big block and do 2<
columns
21:35:17 < j> yeah so you do ctrl+v right
21:35:22 < j> and only select 1 character from each line
21:35:37 < j> so your box is 1 character wide but n lines long
21:35:44 < j> then you hit 'c'
21:35:47 < j> and it will go to edit mode
21:35:57 < j> you then type what you want, hit escape
inc/dec numbers
21:36:19 < j> you know ^a will increment any number your cursor is on
21:36:24 < j> and ^x decrements it
suspended processes
21:37:53 < j> you know you can type "fg" right
21:37:55 < j> after you suspend
21:37:57 < j> and it resumes
21:38:05 < j> fg and bg control suspended processes
goto
21:39:53 < j> 'gg' goes to the top of the file
21:39:56 < j> G goes to the bottom
21:39:59 < j> $ goes to the end of a line
21:40:06 < j> w goes to the next wordbreak
21:40:11 < j> I think _ is part of words
21:40:17 < j> but like spaces, tabs, commas, periods
21:40:22 < j> those count as word breaks
21:40:33 < j> it's probably \w
21:40:47 < j> also ^ goes to the front of a line
pasting
21:43:13 < j> when you paste, it probably won't be what you expect
21:43:18 < j> but if you use shift+p it will be what you expect
21:44:43 < j> p inserts after the letter, shift p before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment