howto/vimtricks

41 lines
1.6 KiB
Text
Raw Normal View History

2019-01-25 21:17:57 +00:00
CMD LINE
vim -o/O *.cpp Open all files in H/V splits
NORMAL MODE
I Start inserting at the beginning of the line
<C-W>[HJKL] Move split to extreme left, bottom, top, right
2021-01-04 21:58:40 +00:00
c% Replace argument with arbitrary nested paren/brackets/etc...
https://thepugautomatic.com/2014/03/vims-life-changing-c-percent/
2019-01-25 21:17:57 +00:00
2019-10-03 16:31:59 +00:00
VISUAL MODE
<C-V>g<C-A/X> Convert column of identical number to inc/decrementing list
2019-01-25 21:17:57 +00:00
COMMAND
:botright split / :bo sp Full width sp across multiple vs
:topleft vsplit / :to vs Full height vs across multiple sp
2021-01-04 21:58:40 +00:00
:[no]scrollbind [un]lock split scrolling together
:retab Replace tabs with the correct number of space after :set expandtab
EX MODE:
# Don't forget good ol' `man ex`
CONFIG
# https://stackoverflow.com/a/23036077/5309963
set viminfo=%,<800,'10,/50,:100,h,f0,n~/.vim/cache/.viminfo
" | | | | | | | + viminfo file path
" | | | | | | + file marks 0-9,A-Z 0=NOT stored
" | | | | | + disable 'hlsearch' loading viminfo
" | | | | + command-line history saved
" | | | + search history saved
" | | + files marks saved
" | + lines saved each register (old name for <, vi6.2)
" + save/restore buffer list
HELP
# https://vimtricks.com/p/vimtricks-help-powerup/
K Jump to docs for word under cursor
<C-]> Jump to tag under cursor
:helpgrep Search docs
2019-01-25 21:17:57 +00:00
#TODO: bring tricks from vimrc