Home
VIM/NVIM Commands for Reference
In this post, I will capture all the common commands I use often so that I do not have to do google search every-time I want to type something in NVIM
General Commands
- To delete a line -
dd
- To delete a word -
dw
- To delete from cursor to end of line -
d$
orD
- To move the cursor to particular line number -
:n
where n can be any number - To copy (yank) multiple characters based on selection
- Go to visual mode by
v
- Move your cursor to select the characters/lines
- To copy the selected lines
y
. This will only copy to VIM’s clipboard.
- Go to visual mode by
- To delete multiple characters (or lines) based on selection
- Go to visual mode by
v
- Move your cursor to select the characters/lines
- To delete the selected lines
d
- Go to visual mode by
- To paste the copied (yanked) text -
p
- To go to the end of line -
$
- To go to the beginning of line -
^
- To move one word at a time -
w
- To delete a single character -
x
- To go to the corresponding closing bracket (you need cursor to be on top of opening bracket) -
%
- To delete all the characters from the current cursor position till the next occureance of character -
dtx
wherex
is the character you wish likedt"
. So delete till you find"
.
NERDTree Plugin
- To cycle through the different panes -
Ctrl + w + w
LazyVim
- To Open file explorer -
space + e
- To move to the left tab -
Shift + H
- To move to the right tab -
Shift + L
- To cycle through different panes -
ctrl + w + w