Last active
September 27, 2015 05:28
-
-
Save hannakalinowska/1218952 to your computer and use it in GitHub Desktop.
Vim Cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| R Enter Insert mode, replacing characters rather than inserting | |
| <C-o> Temporarily get out of Insert mode | |
| ~ Switch case of the character under the cursor and move the cursor to the right. If a [count] is given, do that many characters. | |
| ~{motion} switch case of {motion} text. | |
| {Visual}~ Switch case of highlighted text | |
| "- Last “small” delete | |
| ". Last inserted text | |
| "/ Last search | |
| "* System clipboard | |
| "+ System Selection (X11) | |
| "_ Black hole | |
| "{a-zA-Z0-9.%#:-"} Use register {a-zA-Z0-9.%#:-"} for next delete, yank or put (use uppercase character to append with delete and yank) ({.%#:} only work with put). | |
| I-- [ESC] → write -- to comment each line (in Visual Block mode) | |
| Moving split windows around | |
| <C-w> J | |
| <C-w> r | |
| <C-w> H | |
| <C-w> x | |
| <C-w>t<C-w>K Switch vertical split to horizontal | |
| <C-w>t<C-w>H Switch horizontal split to vertical | |
| <C-o>zz "position the current line in the middle of the screen | |
| <C-r>0 | |
| <C-r>= "calculations (in Insert Mode) | |
| <C-v><Tab> "insert a real Tab | |
| <C-g> | |
| :t | |
| <C-d> "show list of expansions | |
| 'wildmenu' | |
| <C-r><C-w> | |
| <C-r><C-a> | |
| q: "list recent commands | |
| <C-f> | |
| :ls | |
| <C-w>T " open the current file in a new tab | |
| %:h<Tab> | |
| cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment