Last active
May 20, 2017 01:41
-
-
Save fikriauliya/4d4e702ca6be53765a21 to your computer and use it in GitHub Desktop.
Most used VIM shortcuts (Config: https://github.com/amix/vimrc)
This file contains 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
leader: , | |
- ctrl + w + direction: move to selected window | |
- ctrl + w + ctrl + w: move to another window | |
- ctrl + w + =: male all window equals | |
- ctrl + w + _: maximize current window | |
- :hide: close current window | |
- :only: close other windows | |
- u: undo | |
- ctrl + r: redo | |
- G: go to last line | |
- , + b + a: close all buffers | |
- , + b + d: close current buffer | |
- dd: delete line | |
- y: copy | |
- yy: copy line | |
- p: paste | |
- shift + v: select current line | |
- >> or <<: indent | |
- zi: toggle all folding | |
- zj, zk: navigate between folds | |
- za: toggle current folding | |
- zc: toggle parent folding | |
- zM: close all folding | |
- zv: reveal current cursor | |
# MRU | |
- , + f: show MRU | |
#open_file_under_cursor.vim: | |
- gf: open file under cursor | |
#Formating | |
- gg=G: format all | |
#Tabs | |
:set expandtab | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:retab | |
:set tabstop=4 shiftwidth=4 expandtab | |
#Replace | |
:%s/foo/bar/g |
This file contains 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
- ,o: list all buffer | |
- t: open buffer in new tab | |
- d: delete buffer | |
- ls: list all buffer |
This file contains 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
- ctrl + f: open | |
- ctrl + d: document search | |
- ctrl + r: Regex search | |
- ctrl + j/k: navigate list | |
- ctrl + t: open in new tab | |
- ctrl + x: open in new split | |
- ctrl + n/p: navigate history | |
- ctrl + b: buffer search |
This file contains 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
- 'div>p#foo$*3>a' and type '<c-y>,' | |
- ctrl + y + n: go to next edit point | |
- ctrl + y + N: go to prev edit point | |
- ctrl + y + /: toggle comment | |
- ctrl + y + d: select enclosing tag |
This file contains 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
:grep -F "submit" **/*.html | |
:copen | |
:close | |
:cn | |
:cp |
This file contains 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
o or enter: open | |
O: open recursively | |
cd: change dir | |
CD: change root dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment