| Command | Explanation |
| :sp [filename], Ctrl+w s | Horizontal split window and open file |
| :vsp [filename], Ctrl+w v | Veritcally split window and open file |
| Ctrl+w [jklh], Ctrl+w [wW] | Move between windows |
| Ctrl+w c | Close current window |
| Ctrl+w = | Set window sizes equal |
| Ctrl+w _ | Maximize current window size |
| Ctrl+w -, Ctrl+w +, :res [n] | Resize windows |
| Ctrl+w T | Turn the current window into a tab |
| Ctrl+w o | Close all windows except the current one |
| Ctrl+w i | Search for the identifier under the cursor in include files and open a new window showing the definition. This is not reliable - only use it if you are too lazy to make tag files |
| :tabnew [filename] | Make a new tab and open file |
| gt, gT | Go back and forth between tabs |
| zz, zb, zt | Scroll so the current line is in the middle, at the bottom, or at the top respectively of the current window. Awesome! |
| gg, G | Jump to the first line and last line, respectively |
| {, } | Jump between blank lines |
| [[, ]], [], ][ | Square brackets are the actual keypresses. Jump to curly braces. Jump up to open, down to close, up to close, and down to open. It looks horribly confusing reading it but it makes sense once you try it. Note that this will not work if the function is not properly formatted! |
| [n]H, M, [n]L | Jump to the top, middle, and bottom of the window. The integers for H and L are offsets from the top/bottom. |
| gd | Jump to the definition of the local variable under the cursor. This also will not work properly if the function curly braces aren't properly formatted (ie not on the same line as the declaration). |
| gqq | Wrap the current line according to textwidth. See :help textwidth for more info. |
| gqap | Wrap the current paragraph according to textwidth. See :help textwidth for more info. Useful when writing email. |
| :lcd [path] | Change the path for the current window |
| :cd [path] | Change the path for all windows/buffers |
| :pwd | Show the current path |
| m [a-z] | Set a marker that is local to the current buffer |
| m [A-Z] | Set a marker that is global across all buffers |
| ' [a-z,A-Z] | Jump to the line of the specified marker |
| ` [a-z,A-Z] | Jump to the exact position of the specified marker |
| ' ' | Jump to the line of the previous position. ' is one of the special markers that is automatically updated. You can use ` on it too. |
| Ctrl+d, Ctrl+u | Scroll a half-page down or up. |
| Ctrl+f, Ctrl+b | Scroll a whole page forward or back. |
| Ctrl+o | Go to the previous line in buffer history. |
| :ls | Show current buffers. |
| :buffer [n] | Goto buffer specified by n. |
| :bad [filename] | Add [filename] to buffer list. It will be loaded on the first access. |
| :bd [n] | Unload buffer specified by n. |
| Ctrl+] | The square bracket is a required keypress. Jump to the definition of the identifier under the cursor using the tags file. Generate a tags file using ctags or ectags. By default vim looks for a file named 'tags' in the current directory (:pwd). You can also use these tags with omnifunc to complete function and variable names! See :help tags for more information. |
| Ctrl+w ] | You must press square bracket for this command. Opens a new window and jumps to the tag for the identifier under the cursor. |
| Ctrl+t | Jump back from previous tag. |
| :ts | Show all and select a tag for this identifier. Useful when you have multiple tags for one identifier (like if a source tree has multiple definitions for a machine-dependent function). |
| :make | Run 'make' in the current directory (:pwd) |
| :copen, :cp, :cn | Open the compile error window, go to the previous compile error, and go to the next compile error. |
| Ctrl+d or Ctrl+t (when in insert mode) | Shift the current line by one tab in the left or right. |