Train Bridge at Swarthmore College crossing Crum Creek

Vim References

A reference guide for commands I find myself forgetting and searching for constantly.

General Shortcuts

  • <C-[>
    Shorthand for escape. Never leave the home row.

  • <C-g>
    Display status bar with filename

Windows and Tabs

  • :tabe {file}
    Opens file in new tab.

  • :tabo {file}
    Closes all other open tabs.

  • <C-gf>
    Opens the file under the cursor in a tab.

  • gt OR gT
    Move to next or previous tab.

  • :vs or :split
    Split the screen horizontally.

  • :vsp or :vsplit
    Split the screen vertically.

  • <C-[hjkl]>
    Move cursor in direction to screen split

Text Editing and Movement

  • vip
    Visual select of paragraph

  • gq
    Smart Reflow selected text

  • =
    Smart Reindent visual selected text

  • =G
    Smart Reindent from cursor to end of file

  • z. or zz
    Center the screen on the cursor.

Spelling and Editing

  • ]s or [s
    Jump to next misspelled word

  • z=
    Check spelling of word under cursor

  • zg
    Add word under cursor to dictionary

NerdTree

Requires NerdTree plugin

  • <C-n>
    Enables NerdTree. t opens up file in new tab

NerdCommenter

Requires NerdCommenter plugin

  • <leader>c<space>
    Toggles current line comment

  • <leader>cA
    Adds comment to end of current line