VIM ref
by Gary Cheeseman gary.cheeseman.me.uk
This is my Neovim setup as at July 2017
Package management
For package management I’m using junegunn/vim-plug: Minimalist Vim Plugin Manager
Normal Mode
CTRL-aadd [COUNT] to the number or alphabetic characterCTRL-xsubtract [COUNT] to the number or alphabetic character
Bookmarks
I am using the kshenoy/vim-signature plugin for bookmarks
Normal mode
where
xis a to zmxToggle mark ‘x’ and display it in the leftmost columndmxRemove mark ‘x’ where x is a-zA-Zm,Place the next available markm.If no mark on line, place the next available mark. Otherwise, remove (first) existing mark.m-Delete all marks from the current linem<Space>Delete all marks from the current buffer]` Jump to next mark[` Jump to prev mark]'Jump to start of next line containing a mark['Jump to start of prev line containing a mark`
]Jump by alphabetical order to next mark`
[Jump by alphabetical order to prev mark']Jump by alphabetical order to start of next line having a mark'[Jump by alphabetical order to start of prev line having a markm/Open location list and display marks from current buffer`m[0-9]Toggle the corresponding marker !@#$%^&*()m<S-[0-9]>Remove all markers of the same type]-Jump to next line having a marker of the same type[-Jump to prev line having a marker of the same type]=Jump to next line having a marker of any type[=Jump to prev line having a marker of any typem?Open location list and display markers from current bufferm<BS>Remove all markers
Comments
normal mode
<leader>c spaceNERDComToggleComment<leader>csNERDComSexyComment<leader>cmNERDComMinimalComment<leader>ccNERDCommenterComment<leader>cnNERDCommenterNested<leader>cuNERDComUncommentLine
Buffers
command mode
:lslist buffers:ls!list buffers including hidden:b6goto buffer6:b [TAB]goto buffer by name with auto-completion:b#goto alternate buffer:bddelete current buffer:bd 6delete buffer6:bd 6 23delete buffers6and23:bd [TAB]delete buffer by name can do multiple:22,27bddelete a range of buffers:%bddelete entire range all buffers:bd!adding a bang will delete the buffer even if changed!:bfgoto the first buffer in the list:bngoto the next buffer in the list:bpgoto the previous buffer in the list:bmgoto the next modified buffer in the list:blgoto the last buffer in the list:sb 6split window and goto buffer6s:sbnsplit window and goto next buffer works with many above
Windows
command mode
:spsplit window:vspvertical split window:sp [TAB]split window and open a file with auto-completion:vsp [TAB]vertical split window and open a file
normal mode
CTRL-wxexchange windowsCTRL-wvsplit window verticallyCTRL-wcclose the focused windowCTRL-womake the focused window the only windowCTRL-wpfocus on previous windowCTRL-w CTRL-wcycle round windowsCTRL-w[hjkl]focus on different windowsCTRL-w[HRJL]move window position- a count can be user with above eg.
3<CTRL>wj
Insert Mode
insert mode
CTRL-wdelete previous workCTRL-tshift line rightCTRL-dshift line left
completions
CTRL-nnext completionCTRL-pprevious completionCTRL-eabort completionCTRL-ystop completion and accept the currently selected entry
insert_expand mode
CTRL-X enters insert_expand mode
CTRL-x CTRL-escroll window one line upCTRL-x CTRL-yscroll window one line down
completions
CTRL-x CTRL-lcomplete lineCTRL-x CTRL-nsearch forwards for keywordCTRL-x CTRL-psearch backwards for keywordCTRL-x CTRL-]search for tagCTRL-x CTRL-vsearch for Vim commandsCTRL-x CTRL-sspelling for word before cursor
Sessions
command mode
:mks [FILENAME]save session to file:mks! [FILENAME]save session to existing file:source [FILENAME]reload session
Ultisnips
insert mode
trigger then [TAB]to expand the snippetCRTL-jto move forward through placeholdersCRTL-kto move backward through placeholdersCRTL-[TAB]list snippets
EasyMotion
normal mode
<Leader><Leader>f{char}Find {char} to the right.<Leader><Leader>F{char}Find {char} to the left.<Leader><Leader>t{char}Till before the {char} to the right.<Leader><Leader>T{char}Till after the {char} to the left.<leader><leader>wbeginning of word forward<leader><leader>Wbeginning of WORD forward<leader><leader>bbeginning of word backward<leader><leader>Bbeginning of WORD backward<leader><leader>eend of word forward<leader><leader>Eend of WORD forward<leader><leader>geend of word backward<leader><leader>gEend of WORD backward<leader><leader>jline downward<leader><leader>kline upward
Emmet
all modes
<C-e><C-e>expand coding
Vim folding commands
zf#jcreates a fold from the cursor down # lines.zf/stringcreates a fold from the cursor to string.zjmoves the cursor to the next fold.zkmoves the cursor to the previous fold.zoopens a fold at the cursor.zOopens all folds at the cursor.zmincreases the foldlevel by one.zMcloses all open folds.zrdecreases the foldlevel by one.zRdecreases the foldlevel to zero – all folds will be open.zddeletes the fold at the cursor.zEdeletes all folds.[zmove to start of open fold.]zmove to end of open fold.
Scratch area
div>ul>ul
sudo synclient touchpadoff=1
No comments:
Post a Comment