{"id":13640629,"url":"https://github.com/pawelborkar/vim-cheatsheet","last_synced_at":"2025-04-11T03:51:05.632Z","repository":{"id":115354172,"uuid":"364817820","full_name":"pawelborkar/vim-cheatsheet","owner":"pawelborkar","description":"Shortcuts that will help you to become an advance VIM user.","archived":false,"fork":false,"pushed_at":"2021-05-11T09:21:39.000Z","size":26,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-22T07:50:37.331Z","etag":null,"topics":["cheatsheet","neovim","tab-shortcuts","vim","vim-cheatsheet","vim-configuration","vim-keyboard-shortcuts"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc-by-4.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pawelborkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-06T07:11:06.000Z","updated_at":"2024-04-03T09:31:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f63f884-5d73-4bd0-953c-5a467d98e13e","html_url":"https://github.com/pawelborkar/vim-cheatsheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelborkar%2Fvim-cheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelborkar%2Fvim-cheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelborkar%2Fvim-cheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawelborkar%2Fvim-cheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawelborkar","download_url":"https://codeload.github.com/pawelborkar/vim-cheatsheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339262,"owners_count":21087214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cheatsheet","neovim","tab-shortcuts","vim","vim-cheatsheet","vim-configuration","vim-keyboard-shortcuts"],"created_at":"2024-08-02T01:01:12.917Z","updated_at":"2025-04-11T03:51:05.612Z","avatar_url":"https://github.com/pawelborkar.png","language":null,"funding_links":[],"categories":["Index"],"sub_categories":["CheatSheets"],"readme":"# VIM KEYBOARD SHORTCUTS\n\n### MOVEMENT\n```\nh        -   Move left\nj        -   Move down\nk        -   Move up\nl        -   Move right\n$        -   Move to end of line\n0        -   Move to beginning of line (including whitespace)\n^        -   Move to first character on line\ngg       -   Move to first line of file\nG        -   Move to last line of file\n\nw        -   Move forward to next word, with cursor on first character (use W to jump by whitespace only)\nb        -   Move backward to next word, with cursor on first character (use B to jump by whitespace only)\ne        -   Move forward to next word, with cursor on last character (use E to jump by whitespace only)\nge       -   Move backwards to next word, with cursor on last character (use gE to jump by whitespace only)\n(        -   Move to beginning of previous sentence. Use ) to go to next sentence\n{        -   Move to beginning of previous paragraph. Use } to go to next paragraph\n+        -   Move forward to the first character on the next line\n-        -   Move backwards to the first character on the previous line\n\nCTRL+u   -   Move up by half a page\nCTRL+d   -   Move down by half a page\nCTRL+b   -   Move up by a page\nCTRL+f   -   Move down by a page\n\nH        -   Move cursor to header (top) line of current visible window\nM        -   Move cursor to middle line of current visible window\nL        -   Move cursor to last line of current visible window\n\nfc       -   Move cursor to next occurrence of character c on the current line. Use Fc to move backwards\ntc       -   Move cursor till next character c on the current line. Use Tc to move backwards\n%        -   Move cursor to next brace, bracket or comment paired to the current cursor location\n\n*        -   Search forward for word under cursor\n#        -   Search backwards for word under cursor\n/word    -   Search forward for word. Accepts regular expressions to search\n?word    -   Search backwards for word. Accepts regular expressions to search\nn        -   Repeat the last / or ? command\nN        -   Repeat the last / or ? command in the opposite direction\n```\n\n### NORMAL MODE -\u003e INSERT MODE\n```\ni        -   Enter insert mode to the left of the cursor\na        -   Enter insert mode to the right of the cursor\nI        -   Enter insert mode at first character of current line\nA        -   Enter insert mode at last character of current line\n\no        -   Insert line below current line and enter insert mode\nO        -   Insert line above current line and enter insert mode\n\ncm       -   Delete (change) the character or word (w) in motion m, then enter insert mode\ncc       -   Delete current line and enter insert mode (unlike dd which leaves you in normal mode)\nC        -   Delete (change) from cursor to end of line, and enter insert mode\n```\n\n### DELETION\n```\nx        -   Delete character forward (under cursor). use x do delete backwards (before cursor)\nr        -   Replace single character under cursor, and remain in normal mode\ns        -   Delete character under cursor, then switch to insert mode\n\ndm       -   Delete in direction of movement m. For m, you can also use w, b, or any other variation\ndd       -   Delete entire current line\nD        -   Delete until end of line\n```\n\n### YANK \u0026 PUT\n```\ny        -   Yank (copy) highlighted text\nyy       -   Yank current linepPut (paste) yanked text below current line\nyw       -   Yank a word from the cursor\nynw      -   Yank n words from the cursor\ny$       -   Yank till the end of the line\nP        -   Put yanked text above current line\nJ        -   Join current line with the next line. Use gJ to exclude join-position space\nxp       -   Transpose two letters (delete and paste, technically)\n```\n\n### VISUAL MODE\n```\nv        -   Enter visual mode and highlight characters\nV        -   Enter visual mode and highlight lines\nCTRL+v   -   Enter visual block mode and highlight exactly where the cursor moves\no        -   Switch cursor from first \u0026 last character of highlighted block while in visual mode\n~        -   Swap case under selection\n\u003c\u003c       -   Shift lines to left\n\u003e\u003e       -   Shift lines to right\n\nvat      -   Highlight all text up to and including the parent element\nvit      -   Highlight all text up to the parent element, excluding the element\nvac      -   Highlight all text including the pair marked with c (like va\u003c, va' or va\")\nvic      -   Highlight all text inside the pair marked with c\n```\n\n### MARKING\n```\nma        -   Set a marker a at cursor position to come back to later. a can be any character you choose\nmb        -   Set a marker b at current position\n`a        -   Move cursor to exact position of the marker you set with ma\n'a        -   Move cursor to the first character of the line marked with ma\n\nd'a       -   Delete from current line to line of mark a\nd`a       -   Delete from current cursor position to position of mark a\nc'a       -   Change text from current line to line of mark a\ny`a       -   Yank text to unnamed buffer from cursor to position of mark a\n\n:marks \t  -   List all the current marks\n:marks ab -   List marks a, b\n\n'a,'bs/test/foo/g - Search and replace test with foo between markers a and b\n\n```\n\n### VIM FOLDING\n```\nzf#j      -   creates a fold from the cursor down # lines.\nzf/string -   creates a fold from the cursor to string .\nv{move}zf -   creates a visual select fold\nzf'a      -   creates a fold from cursor to mark a\n\nzo        -   opens a fold at the cursor.\nzO        -   opens all folds at the cursor.\nza        -   Toggles a fold at the cursor.\nzc        -   closes a fold at the cursor.\nzM        -   closes all open folds.\nzd        -   deletes the fold at the cursor.\nzE        -   deletes all folds.\n\nzj        -   moves the cursor to the next fold.\nzk        -   moves the cursor to the previous fold.\nzm        -   increases the foldlevel by one.\nzr        -   decreases the foldlevel by one.\nzR        -   decreases the foldlevel to zero -- all folds will be open.\n[z        -   move to start of open fold.\n]z        -   move to end of open fold.\n\n:set foldmethod=manual         -  default method v{select block}zf to fold\n:set foldmethod=marker         -  use marker fold method {{{\n:set foldemethod=marker/*,*/   -  user custom marker fold method\n:set foldmethod=indent         -  automatically fold programms per its indentation\n```\n\n### MISCELLANEOUS\n```\nu        -   Undo\nU        -   Undo all changes on current line\nCTRL+R   -   Redo\n.        -   Redo\n\ng~       -   switch case under cursor\ng~$      -   Toggle case of all characters to end of line.\ng~~      -   Toggle case of the current line (same as V~).\ngUU      -   switch the current line to upper case\nguu      -   switch the current line to lower case\n\nCTRL+A   -   Increment the number at cursor\nCTRL+X   -   Decrement the number at cursor\n\n.        -   Repeat last change or delete\n;        -   Repeat last f, t, F, or T command\n,        -   Repeat last f, t, F, or T command in opposite direction\n\nvim +10 \u003cfile_name\u003e            - opens the file at line 10\nvim +/bash cronjob-lab.yml     - opens the file cronjob-lab.yml on the first occurence of bash\n\nvim scp://balasundaramm@mgmt-bst:22/~/automation/test-file.txt - Edit a remote file via scp\n```\n\n### HISTORY/COMMAND BUFFER\n```\nq:              -   list history in command buffer\nq/              -   search history in command buffer\nCTRL+c CTRL+c   -   close the command buffer\n\n:set list       -   show hidden characters\n\ngg=G            -   Format HTML. Make sure FileType is set to html with :setf html\nCTRL+n          -   Press after typing part of a word. It scrolls down the list of all previously used words\nCTRL+p          -   Press after typing part of a word. It scrolls up the list of all previously used words\n```\n\n### BUFFERS\n```\n:ls (or :buffers)   -   list / show available buffers\n:e filename         -   Edit a file in a new buffer\n:bnext (or :bn)     -   go to next buffer\n:bprev (of :bp)     -   go to previous buffer\n:bdelete (or :bd)   -   unload a buffer (close a file)\n:bwipeout (or :bw)  -   unload a buffer and deletes it\n:b [N]              -   The number of the buffer you are interested to open\n:ball               -   opens up all available buffers in horizontal split window\n:vertical ball      -   opens up all available buffero in vertical split window\n:q                  -   close the buffer window\n:help buffers       -   help for buffers\n:r \u003cfile_path\u003e      -   reads a file from the path to the buffer\n:r !\u003ccommand\u003e       -   reads the output of the command into buffer\n:.! cat \u003cfile_path\u003e -   reads the output of the command (eg: cat) into buffer or !! in ex-mode\n```\n\n### TAB VIEWS\n```\n:tabe filename      -   opens the file in newtab\n:tabe new           -   open an empty tab\n:tabs               -   list opened tabs\n:tabc               -   close the active tab\n:tabn and tabp      -   Go to next tab or previous tab\n:tabfirst           -   Go to the first available tab\n:tablast            -   Go to the last available tab\n:help tabpage       -   help for tabs\n\nvim -p *.txt        -   open all txt files in tabs\n```\n\n### TAB NAVIGATION\n```\ngt                  -   go to next tab\ngT                  -   go to previous tab\n{i}gt               -   go to tab in position i\n```\n\n### TAB SHORTCUTS\n```\nCTRL+W T            -   Break out current window into a new tabview\nCTRL+W o            -   Close every window in the current tabview but the current one\nCTRL+W n            -   create a new window in the current tabview\nCTRL+W c            -   Close current window in the current tabview\n```\n\n### WINDOW MANAGEMENT\n```\n#split screen horizontal\n:split filename\nvim -o file1 file2\n\n#split screen vertical\n:vs filename\nor\n:vsplit filename\nvim -O file1 file2\n\n#close current window\n:hide\n\n#Horizontal resize in active window\n:resize 20\n\n#vertical resize\n:vertical resize 20\n\n#diff\n:windo diffthis -  diff between 2 vsplit windows\n:diffs, diffsplit {filename} - diffs the current window with the file given\n:diffoff  - turns off diff selection\n\n\nCTRL+w s       -   Split current window horizontally\nCTRL+w v       -   Split current window vertically\nCTRL+w c       -   Close current window\nCTRL+w m       -   Move to window according to motion m\nCTRL+w o       -   Maxmize current window (note: this overwrites your current window configuration)\n\n# EX Mode\n:Vex           - Open Vertical Split in ex mode with file browser\n:Sex           - Open Vertical Split in ex mode with file browser\n\n```\n\n### MOVING WINDOWS\n```\nCTRL+W r       -   Swap bottom/top if split horizontally\nCTRL+W R       -   Swap top/bottom if split horizontally\n\nCTRL+w r       -   Rotates the windows from left to right - only if the windows are split vertically\nCTRL+w R       -   Rotates the windows from right to left - only if the windows are split vertically\n\nCTRL+w H       -   Move current window the far left and use the full height of the screen\nCTRL+w J       -   Move current window the far bottom and use the full width of the screen\nCTRL+w K       -   Move current window the far top and full width of the screen\nCTRL+w L       -   Move current window the far right and full height of the screen\n```\n\n### NAVIGATE BETWEEN WINDOWS\n```\nCTRL+w CTRL+w  -   switch between windows\nCTRL+w UP      -   Move to the top window from current window\nCTRL+w DOWN    -   Move to the bottom window from current window\nCTRL+w LEFT    -   Move to the left window from current window\nCTRL+w RIGHT   -   Move to the right window from current window\n```\n\n### RESIZING WINDOWS\n```\n#Sometimes windows open up funny or are rendered incorrectly after separating from an external monitor. Or maybe you want to make more room for an important file.\n\nCTRL+w _       -   Max out the height of the current split\nCTRL+w |       -   Max out the width of the current split\nCTRL+w =       -   Normalize all split sizes, which is very handy when resizing terminal\n\nCTRL+w \u003e       -   Incrementally increase the window to the right. Takes a parameter, e.g. CTRL-w 20 \u003e\nCTRL+w \u003c       -   Incrementally increase the window to the left. Takes a parameter, e.g. CTRL-w 20 \u003c\nCTRL+w -       -   Incrementally decrease the window's height. Takes a parameter, e.g. CTRL-w 10 -\nCTRL+w +       -   Incrementally increase the window's height. Takes a parameter, e.g. CTRL-w 10 +\n```\n\n### COMMENT LINES (TCOMMENT PLUGIN)\n```\nCTRL+_ CTRL+_   -   Comment a line using tcomment\nCTRL+V          -   #{Select the block before commenting a block,\nCTRL+_ CTRL+_   -   Comment a block of line using tcomment}\n```\n\n### MODELINE MAGIC\n```\n:set modeline  -    Enable modeline magic or add this option to your .vimrc\n\\ml            -    write the modeline based on your settings to the file\n```\n\n### NERDTree Plugin\n```\nCTRL-n              -   Toggle\n\nm                   -   opens the  menu\n?                   -   help\ni                   -   horizontal split\ns                   -   vertical split\nCTRL-w + \u003c-|-\u003e      -  (left or right) to navigate\n```\n### PERMISSION OVERRIDE ###\n```\n:w !sudo tee %            -    Allows to override the permission of the written file\n:w !sudo sh -c \"cat \u003e %\"  -             \"                            \"\n\n```\n\n### MOVEMENT\n```\nh        -   Move left\nj        -   Move down\nk        -   Move up\nl        -   Move right\n$        -   Move to end of line\n0        -   Move to beginning of line (including whitespace)\n^        -   Move to first character on line\ngg       -   Move to first line of file\nG        -   Move to last line of file\n\nw        -   Move forward to next word, with cursor on first character (use W to jump by whitespace only)\nb        -   Move backward to next word, with cursor on first character (use B to jump by whitespace only)\ne        -   Move forward to next word, with cursor on last character (use E to jump by whitespace only)\nge       -   Move backwards to next word, with cursor on last character (use gE to jump by whitespace only)\n(        -   Move to beginning of previous sentence. Use ) to go to next sentence\n{        -   Move to beginning of previous paragraph. Use } to go to next paragraph\n+        -   Move forward to the first character on the next line\n-        -   Move backwards to the first character on the previous line\n\nCTRL+u   -   Move up by half a page\nCTRL+d   -   Move down by half a page\nCTRL+b   -   Move up by a page\nCTRL+f   -   Move down by a page\n\nH        -   Move cursor to header (top) line of current visible window\nM        -   Move cursor to middle line of current visible window\nL        -   Move cursor to last line of current visible window\n\nfc       -   Move cursor to next occurrence of character c on the current line. Use Fc to move backwards\ntc       -   Move cursor till next character c on the current line. Use Tc to move backwards\n%        -   Move cursor to next brace, bracket or comment paired to the current cursor location\n\n*        -   Search forward for word under cursor\n#        -   Search backwards for word under cursor\n/word    -   Search forward for word. Accepts regular expressions to search\n?word    -   Search backwards for word. Accepts regular expressions to search\nn        -   Repeat the last / or ? command\nN        -   Repeat the last / or ? command in the opposite direction\n```\n\n### NORMAL MODE -\u003e INSERT MODE\n```\ni        -   Enter insert mode to the left of the cursor\na        -   Enter insert mode to the right of the cursor\nI        -   Enter insert mode at first character of current line\nA        -   Enter insert mode at last character of current line\n\no        -   Insert line below current line and enter insert mode\nO        -   Insert line above current line and enter insert mode\n\ncm       -   Delete (change) the character or word (w) in motion m, then enter insert mode\ncc       -   Delete current line and enter insert mode (unlike dd which leaves you in normal mode)\nC        -   Delete (change) from cursor to end of line, and enter insert mode\n```\n\n### DELETION\n```\nx        -   Delete character forward (under cursor). use x do delete backwards (before cursor)\nr        -   Replace single character under cursor, and remain in normal mode\ns        -   Delete character under cursor, then switch to insert mode\n\ndm       -   Delete in direction of movement m. For m, you can also use w, b, or any other variation\ndd       -   Delete entire current line\nD        -   Delete until end of line\n```\n\n### YANK \u0026 PUT\n```\ny        -   Yank (copy) highlighted text\nyy       -   Yank current linepPut (paste) yanked text below current line\nyw       -   Yank a word from the cursor\nynw      -   Yank n words from the cursor\ny$       -   Yank till the end of the line\nP        -   Put yanked text above current line\nJ        -   Join current line with the next line. Use gJ to exclude join-position space\nxp       -   Transpose two letters (delete and paste, technically)\n```\n\n### VISUAL MODE\n```\nv        -   Enter visual mode and highlight characters\nV        -   Enter visual mode and highlight lines\nCTRL+v   -   Enter visual block mode and highlight exactly where the cursor moves\no        -   Switch cursor from first \u0026 last character of highlighted block while in visual mode\n~        -   Swap case under selection\n\u003c\u003c       -   Shift lines to left\n\u003e\u003e       -   Shift lines to right\n\nvat      -   Highlight all text up to and including the parent element\nvit      -   Highlight all text up to the parent element, excluding the element\nvac      -   Highlight all text including the pair marked with c (like va\u003c, va' or va\")\nvic      -   Highlight all text inside the pair marked with c\n```\n\n### MARKING\n```\nma        -   Set a marker a at cursor position to come back to later. a can be any character you choose\nmb        -   Set a marker b at current position\n`a        -   Move cursor to exact position of the marker you set with ma\n'a        -   Move cursor to the first character of the line marked with ma\n\nd'a       -   Delete from current line to line of mark a\nd`a       -   Delete from current cursor position to position of mark a\nc'a       -   Change text from current line to line of mark a\ny`a       -   Yank text to unnamed buffer from cursor to position of mark a\n\n:marks \t  -   List all the current marks\n:marks ab -   List marks a, b\n\n'a,'bs/test/foo/g - Search and replace test with foo between markers a and b\n\n```\n\n### VIM FOLDING\n```\nzf#j      -   creates a fold from the cursor down # lines.\nzf/string -   creates a fold from the cursor to string .\nv{move}zf -   creates a visual select fold\nzf'a      -   creates a fold from cursor to mark a\n\nzo        -   opens a fold at the cursor.\nzO        -   opens all folds at the cursor.\nza        -   Toggles a fold at the cursor.\nzc        -   closes a fold at the cursor.\nzM        -   closes all open folds.\nzd        -   deletes the fold at the cursor.\nzE        -   deletes all folds.\n\nzj        -   moves the cursor to the next fold.\nzk        -   moves the cursor to the previous fold.\nzm        -   increases the foldlevel by one.\nzr        -   decreases the foldlevel by one.\nzR        -   decreases the foldlevel to zero -- all folds will be open.\n[z        -   move to start of open fold.\n]z        -   move to end of open fold.\n\n:set foldmethod=manual         -  default method v{select block}zf to fold\n:set foldmethod=marker         -  use marker fold method {{{\n:set foldemethod=marker/*,*/   -  user custom marker fold method\n:set foldmethod=indent         -  automatically fold programms per its indentation\n```\n\n### MISCELLANEOUS\n```\nu        -   Undo\nU        -   Undo all changes on current line\nCTRL+R   -   Redo\n.        -   Redo\n\ng~       -   switch case under cursor\ng~$      -   Toggle case of all characters to end of line.\ng~~      -   Toggle case of the current line (same as V~).\ngUU      -   switch the current line to upper case\nguu      -   switch the current line to lower case\n\nCTRL+A   -   Increment the number at cursor\nCTRL+X   -   Decrement the number at cursor\n\n.        -   Repeat last change or delete\n;        -   Repeat last f, t, F, or T command\n,        -   Repeat last f, t, F, or T command in opposite direction\n\nvim +10 \u003cfile_name\u003e            - opens the file at line 10\nvim +/bash cronjob-lab.yml     - opens the file cronjob-lab.yml on the first occurence of bash\n\nvim scp://balasundaramm@mgmt-bst:22/~/automation/test-file.txt - Edit a remote file via scp\n```\n\n### HISTORY/COMMAND BUFFER\n```\nq:              -   list history in command buffer\nq/              -   search history in command buffer\nCTRL+c CTRL+c   -   close the command buffer\n\n:set list       -   show hidden characters\n\ngg=G            -   Format HTML. Make sure FileType is set to html with :setf html\nCTRL+n          -   Press after typing part of a word. It scrolls down the list of all previously used words\nCTRL+p          -   Press after typing part of a word. It scrolls up the list of all previously used words\n```\n\n### BUFFERS\n```\n:ls (or :buffers)   -   list / show available buffers\n:e filename         -   Edit a file in a new buffer\n:bnext (or :bn)     -   go to next buffer\n:bprev (of :bp)     -   go to previous buffer\n:bdelete (or :bd)   -   unload a buffer (close a file)\n:bwipeout (or :bw)  -   unload a buffer and deletes it\n:b [N]              -   The number of the buffer you are interested to open\n:ball               -   opens up all available buffers in horizontal split window\n:vertical ball      -   opens up all available buffero in vertical split window\n:q                  -   close the buffer window\n:help buffers       -   help for buffers\n:r \u003cfile_path\u003e      -   reads a file from the path to the buffer\n:r !\u003ccommand\u003e       -   reads the output of the command into buffer\n:.! cat \u003cfile_path\u003e -   reads the output of the command (eg: cat) into buffer or !! in ex-mode\n```\n\n### TAB VIEWS\n```\n:tabe filename      -   opens the file in newtab\n:tabe new           -   open an empty tab\n:tabs               -   list opened tabs\n:tabc               -   close the active tab\n:tabn and tabp      -   Go to next tab or previous tab\n:tabfirst           -   Go to the first available tab\n:tablast            -   Go to the last available tab\n:help tabpage       -   help for tabs\n\nvim -p *.txt        -   open all txt files in tabs\n```\n\n### TAB NAVIGATION\n```\ngt                  -   go to next tab\ngT                  -   go to previous tab\n{i}gt               -   go to tab in position i\n```\n\n### TAB SHORTCUTS\n```\nCTRL+W T            -   Break out current window into a new tabview\nCTRL+W o            -   Close every window in the current tabview but the current one\nCTRL+W n            -   create a new window in the current tabview\nCTRL+W c            -   Close current window in the current tabview\n```\n\n### WINDOW MANAGEMENT\n```\n#split screen horizontal\n:split filename\nvim -o file1 file2\n\n#split screen vertical\n:vs filename\nor\n:vsplit filename\nvim -O file1 file2\n\n#close current window\n:hide\n\n#Horizontal resize in active window\n:resize 20\n\n#vertical resize\n:vertical resize 20\n\n#diff\n:windo diffthis -  diff between 2 vsplit windows\n:diffs, diffsplit {filename} - diffs the current window with the file given\n:diffoff  - turns off diff selection\n\n\nCTRL+w s       -   Split current window horizontally\nCTRL+w v       -   Split current window vertically\nCTRL+w c       -   Close current window\nCTRL+w m       -   Move to window according to motion m\nCTRL+w o       -   Maxmize current window (note: this overwrites your current window configuration)\n\n# EX Mode\n:Vex           - Open Vertical Split in ex mode with file browser\n:Sex           - Open Vertical Split in ex mode with file browser\n\n```\n\n### MOVING WINDOWS\n```\nCTRL+W r       -   Swap bottom/top if split horizontally\nCTRL+W R       -   Swap top/bottom if split horizontally\n\nCTRL+w r       -   Rotates the windows from left to right - only if the windows are split vertically\nCTRL+w R       -   Rotates the windows from right to left - only if the windows are split vertically\n\nCTRL+w H       -   Move current window the far left and use the full height of the screen\nCTRL+w J       -   Move current window the far bottom and use the full width of the screen\nCTRL+w K       -   Move current window the far top and full width of the screen\nCTRL+w L       -   Move current window the far right and full height of the screen\n```\n\n### NAVIGATE BETWEEN WINDOWS\n```\nCTRL+w CTRL+w  -   switch between windows\nCTRL+w UP      -   Move to the top window from current window\nCTRL+w DOWN    -   Move to the bottom window from current window\nCTRL+w LEFT    -   Move to the left window from current window\nCTRL+w RIGHT   -   Move to the right window from current window\n```\n\n### RESIZING WINDOWS\n```\n#Sometimes windows open up funny or are rendered incorrectly after separating from an external monitor. Or maybe you want to make more room for an important file.\n\nCTRL+w _       -   Max out the height of the current split\nCTRL+w |       -   Max out the width of the current split\nCTRL+w =       -   Normalize all split sizes, which is very handy when resizing terminal\n\nCTRL+w \u003e       -   Incrementally increase the window to the right. Takes a parameter, e.g. CTRL-w 20 \u003e\nCTRL+w \u003c       -   Incrementally increase the window to the left. Takes a parameter, e.g. CTRL-w 20 \u003c\nCTRL+w -       -   Incrementally decrease the window's height. Takes a parameter, e.g. CTRL-w 10 -\nCTRL+w +       -   Incrementally increase the window's height. Takes a parameter, e.g. CTRL-w 10 +\n```\n\n### COMMENT LINES (TCOMMENT PLUGIN)\n```\nCTRL+_ CTRL+_   -   Comment a line using tcomment\nCTRL+V          -   #{Select the block before commenting a block,\nCTRL+_ CTRL+_   -   Comment a block of line using tcomment}\n```\n\n### MODELINE MAGIC\n```\n:set modeline  -    Enable modeline magic or add this option to your .vimrc\n\\ml            -    write the modeline based on your settings to the file\n```\n\n### NERDTree Plugin\n```\nCTRL-n              -   Toggle\n\nm                   -   opens the  menu\n?                   -   help\ni                   -   horizontal split\ns                   -   vertical split\nCTRL-w + \u003c-|-\u003e      -  (left or right) to navigate\n```\n### PERMISSION OVERRIDE ###\n```\n:w !sudo tee %            -    Allows to override the permission of the written file\n:w !sudo sh -c \"cat \u003e %\"  -             \"                            \"\n\n```\n\n## License\n[CC-BY-4.0 License](https://github.com/pawelbr/vim-cheatsheet/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawelborkar%2Fvim-cheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawelborkar%2Fvim-cheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawelborkar%2Fvim-cheatsheet/lists"}