Skip to content

Instantly share code, notes, and snippets.

@flov
Created July 10, 2012 00:47
Show Gist options
  • Save flov/3080241 to your computer and use it in GitHub Desktop.
Save flov/3080241 to your computer and use it in GitHub Desktop.

Revisions

  1. flov revised this gist Jul 10, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim tips
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@ Commands to explain:
    insert mode, d deletes without going to insert mode, s substitutes whole
    lines and does not jump into insert mode either

    - Ctrl-Shift ^, better use Capslock-shift ^ or create custom mapping
    - Ctrl-Shift ^, loads the file in the window which has been loaded last
    - Shift-j and pq, shift-j joins the line below with the current line, pg formats the text
    - gg, G jump to the end/beginning of the file
    - map jj to Ctrl-C to jump out of insert mode
  2. flov revised this gist Jul 10, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion vim tips
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ Commands to explain:
    - o, O, insert line below/above and change to insert mode
    - A, go to insert mode at the end of line
    - D, delete line from cursor till the end, does not jump into insert mode
    - C, delete line from cursor till the end, does not jump into insert mode
    - C, delete line from cursor till the end, jumps into insert mode
    - f<character>/F<character> find next/previous character
    - ci" ci' ci} ci) ca) ci) EXAMPLE: how to change what is inside the brackets in 'render_template(:edit)'
    - difference between c, s and d: c changes the selected text and jumps to
  3. @invalid-email-address Anonymous created this gist Jul 10, 2012.
    40 changes: 40 additions & 0 deletions vim tips
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    :r! echo '<p>PASTE IN</p>' | html2haml <--- Converts pasted code to haml
    :r! rake routes <---- inserts output of rake routes in current file

    Commands to explain:
    - o, O, insert line below/above and change to insert mode
    - A, go to insert mode at the end of line
    - D, delete line from cursor till the end, does not jump into insert mode
    - C, delete line from cursor till the end, does not jump into insert mode
    - f<character>/F<character> find next/previous character
    - ci" ci' ci} ci) ca) ci) EXAMPLE: how to change what is inside the brackets in 'render_template(:edit)'
    - difference between c, s and d: c changes the selected text and jumps to
    insert mode, d deletes without going to insert mode, s substitutes whole
    lines and does not jump into insert mode either

    - Ctrl-Shift ^, better use Capslock-shift ^ or create custom mapping
    - Shift-j and pq, shift-j joins the line below with the current line, pg formats the text
    - gg, G jump to the end/beginning of the file
    - map jj to Ctrl-C to jump out of insert mode
    - cd and e command

    How to use . to repeat commands
    How and when to use Ctrl-C with capslock
    How to split windows and work in one window

    Plugins to explain
    Searching strings over files with Ack
    Ctrl-P
    Vim Fugitive
    NERD Tree
    MRU
    :rextract
    Rails plugin

    Direct response on failing code in texteditor
    All vim commands are related to the browser plugins vimium, vimperator

    More:
    Vimcasts
    Vim Book
    Vim Golf