Skip to content

Instantly share code, notes, and snippets.

@cholung
Forked from awidegreen/vim_cheatsheet.md
Created October 3, 2015 20:23
Show Gist options
  • Save cholung/1728573b5e804c3b49f3 to your computer and use it in GitHub Desktop.
Save cholung/1728573b5e804c3b49f3 to your computer and use it in GitHub Desktop.

Revisions

  1. @awidegreen awidegreen revised this gist Sep 18, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions vim_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -203,6 +203,8 @@ dib Delete contents in parenthesis '(' ')' block (e.g. function args)
    diB Delete inner '{' '}' block
    daB Delete a '{' '}' block
    das Delete a senctence
    diw Delete word under cursor
    ciw Change word under cursor
    ciB Change inner '{' '}' block
    #J Merge # number of lines together
    ```
  2. @awidegreen awidegreen revised this gist May 27, 2015. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion vim_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -199,7 +199,11 @@ d^ Delete up unto the beginning of the line
    d$ Delete until end of the line
    D See d$, delete until end of the line
    dd Delete whole line
    dib Delete contents in parenthesis block (e.g. function args)
    dib Delete contents in parenthesis '(' ')' block (e.g. function args)
    diB Delete inner '{' '}' block
    daB Delete a '{' '}' block
    das Delete a senctence
    ciB Change inner '{' '}' block
    #J Merge # number of lines together
    ```

    @@ -324,6 +328,8 @@ C-b Change mode: mru (most recent used) | buffers | files
    * http://rayninfo.co.uk/vimtips.html
    * Use ag (silver searcher) as an indexer for Ctrl-P; and py-matcher for ctrl-p matching function: http://blog.patspam.com/2014/super-fast-ctrlp
    * [Command-T authors cheatsheet](https://wincent.com/wiki/Vim_cheatsheet)
    * https://takac.github.io/2013/01/30/vim-grammar/


    ## Plugins ##
    * NERDTree
  3. @awidegreen awidegreen revised this gist Jan 19, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -323,7 +323,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [Best of VimTips](http://zzapper.co.uk/vimtips.html) zzapper 15 Years of Vi + 8+ years of Vim and still learning
    * http://rayninfo.co.uk/vimtips.html
    * Use ag (silver searcher) as an indexer for Ctrl-P; and py-matcher for ctrl-p matching function: http://blog.patspam.com/2014/super-fast-ctrlp
    * [Command-T authors cheatsheet][https://wincent.com/wiki/Vim_cheatsheet]
    * [Command-T authors cheatsheet](https://wincent.com/wiki/Vim_cheatsheet)

    ## Plugins ##
    * NERDTree
  4. @awidegreen awidegreen renamed this gist Jan 19, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md → vim_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -323,6 +323,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [Best of VimTips](http://zzapper.co.uk/vimtips.html) zzapper 15 Years of Vi + 8+ years of Vim and still learning
    * http://rayninfo.co.uk/vimtips.html
    * Use ag (silver searcher) as an indexer for Ctrl-P; and py-matcher for ctrl-p matching function: http://blog.patspam.com/2014/super-fast-ctrlp
    * [Command-T authors cheatsheet][https://wincent.com/wiki/Vim_cheatsheet]

    ## Plugins ##
    * NERDTree
  5. @awidegreen awidegreen revised this gist Aug 29, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    # General #
    ```
    :q close
    :w write/save
    :w write/saves
    :wa[!] write/save all windows [force]
    :wq write/save and close
    :x save and quit, same as wq
    @@ -322,7 +322,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [VimGenius](http://vimgenius.com/) Interactive vim lesson, with some muscle learn potential
    * [Best of VimTips](http://zzapper.co.uk/vimtips.html) zzapper 15 Years of Vi + 8+ years of Vim and still learning
    * http://rayninfo.co.uk/vimtips.html
    * Use ag (silver search) as a indexer for Ctrl-P; and py-matcher for ctrl-p matching function: http://blog.patspam.com/2014/super-fast-ctrlp
    * Use ag (silver searcher) as an indexer for Ctrl-P; and py-matcher for ctrl-p matching function: http://blog.patspam.com/2014/super-fast-ctrlp

    ## Plugins ##
    * NERDTree
  6. @awidegreen awidegreen revised this gist Aug 29, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -322,6 +322,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [VimGenius](http://vimgenius.com/) Interactive vim lesson, with some muscle learn potential
    * [Best of VimTips](http://zzapper.co.uk/vimtips.html) zzapper 15 Years of Vi + 8+ years of Vim and still learning
    * http://rayninfo.co.uk/vimtips.html
    * Use ag (silver search) as a indexer for Ctrl-P; and py-matcher for ctrl-p matching function: http://blog.patspam.com/2014/super-fast-ctrlp

    ## Plugins ##
    * NERDTree
  7. @awidegreen awidegreen revised this gist Aug 12, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -321,6 +321,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * 100 Vim commands every programmer should know http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know
    * [VimGenius](http://vimgenius.com/) Interactive vim lesson, with some muscle learn potential
    * [Best of VimTips](http://zzapper.co.uk/vimtips.html) zzapper 15 Years of Vi + 8+ years of Vim and still learning
    * http://rayninfo.co.uk/vimtips.html

    ## Plugins ##
    * NERDTree
  8. @awidegreen awidegreen revised this gist Jun 26, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -320,6 +320,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * Productive vim shortcuts http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim
    * 100 Vim commands every programmer should know http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know
    * [VimGenius](http://vimgenius.com/) Interactive vim lesson, with some muscle learn potential
    * [Best of VimTips](http://zzapper.co.uk/vimtips.html) zzapper 15 Years of Vi + 8+ years of Vim and still learning

    ## Plugins ##
    * NERDTree
  9. @awidegreen awidegreen revised this gist May 26, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -126,7 +126,7 @@ B jump backward by words (no punctuation)
    ```

    # Search, jump #
    consider consulting `help [` and `help g`
    consider consulting `:help [` and `:help g`

    ```
    * search for word under cursor (forward) and highlight occurrence (see incsearch, hlsearch below)
  10. @awidegreen awidegreen revised this gist May 26, 2014. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -126,6 +126,7 @@ B jump backward by words (no punctuation)
    ```

    # Search, jump #
    consider consulting `help [` and `help g`

    ```
    * search for word under cursor (forward) and highlight occurrence (see incsearch, hlsearch below)
    @@ -139,6 +140,10 @@ F<c> Find char <c> from current cursor position -- backwards
    ; Repeat previous f<c> or F<c> in same direction
    '. jump back to last edited line.
    g; jump back to last edited position.
    [m jump to start of funtion body
    [i show first declartion/use of the word under cursor
    [I show all occurrences of word under cursor in current file
    [/ cursor to N previous start of a C comment
    ```

    ### vimgrep and quickfix list ###
  11. @awidegreen awidegreen revised this gist Aug 21, 2013. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -301,6 +301,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * http://www.fprintf.net/vimCheatSheet.html
    * https://wiki.archlinux.org/index.php/Vim
    * http://www.fprintf.net/vimCheatSheet.html
    * [Yet Another Vim Cheat Sheet](http://rtorruellas.com/vim-cheat-sheet/)

    ## Articles ##
    * Seven habits of effective text editing: http://www.moolenaar.net/habits.html
    @@ -313,7 +314,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine
    * Productive vim shortcuts http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim
    * 100 Vim commands every programmer should know http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know
    * [Yet Another Vim Cheat Sheet](http://rtorruellas.com/vim-cheat-sheet/)
    * [VimGenius](http://vimgenius.com/) Interactive vim lesson, with some muscle learn potential

    ## Plugins ##
    * NERDTree
  12. @awidegreen awidegreen revised this gist Aug 21, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -314,6 +314,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * Productive vim shortcuts http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim
    * 100 Vim commands every programmer should know http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know
    * [Yet Another Vim Cheat Sheet](http://rtorruellas.com/vim-cheat-sheet/)

    ## Plugins ##
    * NERDTree
    * NERDCommenter
  13. @awidegreen awidegreen revised this gist Aug 21, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -313,7 +313,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine
    * Productive vim shortcuts http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim
    * 100 Vim commands every programmer should know http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know

    * [Yet Another Vim Cheat Sheet](http://rtorruellas.com/vim-cheat-sheet/)
    ## Plugins ##
    * NERDTree
    * NERDCommenter
  14. @awidegreen awidegreen revised this gist Aug 21, 2013. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -168,7 +168,20 @@ Unimpaired plugin (https://github.com/tpope/vim-unimpaired) provides the followi
    ```
    see also: http://usevim.com/2012/08/24/vim101-quickfix/ and http://vimdoc.sourceforge.net/htmldoc/quickfix.html


    ## Marks ##
    Mark a position in a buffer and jump back to it. see also http://vim.wikia.com/wiki/Using_marks
    ```
    ma set mark a at current cursor location
    'a jump to line of mark a (first non-blank character in line)
    `a jump to position (line and column) of mark a
    d'a delete from current line to line of mark a
    d`a delete from current cursor position to position of mark a
    c'a change text from current line to line of mark a
    y`a yank text to unnamed buffer from cursor to position of mark a
    :marks list all the current marks
    :marks aB list marks a, B
    ```
    (text is copied from link above)

    # Editing #
    ```
  15. @awidegreen awidegreen revised this gist Aug 16, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -182,6 +182,7 @@ d$ Delete until end of the line
    D See d$, delete until end of the line
    dd Delete whole line
    dib Delete contents in parenthesis block (e.g. function args)
    #J Merge # number of lines together
    ```

    ```
  16. @awidegreen awidegreen revised this gist Jul 9, 2013. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -207,7 +207,11 @@ U Convert selection (visual mode) to uppercase
    :g/^#/d Delete all lines that begins with #
    :g/^$/d Delete all lines that are empty
    ```
    # Misc #

    ```
    ga Show ASCII of char under cursor
    ```

    # Key sequences #
    #### Replace a word in a number of occurrences with 'bar'; use word under cursor (`*` or `/foo`) ####
  17. @awidegreen awidegreen revised this gist Jul 9, 2013. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -133,7 +133,10 @@ B jump backward by words (no punctuation)
    [{ jump to start of current code block
    ]} jump to end of current code block
    gd jump to var declaration (see incsearch, hlsearch below)
    f<c> Find char <c> from current cursor position
    f<c> Find char <c> from current cursor position -- forwards
    F<c> Find char <c> from current cursor position -- backwards
    , Repeat previous f<c> or F<c> in opposite direction
    ; Repeat previous f<c> or F<c> in same direction
    '. jump back to last edited line.
    g; jump back to last edited position.
    ```
  18. @awidegreen awidegreen revised this gist Jun 30, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -291,6 +291,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [usevim.com](http://usevim.com/) Plugin introductions and useful tipps
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine
    * Productive vim shortcuts http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim
    * 100 Vim commands every programmer should know http://www.catswhocode.com/blog/100-vim-commands-every-programmer-should-know

    ## Plugins ##
    * NERDTree
  19. @awidegreen awidegreen revised this gist May 15, 2013. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -195,6 +195,11 @@ r<c> Replace char <c>
    :%s/xxx/yyy/g Replace xxx with yyy global in the whole file
    ```

    ```
    u Convert selection (visual mode) to lowercase
    U Convert selection (visual mode) to uppercase
    ```

    ```
    :g/^#/d Delete all lines that begins with #
    :g/^$/d Delete all lines that are empty
  20. @awidegreen awidegreen revised this gist May 13, 2013. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -134,6 +134,8 @@ B jump backward by words (no punctuation)
    ]} jump to end of current code block
    gd jump to var declaration (see incsearch, hlsearch below)
    f<c> Find char <c> from current cursor position
    '. jump back to last edited line.
    g; jump back to last edited position.
    ```

    ### vimgrep and quickfix list ###
    @@ -176,6 +178,7 @@ d^ Delete up unto the beginning of the line
    d$ Delete until end of the line
    D See d$, delete until end of the line
    dd Delete whole line
    dib Delete contents in parenthesis block (e.g. function args)
    ```

    ```
  21. @awidegreen awidegreen revised this gist May 5, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -282,6 +282,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [vimcasts.org](http://vimcasts.org/) Video-casts on vim
    * [usevim.com](http://usevim.com/) Plugin introductions and useful tipps
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine
    * Productive vim shortcuts http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim

    ## Plugins ##
    * NERDTree
  22. @awidegreen awidegreen revised this gist Apr 30, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -100,8 +100,8 @@ M Jump to MIDDLE of screen
    L Jump to BOTTOM of screen
    C-b Move back one full screen (page up)
    C-f Move forward one full screen (page down)
    C-d Move forward 1/2 screen
    C-u Move back (up) 1/2 screen
    C-d Move forward 1/2 screen; half page down
    C-u Move back (up) 1/2 screen; half page up
    ```

    ```
  23. @awidegreen awidegreen revised this gist Apr 26, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -276,12 +276,12 @@ C-b Change mode: mru (most recent used) | buffers | files
    ## Articles ##
    * Seven habits of effective text editing: http://www.moolenaar.net/habits.html
    * Vim After 11 Years: http://statico.github.com/vim.html
    * Coming Home to Vim: http://stevelosh.com/blog/2010/09/coming-home-to-vim

    ## tipps and tricks ##
    * [vimcasts.org](http://vimcasts.org/) Video-casts on vim
    * [usevim.com](http://usevim.com/) Plugin introductions and useful tipps
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine
    * http://stevelosh.com/blog/2010/09/coming-home-to-vim

    ## Plugins ##
    * NERDTree
  24. @awidegreen awidegreen revised this gist Apr 26, 2013. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -281,6 +281,7 @@ C-b Change mode: mru (most recent used) | buffers | files
    * [vimcasts.org](http://vimcasts.org/) Video-casts on vim
    * [usevim.com](http://usevim.com/) Plugin introductions and useful tipps
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine
    * http://stevelosh.com/blog/2010/09/coming-home-to-vim

    ## Plugins ##
    * NERDTree
  25. @awidegreen awidegreen revised this gist Apr 25, 2013. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -277,7 +277,26 @@ C-b Change mode: mru (most recent used) | buffers | files
    * Seven habits of effective text editing: http://www.moolenaar.net/habits.html
    * Vim After 11 Years: http://statico.github.com/vim.html

    ## Color column##
    ## tipps and tricks ##
    * [vimcasts.org](http://vimcasts.org/) Video-casts on vim
    * [usevim.com](http://usevim.com/) Plugin introductions and useful tipps
    * [vimregex.com](http://vimregex.com/) Infos about vims regex engine

    ## Plugins ##
    * NERDTree
    * NERDCommenter
    * Ctrl-P
    * easytags
    * unimpard
    * supertab
    * tagbar
    * omnicomplete (C++)

    ## Themes ##
    * zenburn
    * tango

    ## Color column ##
    * activate colorcolumn: http://stackoverflow.com/questions/1919028/how-to-show-vertical-line-to-wrap-the-line-in-vim
    * set color: http://choorucode.wordpress.com/2011/07/29/vim-set-color-of-colorcolumn/

  26. @awidegreen awidegreen revised this gist Apr 25, 2013. 1 changed file with 29 additions and 28 deletions.
    57 changes: 29 additions & 28 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -65,34 +65,6 @@ q[a-z] Start recording, everything will be recorded including movement actions
    @[a-z] Execute the recorded actions.
    ```

    ### vimgrep and quickfix list ###
    built-in grep, vimgrep uses vim's quickfix list. see vimcasts#44 for introduction: http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
    ```
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g)
    in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /)
    will insert the last search pattern.
    :vimgrep /<a>/g <filelist> Search in the given files (<filelist>)
    :vimgrep /<a>/g *.cc Search in all *.cc files current directory
    :vimgrep /<a>/g **/*.cc Search in all *.cc files in every sub-directory (recursively)
    :vimgrep /<a>/g `find . -type f`
    Search in all files that are returns by the backtick command.
    :vim short for :vimgrep
    :cnext Jump to next record/match in quickfix list
    :cprev Jump to previous record/match in quickfix list
    ```
    Unimpaired plugin (https://github.com/tpope/vim-unimpaired) provides the following mappings:
    ```
    [q see :cprev
    ]q see :cnext
    [Q see :cfirst
    ]Q see :clast
    ```
    see also: http://usevim.com/2012/08/24/vim101-quickfix/ and http://vimdoc.sourceforge.net/htmldoc/quickfix.html



    ### Spell checking ###
    See vimcast #19 as an introduction: http://vimcasts.org/episodes/spell-checking/
    @@ -164,6 +136,35 @@ gd jump to var declaration (see incsearch, hlsearch below)
    f<c> Find char <c> from current cursor position
    ```

    ### vimgrep and quickfix list ###
    built-in grep, vimgrep uses vim's quickfix list. see vimcasts#44 for introduction: http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
    ```
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g)
    in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /)
    will insert the last search pattern.
    :vimgrep /<a>/g <filelist> Search in the given files (<filelist>)
    :vimgrep /<a>/g *.cc Search in all *.cc files current directory
    :vimgrep /<a>/g **/*.cc Search in all *.cc files in every sub-directory (recursively)
    :vimgrep /<a>/g `find . -type f`
    Search in all files that are returns by the backtick command.
    :vim short for :vimgrep
    :cnext Jump to next record/match in quickfix list
    :cprev Jump to previous record/match in quickfix list
    ```
    Unimpaired plugin (https://github.com/tpope/vim-unimpaired) provides the following mappings:
    ```
    [q see :cprev
    ]q see :cnext
    [Q see :cfirst
    ]Q see :clast
    ```
    see also: http://usevim.com/2012/08/24/vim101-quickfix/ and http://vimdoc.sourceforge.net/htmldoc/quickfix.html



    # Editing #
    ```
    x Delete char UNDER cursor
  27. @awidegreen awidegreen revised this gist Apr 25, 2013. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -72,11 +72,11 @@ built-in grep, vimgrep uses vim's quickfix list. see vimcasts#44 for introductio
    in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /)
    will insert the last search pattern.
    :vimgrep /<a>/g <filelist> Search in the given files (<filelist>) [FILEPATH]
    :vimgrep /<a>/g *.cc Search in all *.cc files current directory. [WILDCARD]
    :vimgrep /<a>/g **/*.cc Search in all *.cc files in every sub-directory (recursively) [WILDCARD]
    :vimgrep /<a>/g <filelist> Search in the given files (<filelist>)
    :vimgrep /<a>/g *.cc Search in all *.cc files current directory
    :vimgrep /<a>/g **/*.cc Search in all *.cc files in every sub-directory (recursively)
    :vimgrep /<a>/g `find . -type f`
    Search in all files that are returns by the backtick command. [BACKTICK]
    Search in all files that are returns by the backtick command.
    :vim short for :vimgrep
  28. @awidegreen awidegreen revised this gist Apr 25, 2013. 1 changed file with 13 additions and 6 deletions.
    19 changes: 13 additions & 6 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -68,10 +68,17 @@ q[a-z] Start recording, everything will be recorded including movement actions
    ### vimgrep and quickfix list ###
    built-in grep, vimgrep uses vim's quickfix list. see vimcasts#44 for introduction: http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
    ```
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g)
    in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /)
    will insert the last search pattern.
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g)
    in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /)
    will insert the last search pattern.
    :vimgrep /<a>/g <filelist> Search in the given files (<filelist>) [FILEPATH]
    :vimgrep /<a>/g *.cc Search in all *.cc files current directory. [WILDCARD]
    :vimgrep /<a>/g **/*.cc Search in all *.cc files in every sub-directory (recursively) [WILDCARD]
    :vimgrep /<a>/g `find . -type f`
    Search in all files that are returns by the backtick command. [BACKTICK]
    :vim short for :vimgrep
    :cnext Jump to next record/match in quickfix list
    :cprev Jump to previous record/match in quickfix list
    @@ -99,7 +106,7 @@ nnoremap <silent> <leader>s :set spell!<cr>
    <leader>s Toggle Spelling
    ]s Next spelling mistake
    [s Previous spelling mistake
    z= Give Suggestions (prepent 1, use first suggestions automaticly)
    z= Give Suggestions (prepent 1, use first suggestions automatically)
    zg Add misspelled to spellfile
    zug Remove word from spellfile
    ```
    @@ -178,7 +185,7 @@ r<c> Replace char <c>
    ```

    ```
    :s/xxx/yyy/ Replace xxx with yyy at the first occurence
    :s/xxx/yyy/ Replace xxx with yyy at the first occurrence
    :s/xxx/yyy/g Replace xxx with yyy first occurrence, global (whole sentence)
    :s/xxx/yyy/gc Replace xxx with yyy global with confirm
    :%s/xxx/yyy/g Replace xxx with yyy global in the whole file
  29. @awidegreen awidegreen revised this gist Apr 25, 2013. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -68,8 +68,10 @@ q[a-z] Start recording, everything will be recorded including movement actions
    ### vimgrep and quickfix list ###
    built-in grep, vimgrep uses vim's quickfix list. see vimcasts#44 for introduction: http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
    ```
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g) in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /) will insert the last search pattern.
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g)
    in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /)
    will insert the last search pattern.
    :cnext Jump to next record/match in quickfix list
    :cprev Jump to previous record/match in quickfix list
  30. @awidegreen awidegreen revised this gist Apr 25, 2013. 1 changed file with 15 additions and 12 deletions.
    27 changes: 15 additions & 12 deletions vim_shortcuts.md
    Original file line number Diff line number Diff line change
    @@ -65,30 +65,33 @@ q[a-z] Start recording, everything will be recorded including movement actions
    @[a-z] Execute the recorded actions.
    ```

    ### Spell checking ###
    See vimcast #19 as an introduction: http://vimcasts.org/episodes/spell-checking/

    Assuming that you have the following in .vimrc:
    ```
    nnoremap <silent> <leader>s :set spell!<cr>
    ```

    ### vimgrep ###
    ### vimgrep and quickfix list ###
    built-in grep, vimgrep uses vim's quickfix list. see vimcasts#44 for introduction: http://vimcasts.org/episodes/search-multiple-files-with-vimgrep/
    ```
    :vimgrep /<regex>/g % Search for <regex> with multiple occasions per line (g) in current file (%)
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /) will insert the last search pattern.
    :cnext Jump to next record/match in quickfix list
    :cprev Jump to previous record/match in quickfix list
    :vimgrep /<C-r>// % On the command line, <C-r>/ (that is: CTRL-R followed by /) will insert the last search pattern.
    ```
    Using tim cooks unimpaired plugin () provides the following mapping
    Unimpaired plugin (https://github.com/tpope/vim-unimpaired) provides the following mappings:
    ```
    [q see :cprev
    ]q see :cnext
    [Q see :cfirst
    ]Q see :clast
    ```
    see also: http://usevim.com/2012/08/24/vim101-quickfix/ and http://vimdoc.sourceforge.net/htmldoc/quickfix.html



    ### Spell checking ###
    See vimcast #19 as an introduction: http://vimcasts.org/episodes/spell-checking/

    Assuming that you have the following in .vimrc:
    ```
    nnoremap <silent> <leader>s :set spell!<cr>
    ```

    ```
    <leader>s Toggle Spelling