1.3 KiB
1.3 KiB
+++ date="2022-12-24" author="spanskiduh" title="VIM" description="click to read VIM" +++
VIM
Comment Multiple Lines
:15,25s/^/#
~ comment from line 15 to 25.%s/foo/bar/g
~ replace all apearances offoo
withbar
in whole files/foo//g
~ delete all apearances offoo
in a line:[range]s/{pattern}/{string}/[flags] [count]
this is how it is structured out
Navigation
hjkl
from now on use this keysx[visual]
delete character at current posdw[visual]
delete a word
-- vimtutor 2.5
Nerdtree
s
- open horizontallyi
- open vertically
Panes
ctrl + w
- move through panesctrl + w s
- split horizontallyctrl + w v
- split vertically
Coc
code navigation
VISUAL over function name -> gd
~ go to function definitionVISUAL over data type -> gy / gi
~ go to type definitionVISUAL over function/ datatype -> K
~ show documentationINSERT -> ctl + space
~ toggle autosuggestionsctl + o
~ return backVISUAL gf
~ go to filectl + o
~ take me where i have bene beforectrl + i
~ take me forward
Save
:sav file.txt
~ save new file:new file.txt
~ create new file and open horizontally:vsp file.txt
~ create new file and open vertically
Nvim tree mappings
:help nvim-tree-default-mappings