Skip to content

Instantly share code, notes, and snippets.

@mostlygeek
Forked from socketwiz/vim.markdown
Created November 27, 2015 18:29
Show Gist options
  • Save mostlygeek/930c03c38e6b22f42f96 to your computer and use it in GitHub Desktop.
Save mostlygeek/930c03c38e6b22f42f96 to your computer and use it in GitHub Desktop.

Revisions

  1. @socketwiz socketwiz revised this gist Aug 31, 2013. 1 changed file with 88 additions and 56 deletions.
    144 changes: 88 additions & 56 deletions vim.markdown
    Original file line number Diff line number Diff line change
    @@ -1,51 +1,46 @@
    ##motions
    motion | description
    ------------- | -------------
    h | count characters left
    l | count characters right
    ^ | to the first character of the line
    $ | to the last character of the line
    f<char> | to the counth character occurrence to the right F<char> | to the counth character occurrence to the left
    t<char> | to 1 character just before the counth character occurrence to the right
    T<char> | to 1 character just before the counth character occurrence to the left
    w | count words to the right
    W | count words to the left
    e | forward to the end of a word count
    b | backward to the end of a word count
    i<{<"'> | inside something like inside brackets or parenthesis for example
    h | Count characters left
    l | Count characters right
    ^ | To the first character of the line
    $ | To the last character of the line
    f<char> | To the counth character occurrence to the right. F<char> to the counth character occurrence to the left
    t<char> | To 1 character just before the counth character occurrence to the right
    T<char> | To 1 character just before the counth character occurrence to the left
    w | Count words forward
    W | Count words forward (different definition for what a word is, includes special characters and such)
    e | Count forward to the end of word
    b | Count words backward
    i<{<"'> | Inside something like inside brackets or parenthesis for example

    trigger | effect
    ------------- | -------------
    c<motion> | change
    d<motion> | delete
    y<motion> | yank into register
    g~<motion>| swap case
    gu<motion>| make lowercase
    gU<motion>| make uppercase
    ><motion> | shift right
    <<motion> | shift left
    =<motion> | auto-indent
    c{motion} | Change
    d{motion} | Delete
    y{motion} | Yank into register
    g~{motion}| Toggle case
    gu{motion}| Make lowercase
    gU{motion}| Make uppercase
    >{motion} | Shift right
    <{motion} | Shift left
    ={motion} | Auto-indent

    ##buffer management
    command | description
    ------------- | -------------
    <C-\^> or <C-6> | switch to the buffer you just left
    <C-\^> or <C-6> | Switch to the buffer you just left

    ##split windows
    command | description
    ------------- | -------------
    <C-w>s | split file horizontally
    :sp[lit] <file>|
    |
    <C-w>v | split file vertically
    :vsp[lit] <file>|
    |
    <C-w>s or :sp[lit] <file>| Split file horizontally.
    <C-w>v or :vsp[lit] <file>| Split file vertically
    <C-w>w | cycle between open windows
    <C-w>h | focus the window to the left
    <C-w>j | focus the window below
    <C-w>k | focus the window above
    <C-w>l | focus the window to the right
    |
    :cl[ose] <C-w>c | close the active window
    :on[ly] <C-w>o | keep only the active window, closing all others

    @@ -68,23 +63,6 @@ zc| close fold at cursor
    zR| open all
    zM| close all


    ##miscellaneous
    command | description
    ------------- | -------------
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    <C-v>| enable blockwise Visual mode
    gv | reselect the last visual selection
    o | go to other end of highlighted text
    "+p | paste from system clipboard
    :0,$d | delete every line in a file
    <C-a> | increment number
    <C-x> | decrement number
    vit | select contents inside of an HTML tag
    <C-r>0 | After hitting / pastes buffer


    ##search and replace
    command | description
    ------------- | -------------
    @@ -93,7 +71,7 @@ command | description
    * |search for the word under the cursor


    ##file navigation
    ##jumps
    command | description
    ------------- | -------------
    :jumps | display the jump list
    @@ -103,15 +81,51 @@ command | description
    g; |jump backwards through the changes list
    g, |jump forwards through the changes list
    gf |jump to the file name under the cursor

    ##changes
    command | description
    ------------- | -------------
    :changes | display the change list
    g; |jump backwards through the changes list
    g, |jump forwards through the changes list
    gf |jump to the file name under the cursor

    ##marks
    command | description
    ------------- | -------------
    :marks | display the marks list
    m<upper case> |set a file bookmark
    m<lower case> |set a buffer bookmark
    '<character> |jump to the mark
    ''|jump to the line in the current buffer where jumped from
    :delmarks <character>|delete specified mark
    :delmarks a-d|delete marks a through d
    :delmarks a,b,x,y|delete only marks a,b,x and y
    :delmarks!|delete all lower case marks

    ##registers
    command | description
    ------------- | -------------
    :registers | display the register list
    "<lower case register>{motion} |overwrite or use contents of register
    "<upper case register>{motion} |append or use contents of register
    0|populated with last yanked text

    ##macros
    command | description
    ------------- | -------------
    q{register} |start recording and store it in the specified register
    q|stop recording
    {count}@{register}|execute specified macro count times


    ##ctags
    command | description
    ------------- | -------------
    :tags |display the tags stack
    <C-]> | goto definition
    <C-t> | goto previous
    :ta<method> | takes you to the method definition where method definition could be a regex that produces a list
    :ts | shows the list
    :tn: | goes to next in list
    :tp | goes to previous in list
    :tf | goes to first in list
    @@ -120,13 +134,13 @@ command | description

    ##quickfix window
    command | description
    ------------- | -------------
    ------------- | -------------
    :copen | Open the quickfix window
    :ccl | Close it
    :cw | Open it if there are "errors", close it otherwise (some people prefer this)
    :cn | Go to the next error in the window
    :cnf | Go to the first error in the next file
    :cc\<num> | Go to the error by number
    :cc{num} | Go to the error by number


    ##Navigation
    @@ -141,7 +155,6 @@ key | move to
    }] |End of the current comment block.
    gd |First usage of the current variable name. (Mnemonic: go to definition).
    gD |Go to the first global usage of the current variable name.
    |
    gg |beginning of file
    G |end of file

    @@ -172,13 +185,13 @@ gCc | Comment the current line

    ###vim-rails <https://github.com/tpope/vim-rails>
    command | description
    ------------- | -------------
    ------------- | -------------
    :A | Alternate
    :R | Related
    :Rmodel|
    :Rview|
    :Rcontroller|
    :help rails-navigation |
    :Rmodel | Model
    :Rview | View
    :Rcontroller | Controller
    :help rails-navigation | Help on this plugin.

    ###vim-surround <https://github.com/tpope/vim-surround>
    command | description
    @@ -193,3 +206,22 @@ S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)


    ##miscellaneous
    command | description
    ------------- | -------------
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    &lt;C-v&gt;| enable blockwise Visual mode
    gv | reselect the last visual selection
    o | go to other end of highlighted text
    "+p | paste from system clipboard
    :0,$d | delete every line in a file
    &lt;C-a&gt; | increment number
    &lt;C-x&gt; | decrement number
    vit | select contents inside of an HTML tag
    :map|List all currently define mappings
    :verbose map|Display where mapping was defined
    g/{pattern}/d|Delete every line matching pattern.
    v/{pattern}/d|Delete every line _not_ matching pattern.
  2. @socketwiz socketwiz revised this gist Jan 14, 2013. 1 changed file with 49 additions and 9 deletions.
    58 changes: 49 additions & 9 deletions vim.markdown
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ h | count characters left
    l | count characters right
    ^ | to the first character of the line
    $ | to the last character of the line
    f&lt;char&gt; | to the counth character occurrence to the right F&lt;char&gt; | to the counth character occurrence to the left
    f&lt;char&gt; | to the counth character occurrence to the right F&lt;char&gt; | to the counth character occurrence to the left
    t&lt;char&gt; | to 1 character just before the counth character occurrence to the right
    T&lt;char&gt; | to 1 character just before the counth character occurrence to the left
    w | count words to the right
    @@ -26,10 +26,10 @@ gU&lt;motion&gt;| make uppercase
    &lt;&lt;motion&gt; | shift left
    =&lt;motion&gt; | auto-indent

    ## buffer management
    ##buffer management
    command | description
    ------------- | -------------
    &lt;C-\^&gt; or &lt;C-6&gt; | switch to the buffer you just left
    &lt;C-\^&gt; or &lt;C-6&gt; | switch to the buffer you just left

    ##split windows
    command | description
    @@ -58,6 +58,17 @@ z= | Suggest corrections for current word
    zg | Add the current word to spell file
    zw | Remove the current word from spell file

    ##code folding
    command | description
    ------------- | -------------
    zf{motion} | folds code when "foldmethod" set to manual or "marker"
    za| toggle fold at cursor
    zo| opens fold at cursor
    zc| close fold at cursor
    zR| open all
    zM| close all


    ##miscellaneous
    command | description
    ------------- | -------------
    @@ -71,8 +82,42 @@ o | go to other end of highlighted text
    &lt;C-a&gt; | increment number
    &lt;C-x&gt; | decrement number
    vit | select contents inside of an HTML tag
    &lt;C-r>0 | After hitting / pastes buffer


    ##search and replace
    command | description
    ------------- | -------------
    :args \*\*/\*.txt | Multi-file Step 1) populate the argument list with the files you want to search
    :argdo %s/search/replace/gc | Mult-file Step 2) replace all occurrences of search with replace but prompt before doing so
    * |search for the word under the cursor


    ##file navigation
    command | description
    ------------- | -------------
    :jumps | display the jump list
    &lt;C-o&gt; |jump backwards through the jump list
    &lt;C-i&gt; |jump forwards through the jump list
    :changes | display the change list
    g; |jump backwards through the changes list
    g, |jump forwards through the changes list
    gf |jump to the file name under the cursor


    ##ctags
    command | description
    ------------- | -------------
    &lt;C-]&gt; | goto definition
    &lt;C-t&gt; | goto previous
    :ta&lt;method&gt; | takes you to the method definition where method definition could be a regex that produces a list
    :ts | shows the list
    :tn: | goes to next in list
    :tp | goes to previous in list
    :tf | goes to first in list
    :tl | goes to last in list


    ##quickfix window
    command | description
    ------------- | -------------
    @@ -83,6 +128,7 @@ command | description
    :cnf | Go to the first error in the next file
    :cc\&lt;num&gt; | Go to the error by number


    ##Navigation
    key | move to
    ------------- | -------------
    @@ -147,9 +193,3 @@ S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)

    ###ultisnips <https://github.com/SirVer/ultisnips>
    command | description
    ------------- | -------------
    &lt;C-tab&gt; | print available list of snippets
    :UltiSnipsEdit | opens the private snippet definition file for the current filetype for editing
  3. @socketwiz socketwiz renamed this gist Jul 2, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @socketwiz socketwiz revised this gist Jul 2, 2012. No changes.
  5. @socketwiz socketwiz revised this gist Jul 2, 2012. No changes.
  6. @socketwiz socketwiz revised this gist Jun 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim.md
    Original file line number Diff line number Diff line change
    @@ -151,5 +151,5 @@ S# | in visual mode, rails ERB tag (requires vim-rails)
    ###ultisnips <https://github.com/SirVer/ultisnips>
    command | description
    ------------- | -------------
    <C-tab> | print available list of snippets
    &lt;C-tab&gt; | print available list of snippets
    :UltiSnipsEdit | opens the private snippet definition file for the current filetype for editing
  7. @socketwiz socketwiz revised this gist Jun 12, 2012. 1 changed file with 23 additions and 0 deletions.
    23 changes: 23 additions & 0 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -83,6 +83,23 @@ command | description
    :cnf | Go to the first error in the next file
    :cc\&lt;num&gt; | Go to the error by number

    ##Navigation
    key | move to
    ------------- | -------------
    % |End of construct
    [[ |Backwards to the beginning of the current function.
    ][ |Forwards to the beginning of the current function.
    ]} |Beginning of the current block.
    [{ |End of the current block.
    }[ |Beginning of the current comment block.
    }] |End of the current comment block.
    gd |First usage of the current variable name. (Mnemonic: go to definition).
    gD |Go to the first global usage of the current variable name.
    |
    gg |beginning of file
    G |end of file


    ##Addon References

    ###ctags <http://ctags.sourceforge.net/>
    @@ -130,3 +147,9 @@ S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)

    ###ultisnips <https://github.com/SirVer/ultisnips>
    command | description
    ------------- | -------------
    <C-tab> | print available list of snippets
    :UltiSnipsEdit | opens the private snippet definition file for the current filetype for editing
  8. @socketwiz socketwiz revised this gist May 25, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vim.md
    Original file line number Diff line number Diff line change
    @@ -70,6 +70,7 @@ o | go to other end of highlighted text
    :0,$d | delete every line in a file
    &lt;C-a&gt; | increment number
    &lt;C-x&gt; | decrement number
    vit | select contents inside of an HTML tag


    ##quickfix window
    @@ -128,4 +129,4 @@ S- | in visual mode, rails ERB tag (requires vim-rails)
    S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)
  9. @socketwiz socketwiz revised this gist May 21, 2012. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion vim.md
    Original file line number Diff line number Diff line change
    @@ -67,7 +67,10 @@ V | enable linewise Visual mode
    gv | reselect the last visual selection
    o | go to other end of highlighted text
    "+p | paste from system clipboard
    :0,$d | delete every line in a file
    :0,$d | delete every line in a file
    &lt;C-a&gt; | increment number
    &lt;C-x&gt; | decrement number


    ##quickfix window
    command | description
  10. @socketwiz socketwiz revised this gist May 20, 2012. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -81,7 +81,7 @@ command | description

    ##Addon References

    ##ctags
    ###ctags <http://ctags.sourceforge.net/>
    command | effect
    ------------- | -------------
    :!ctags -R |jump to first tag that matches word under the cursor
    @@ -93,7 +93,7 @@ g&lt;C-]&gt; | present a list of choices if there is more than a single tag to j
    :pop or &lt;C-t&gt; | Prompt user to select from multiple matches for the word under the cursor.
    :tselect | Prompt user to choose an item from the tag matchlist

    ###tcomment###
    ###tcomment <https://github.com/tomtom/tcomment_vim>
    command | description
    ------------- | -------------
    gc{motion} | Toggle comments (for small comments within one line the &amp;filetype_inline style will be used, if defined)
    @@ -103,7 +103,7 @@ gCc | Comment the current line
    &lt;C- _ &gt;&lt;C- _ &gt; | :TComment
    &lt;C- _ &gt;b | :TCommentBlock

    ###vim-rails###
    ###vim-rails <https://github.com/tpope/vim-rails>
    command | description
    ------------- | -------------
    :A | Alternate
    @@ -113,7 +113,7 @@ command | description
    :Rcontroller|
    :help rails-navigation |

    ###vim-surround###
    ###vim-surround <https://github.com/tpope/vim-surround>
    command | description
    ------------- | -------------
    cs&lt;current&gt;&lt;new&gt; | change old delimeter to new
  11. @socketwiz socketwiz revised this gist May 20, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -100,8 +100,8 @@ gc{motion} | Toggle comments (for small comments within one line the &amp;filety
    gcc | Toggle comment for the current line
    gC{motion} | Comment region
    gCc | Comment the current line
    &lt;c- _ &gt;&lt;c- _ &gt; | :TComment
    &lt;c- _ &gt;b | :TCommentBlock
    &lt;C- _ &gt;&lt;C- _ &gt; | :TComment
    &lt;C- _ &gt;b | :TCommentBlock

    ###vim-rails###
    command | description
  12. @socketwiz socketwiz revised this gist May 20, 2012. 1 changed file with 60 additions and 60 deletions.
    120 changes: 60 additions & 60 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,18 @@
    ##motions
    motion | description
    ------------- | -------------
    h | count characters left
    l | count characters right
    ^ | to the first character of the line
    $ | to the last character of the line
    h | count characters left
    l | count characters right
    ^ | to the first character of the line
    $ | to the last character of the line
    f&lt;char&gt; | to the counth character occurrence to the right F&lt;char&gt; | to the counth character occurrence to the left
    t&lt;char&gt; | to 1 character just before the counth character occurrence to the right
    T&lt;char&gt; | to 1 character just before the counth character occurrence to the left
    w | count words to the right
    W | count words to the left
    e | forward to the end of a word count
    b | backward to the end of a word count
    i&lt;{&lt;"'&gt; | inside something like inside brackets or parenthesis for example
    w | count words to the right
    W | count words to the left
    e | forward to the end of a word count
    b | backward to the end of a word count
    i&lt;{&lt;"'&gt; | inside something like inside brackets or parenthesis for example

    trigger | effect
    ------------- | -------------
    @@ -22,22 +22,22 @@ y&lt;motion&gt; | yank into register
    g~&lt;motion&gt;| swap case
    gu&lt;motion&gt;| make lowercase
    gU&lt;motion&gt;| make uppercase
    >&lt;motion&gt; | shift right
    <&lt;motion&gt; | shift left
    &gt;&lt;motion&gt; | shift right
    &lt;&lt;motion&gt; | shift left
    =&lt;motion&gt; | auto-indent

    ## buffer management
    command | description
    ------------- | -------------
    &lt;C-\^&gt; or &lt;C-6&gt; | switch to the buffer you just left
    &lt;C-\^&gt; or &lt;C-6&gt; | switch to the buffer you just left

    ##split windows
    command | description
    ------------- | -------------
    &lt;C-w&gt;s | split file horizontally
    &lt;C-w&gt;s | split file horizontally
    :sp[lit] &lt;file&gt;|
    |
    &lt;C-w&gt;v | split file vertically
    &lt;C-w&gt;v | split file vertically
    :vsp[lit] &lt;file&gt;|
    |
    &lt;C-w&gt;w | cycle between open windows
    @@ -46,68 +46,68 @@ command | description
    &lt;C-w&gt;k | focus the window above
    &lt;C-w&gt;l | focus the window to the right
    |
    :cl[ose] &lt;C-w&gt;c | close the active window
    :on[ly] &lt;C-w&gt;o |keep only the active window, closing all others

    ##ctags
    command | effect
    ------------- | -------------
    :!ctags -R |jump to first tag that matches word under the cursor
    &lt;C-]&gt; |Prompt user to select from multiple matches for the word under the cursor.
    g&lt;C-]&gt; |present a list of choices if there is more than a single tag to jump to
    &lt;C-t&gt; |like the back button for tag history
    :tag &lt;keyword&gt; |jump to first tag that matches word under the cursor
    :tjump &lt;keyword&gt; |Prompt user to select from multiple matches for the word under the cursor.
    :pop or &lt;C-t&gt; |Prompt user to select from multiple matches for the word under the cursor.
    :tselect |Prompt user to choose an item from the tag matchlist
    :cl[ose] &lt;C-w&gt;c | close the active window
    :on[ly] &lt;C-w&gt;o | keep only the active window, closing all others

    ##spelling
    command | description
    ------------- | -------------
    ]s | Jump to next spelling error
    [s | Jump to previous spelling error
    z= | Suggest corrections for current word
    zg | Add the current word to spell file
    zw | Remove the current word from spell file
    ]s | Jump to next spelling error
    [s | Jump to previous spelling error
    z= | Suggest corrections for current word
    zg | Add the current word to spell file
    zw | Remove the current word from spell file

    ##miscellaneous
    command | description
    ------------- | -------------
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    &lt;C-v&gt;| enable blockwise Visual mode
    gv** | reselect the last visual selection
    o | go to other end of highlighted text
    gv | reselect the last visual selection
    o | go to other end of highlighted text
    "+p | paste from system clipboard
    :0,$d | delete every line in a file
    :0,$d | delete every line in a file

    ##quickfix window
    command | description
    ------------- | -------------
    :copen | Open the quickfix window
    :ccl | Close it
    :cw | Open it if there are "errors", close it otherwise (some people prefer this)
    :cn | Go to the next error in the window
    :cnf | Go to the first error in the next file
    :cc\&lt;num&gt; | Go to the error by number
    :copen | Open the quickfix window
    :ccl | Close it
    :cw | Open it if there are "errors", close it otherwise (some people prefer this)
    :cn | Go to the next error in the window
    :cnf | Go to the first error in the next file
    :cc\&lt;num&gt; | Go to the error by number

    ##Addon References

    ##ctags
    command | effect
    ------------- | -------------
    :!ctags -R |jump to first tag that matches word under the cursor
    &lt;C-]&gt; | Prompt user to select from multiple matches for the word under the cursor.
    g&lt;C-]&gt; | present a list of choices if there is more than a single tag to jump to
    &lt;C-t&gt; | like the back button for tag history
    :tag &lt;keyword&gt; | jump to first tag that matches word under the cursor
    :tjump &lt;keyword&gt; | Prompt user to select from multiple matches for the word under the cursor.
    :pop or &lt;C-t&gt; | Prompt user to select from multiple matches for the word under the cursor.
    :tselect | Prompt user to choose an item from the tag matchlist

    ###tcomment###
    command | description
    ------------- | -------------
    gc{motion} | Toggle comments (for small comments within one line the &amp;filetype_inline style will be used, if defined)
    gcc | Toggle comment for the current line
    gC{motion} | Comment region
    gCc | Comment the current line
    &lt;c- _ &gt;&lt;c- _ &gt; | :TComment
    &lt;c- _ &gt;b | :TCommentBlock
    gc{motion} | Toggle comments (for small comments within one line the &amp;filetype_inline style will be used, if defined)
    gcc | Toggle comment for the current line
    gC{motion} | Comment region
    gCc | Comment the current line
    &lt;c- _ &gt;&lt;c- _ &gt; | :TComment
    &lt;c- _ &gt;b | :TCommentBlock

    ###vim-rails###
    command | description
    ------------- | -------------
    :A | Alternate
    :R | Related
    :A | Alternate
    :R | Related
    :Rmodel|
    :Rview|
    :Rcontroller|
    @@ -117,12 +117,12 @@ command | description
    command | description
    ------------- | -------------
    cs&lt;current&gt;&lt;new&gt; | change old delimeter to new
    ds | remove delimeters
    ysiw&lt;delimiter&gt; | wrap current word
    ds | remove delimeters
    ysiw&lt;delimiter&gt; | wrap current word
    S&lt;delimiter&gt; |while in visual mode
    S= | in visual mode, rails ERB tag (requires vim-rails)
    S- | in visual mode, rails ERB tag (requires vim-rails)
    S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)
    S= | in visual mode, rails ERB tag (requires vim-rails)
    S- | in visual mode, rails ERB tag (requires vim-rails)
    S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)
  13. @socketwiz socketwiz revised this gist May 20, 2012. 1 changed file with 85 additions and 71 deletions.
    156 changes: 85 additions & 71 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,18 @@
    ##motions
    **h** count characters left
    **l** count characters right
    **^** to the first character of the line
    **$** to the last character of the line
    **f&lt;char&gt;** to t he counth character occurrence to the right
    **F&lt;char&gt;** to t he counth character occurrence to the left
    **t&lt;char&gt;** to 1 character just before the counth character occurrence to the right
    **T&lt;char&gt;** to 1 character just before the counth character occurrence to the left
    **w** count words to the right
    **W** count words to the left
    **e** forward to the end of a word count
    **b** backward to the end of a word count
    **i&lt;{&lt;"'&gt;** inside something like inside brackets or parenthesis for example
    motion | description
    ------------- | -------------
    h | count characters left
    l | count characters right
    ^ | to the first character of the line
    $ | to the last character of the line
    f&lt;char&gt; | to the counth character occurrence to the right F&lt;char&gt; | to the counth character occurrence to the left
    t&lt;char&gt; | to 1 character just before the counth character occurrence to the right
    T&lt;char&gt; | to 1 character just before the counth character occurrence to the left
    w | count words to the right
    W | count words to the left
    e | forward to the end of a word count
    b | backward to the end of a word count
    i&lt;{&lt;"'&gt; | inside something like inside brackets or parenthesis for example

    trigger | effect
    ------------- | -------------
    @@ -25,32 +26,28 @@ gU&lt;motion&gt;| make uppercase
    <&lt;motion&gt; | shift left
    =&lt;motion&gt; | auto-indent

    command | effect
    ------------- | -------------
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    &lt;C-v&gt;| enable blockwise Visual mode
    gv** | reselect the last visual selection
    o | go to other end of highlighted text

    ## buffer management
    **&lt;C-\^&gt; or &lt;C-6&gt;** switch to the buffer you just left
    command | description
    ------------- | -------------
    &lt;C-\^&gt; or &lt;C-6&gt; | switch to the buffer you just left

    ##split windows
    **&lt;C-w&gt;s** split file horizontally
    **:sp[lit] &lt;file&gt;**

    **&lt;C-w&gt;v** split file vertically
    **:vsp[lit] &lt;file&gt;**

    **&lt;C-w&gt;w** cycle between open windows
    **&lt;C-w&gt;h** focus the window to the left
    **&lt;C-w&gt;j** focus the window below
    **&lt;C-w&gt;k** focus the window above
    **&lt;C-w&gt;l** focus the window to the right

    **:cl[ose] &lt;C-w&gt;c** close the active window
    **:on[ly] &lt;C-w&gt;o** keep only the active window, closing all others
    command | description
    ------------- | -------------
    &lt;C-w&gt;s | split file horizontally
    :sp[lit] &lt;file&gt;|
    |
    &lt;C-w&gt;v | split file vertically
    :vsp[lit] &lt;file&gt;|
    |
    &lt;C-w&gt;w | cycle between open windows
    &lt;C-w&gt;h | focus the window to the left
    &lt;C-w&gt;j | focus the window below
    &lt;C-w&gt;k | focus the window above
    &lt;C-w&gt;l | focus the window to the right
    |
    :cl[ose] &lt;C-w&gt;c | close the active window
    :on[ly] &lt;C-w&gt;o |keep only the active window, closing all others

    ##ctags
    command | effect
    @@ -65,50 +62,67 @@ g&lt;C-]&gt; |present a list of choices if there is more than a single tag
    :tselect |Prompt user to choose an item from the tag matchlist

    ##spelling
    **]s** Jump to next spelling error
    **[s** Jump to previous spelling error
    **z=** Suggest corrections for current word
    **zg** Add the current word to spell file
    **zw** Remove the current word from spell file
    command | description
    ------------- | -------------
    ]s | Jump to next spelling error
    [s | Jump to previous spelling error
    z= | Suggest corrections for current word
    zg | Add the current word to spell file
    zw | Remove the current word from spell file

    ##miscellaneous
    **"+p** paste from system clipboard
    **:0,$d** delete every line in a file
    command | description
    ------------- | -------------
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    &lt;C-v&gt;| enable blockwise Visual mode
    gv** | reselect the last visual selection
    o | go to other end of highlighted text
    "+p | paste from system clipboard
    :0,$d | delete every line in a file

    ##quickfix window
    **:copen** Open the quickfix window
    **:ccl** Close it
    **:cw** Open it if there are "errors", close it otherwise (some people prefer this)
    **:cn** Go to the next error in the window
    **:cnf** Go to the first error in the next file
    **:cc\&lt;num&gt;** Go to the error by number
    command | description
    ------------- | -------------
    :copen | Open the quickfix window
    :ccl | Close it
    :cw | Open it if there are "errors", close it otherwise (some people prefer this)
    :cn | Go to the next error in the window
    :cnf | Go to the first error in the next file
    :cc\&lt;num&gt; | Go to the error by number

    ##Addon References

    ###tcomment###
    **gc{motion}** Toggle comments (for small comments within one line the &amp;filetype_inline style will be used, if defined)
    **gcc** Toggle comment for the current line
    **gC{motion}** Comment region
    **gCc** Comment the current line
    **&lt;c- _ &gt;&lt;c- _ &gt;** :TComment
    **&lt;c- _ &gt;b** :TCommentBlock
    command | description
    ------------- | -------------
    gc{motion} | Toggle comments (for small comments within one line the &amp;filetype_inline style will be used, if defined)
    gcc | Toggle comment for the current line
    gC{motion} | Comment region
    gCc | Comment the current line
    &lt;c- _ &gt;&lt;c- _ &gt; | :TComment
    &lt;c- _ &gt;b | :TCommentBlock

    ###vim-rails###
    **:A** Alternate
    **:R** Related
    **:Rmodel**
    **:Rview**
    **:Rcontroller**
    **:help rails-navigation**
    command | description
    ------------- | -------------
    :A | Alternate
    :R | Related
    :Rmodel|
    :Rview|
    :Rcontroller|
    :help rails-navigation |

    ###vim-surround###
    **cs&lt;current&gt;&lt;new&gt;** change old delimeter to new
    **ds** remove delimeters
    **ysiw&lt;delimiter&gt;** wrap current word
    **S&lt;delimiter&gt;** while in visual mode
    **S=** in visual mode, rails ERB tag (requires vim-rails)
    **S-** in visual mode, rails ERB tag (requires vim-rails)
    **S#** in visual mode, rails ERB tag (requires vim-rails)
    **&lt;C-s&gt;=** rails ERB tag (requires vim-rails)
    **&lt;C-s&gt;-** rails ERB tag (requires vim-rails)
    **&lt;C-s&gt;#** rails ERB tag (requires vim-rails)
    command | description
    ------------- | -------------
    cs&lt;current&gt;&lt;new&gt; | change old delimeter to new
    ds | remove delimeters
    ysiw&lt;delimiter&gt; | wrap current word
    S&lt;delimiter&gt; |while in visual mode
    S= | in visual mode, rails ERB tag (requires vim-rails)
    S- | in visual mode, rails ERB tag (requires vim-rails)
    S# | in visual mode, rails ERB tag (requires vim-rails)
    &lt;C-s&gt;= | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;- | rails ERB tag (requires vim-rails)
    &lt;C-s&gt;# | rails ERB tag (requires vim-rails)
  14. @socketwiz socketwiz revised this gist May 20, 2012. 1 changed file with 29 additions and 26 deletions.
    55 changes: 29 additions & 26 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -13,24 +13,25 @@
    **b** backward to the end of a word count
    **i&lt;{&lt;"'&gt;** inside something like inside brackets or parenthesis for example


    ##trigger effect
    **c&lt;motion&gt;** change
    **d&lt;motion&gt;** delete
    **y&lt;motion&gt;** yank into register
    **g~&lt;motion&gt;** swap case
    **gu&lt;motion&gt;** make lowercase
    **gU&lt;motion&gt;** make uppercase
    **>&lt;motion&gt;** shift right
    **<&lt;motion&gt;** shift left
    **=&lt;motion&gt;** auto-indent

    ##command effect
    **v** enable characterwise Visual mode
    **V** enable linewise Visual mode
    **&lt;C-v&gt;** enable blockwise Visual mode
    **gv** reselect the last visual selection
    **o** go to other end of highlighted text
    trigger | effect
    ------------- | -------------
    c&lt;motion&gt; | change
    d&lt;motion&gt; | delete
    y&lt;motion&gt; | yank into register
    g~&lt;motion&gt;| swap case
    gu&lt;motion&gt;| make lowercase
    gU&lt;motion&gt;| make uppercase
    >&lt;motion&gt; | shift right
    <&lt;motion&gt; | shift left
    =&lt;motion&gt; | auto-indent

    command | effect
    ------------- | -------------
    v | enable characterwise Visual mode
    V | enable linewise Visual mode
    &lt;C-v&gt;| enable blockwise Visual mode
    gv** | reselect the last visual selection
    o | go to other end of highlighted text

    ## buffer management
    **&lt;C-\^&gt; or &lt;C-6&gt;** switch to the buffer you just left
    @@ -52,14 +53,16 @@
    **:on[ly] &lt;C-w&gt;o** keep only the active window, closing all others

    ##ctags
    **:!ctags -R** jump to first tag that matches word under the cursor
    **&lt;C-]&gt;** Prompt user to select from multiple matches for the word under the cursor.
    **g&lt;C-]&gt;** present a list of choices if there is more than a single tag to jump to
    **&lt;C-t&gt;** like the back button for tag history
    **:tag &lt;keyword&gt;** jump to first tag that matches word under the cursor
    **:tjump &lt;keyword&gt;** Prompt user to select from multiple matches for the word under the cursor.
    **:pop or &lt;C-t&gt;** Prompt user to select from multiple matches for the word under the cursor.
    **:tselect** Prompt user to choose an item from the tag matchlist
    command | effect
    ------------- | -------------
    :!ctags -R |jump to first tag that matches word under the cursor
    &lt;C-]&gt; |Prompt user to select from multiple matches for the word under the cursor.
    g&lt;C-]&gt; |present a list of choices if there is more than a single tag to jump to
    &lt;C-t&gt; |like the back button for tag history
    :tag &lt;keyword&gt; |jump to first tag that matches word under the cursor
    :tjump &lt;keyword&gt; |Prompt user to select from multiple matches for the word under the cursor.
    :pop or &lt;C-t&gt; |Prompt user to select from multiple matches for the word under the cursor.
    :tselect |Prompt user to choose an item from the tag matchlist

    ##spelling
    **]s** Jump to next spelling error
  15. @socketwiz socketwiz revised this gist May 20, 2012. 1 changed file with 69 additions and 39 deletions.
    108 changes: 69 additions & 39 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -3,62 +3,62 @@
    **l** count characters right
    **^** to the first character of the line
    **$** to the last character of the line
    **f\<char>** to t he counth character occurrence to the right
    **F\<char>** to t he counth character occurrence to the left
    **t\<char>** to 1 character just before the counth character occurrence to the right
    **T\<char>** to 1 character just before the counth character occurrence to the left
    **f&lt;char&gt;** to t he counth character occurrence to the right
    **F&lt;char&gt;** to t he counth character occurrence to the left
    **t&lt;char&gt;** to 1 character just before the counth character occurrence to the right
    **T&lt;char&gt;** to 1 character just before the counth character occurrence to the left
    **w** count words to the right
    **W** count words to the left
    **e** forward to the end of a word count
    **b** backward to the end of a word count
    **i<{<"'>** inside something like inside brackets or parenthesis for example
    **i&lt;{&lt;"'&gt;** inside something like inside brackets or parenthesis for example


    ##trigger effect
    **c\<motion>** change
    **d\<motion>** delete
    **y\<motion>** yank into register
    **g~\<motion>** swap case
    **gu\<motion>** make lowercase
    **gU\<motion>** make uppercase
    **>\<motion>** shift right
    **<\<motion>** shift left
    **=\<motion>** auto-indent
    **c&lt;motion&gt;** change
    **d&lt;motion&gt;** delete
    **y&lt;motion&gt;** yank into register
    **g~&lt;motion&gt;** swap case
    **gu&lt;motion&gt;** make lowercase
    **gU&lt;motion&gt;** make uppercase
    **>&lt;motion&gt;** shift right
    **<&lt;motion&gt;** shift left
    **=&lt;motion&gt;** auto-indent

    ##command effect
    **v** enable characterwise Visual mode
    **V** enable linewise Visual mode
    **\<C-v>** enable blockwise Visual mode
    **&lt;C-v&gt;** enable blockwise Visual mode
    **gv** reselect the last visual selection
    **o** go to other end of highlighted text

    ## buffer management
    **\<C-\^> or \<C-6>** switch to the buffer you just left
    **&lt;C-\^&gt; or &lt;C-6&gt;** switch to the buffer you just left

    ##split windows
    **\<C-w>s** split file horizontally
    **:sp[lit] \<file>**
    **&lt;C-w&gt;s** split file horizontally
    **:sp[lit] &lt;file&gt;**

    **\<C-w>v** split file vertically
    **:vsp[lit] \<file>**
    **&lt;C-w&gt;v** split file vertically
    **:vsp[lit] &lt;file&gt;**

    **\<C-w>w** cycle between open windows
    **\<C-w>h** focus the window to the left
    **\<C-w>j** focus the window below
    **\<C-w>k** focus the window above
    **\<C-w>l** focus the window to the right
    **&lt;C-w&gt;w** cycle between open windows
    **&lt;C-w&gt;h** focus the window to the left
    **&lt;C-w&gt;j** focus the window below
    **&lt;C-w&gt;k** focus the window above
    **&lt;C-w&gt;l** focus the window to the right

    **:cl[ose] \<C-w>c** close the active window
    **:on[ly] \<C-w>o** keep only the active window, closing all others
    **:cl[ose] &lt;C-w&gt;c** close the active window
    **:on[ly] &lt;C-w&gt;o** keep only the active window, closing all others

    ##ctags
    **:!ctags -R** jump to first tag that matches word under the cursor
    **\<C-]>** Prompt user to select from multiple matches for the word under the cursor.
    **g\<C-]>** present a list of choices if there is more than a single tag to jump to
    **\<C-t>** like the back button for tag history
    **:tag \<keyword>** jump to first tag that matches word under the cursor
    **:tjump \<keyword>** Prompt user to select from multiple matches for the word under the cursor.
    **:pop or \<C-t>** Prompt user to select from multiple matches for the word under the cursor.
    **&lt;C-]&gt;** Prompt user to select from multiple matches for the word under the cursor.
    **g&lt;C-]&gt;** present a list of choices if there is more than a single tag to jump to
    **&lt;C-t&gt;** like the back button for tag history
    **:tag &lt;keyword&gt;** jump to first tag that matches word under the cursor
    **:tjump &lt;keyword&gt;** Prompt user to select from multiple matches for the word under the cursor.
    **:pop or &lt;C-t&gt;** Prompt user to select from multiple matches for the word under the cursor.
    **:tselect** Prompt user to choose an item from the tag matchlist

    ##spelling
    @@ -73,9 +73,39 @@
    **:0,$d** delete every line in a file

    ##quickfix window
    **:copen** Open the quickfix window
    **:ccl** Close it
    **:cw** Open it if there are "errors", close it otherwise (some people prefer this)
    **:cn** Go to the next error in the window
    **:cnf** Go to the first error in the next file
    **:cc\<num>** Go to the error by number
    **:copen** Open the quickfix window
    **:ccl** Close it
    **:cw** Open it if there are "errors", close it otherwise (some people prefer this)
    **:cn** Go to the next error in the window
    **:cnf** Go to the first error in the next file
    **:cc\&lt;num&gt;** Go to the error by number

    ##Addon References

    ###tcomment###
    **gc{motion}** Toggle comments (for small comments within one line the &amp;filetype_inline style will be used, if defined)
    **gcc** Toggle comment for the current line
    **gC{motion}** Comment region
    **gCc** Comment the current line
    **&lt;c- _ &gt;&lt;c- _ &gt;** :TComment
    **&lt;c- _ &gt;b** :TCommentBlock

    ###vim-rails###
    **:A** Alternate
    **:R** Related
    **:Rmodel**
    **:Rview**
    **:Rcontroller**
    **:help rails-navigation**

    ###vim-surround###
    **cs&lt;current&gt;&lt;new&gt;** change old delimeter to new
    **ds** remove delimeters
    **ysiw&lt;delimiter&gt;** wrap current word
    **S&lt;delimiter&gt;** while in visual mode
    **S=** in visual mode, rails ERB tag (requires vim-rails)
    **S-** in visual mode, rails ERB tag (requires vim-rails)
    **S#** in visual mode, rails ERB tag (requires vim-rails)
    **&lt;C-s&gt;=** rails ERB tag (requires vim-rails)
    **&lt;C-s&gt;-** rails ERB tag (requires vim-rails)
    **&lt;C-s&gt;#** rails ERB tag (requires vim-rails)
  16. @socketwiz socketwiz revised this gist May 19, 2012. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,7 @@
    **W** count words to the left
    **e** forward to the end of a word count
    **b** backward to the end of a word count
    **i<{<"'>** inside something like inside brackets or parenthesis for example


    ##trigger effect
    @@ -31,6 +32,8 @@
    **gv** reselect the last visual selection
    **o** go to other end of highlighted text

    ## buffer management
    **\<C-\^> or \<C-6>** switch to the buffer you just left

    ##split windows
    **\<C-w>s** split file horizontally
  17. @socketwiz socketwiz created this gist May 9, 2012.
    78 changes: 78 additions & 0 deletions vim.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    ##motions
    **h** count characters left
    **l** count characters right
    **^** to the first character of the line
    **$** to the last character of the line
    **f\<char>** to t he counth character occurrence to the right
    **F\<char>** to t he counth character occurrence to the left
    **t\<char>** to 1 character just before the counth character occurrence to the right
    **T\<char>** to 1 character just before the counth character occurrence to the left
    **w** count words to the right
    **W** count words to the left
    **e** forward to the end of a word count
    **b** backward to the end of a word count


    ##trigger effect
    **c\<motion>** change
    **d\<motion>** delete
    **y\<motion>** yank into register
    **g~\<motion>** swap case
    **gu\<motion>** make lowercase
    **gU\<motion>** make uppercase
    **>\<motion>** shift right
    **<\<motion>** shift left
    **=\<motion>** auto-indent

    ##command effect
    **v** enable characterwise Visual mode
    **V** enable linewise Visual mode
    **\<C-v>** enable blockwise Visual mode
    **gv** reselect the last visual selection
    **o** go to other end of highlighted text


    ##split windows
    **\<C-w>s** split file horizontally
    **:sp[lit] \<file>**

    **\<C-w>v** split file vertically
    **:vsp[lit] \<file>**

    **\<C-w>w** cycle between open windows
    **\<C-w>h** focus the window to the left
    **\<C-w>j** focus the window below
    **\<C-w>k** focus the window above
    **\<C-w>l** focus the window to the right

    **:cl[ose] \<C-w>c** close the active window
    **:on[ly] \<C-w>o** keep only the active window, closing all others

    ##ctags
    **:!ctags -R** jump to first tag that matches word under the cursor
    **\<C-]>** Prompt user to select from multiple matches for the word under the cursor.
    **g\<C-]>** present a list of choices if there is more than a single tag to jump to
    **\<C-t>** like the back button for tag history
    **:tag \<keyword>** jump to first tag that matches word under the cursor
    **:tjump \<keyword>** Prompt user to select from multiple matches for the word under the cursor.
    **:pop or \<C-t>** Prompt user to select from multiple matches for the word under the cursor.
    **:tselect** Prompt user to choose an item from the tag matchlist

    ##spelling
    **]s** Jump to next spelling error
    **[s** Jump to previous spelling error
    **z=** Suggest corrections for current word
    **zg** Add the current word to spell file
    **zw** Remove the current word from spell file

    ##miscellaneous
    **"+p** paste from system clipboard
    **:0,$d** delete every line in a file

    ##quickfix window
    **:copen** Open the quickfix window
    **:ccl** Close it
    **:cw** Open it if there are "errors", close it otherwise (some people prefer this)
    **:cn** Go to the next error in the window
    **:cnf** Go to the first error in the next file
    **:cc\<num>** Go to the error by number