-
Notifications
You must be signed in to change notification settings - Fork 1
Home
In this vimrc ',' a comma
is the leader.
dd
to delete the current line.
3dd
to delete 3 lines starting from your cursor line.
u
undo
ctr r
redo
/searchterm
to search. m to navigate to the next position. M to navigate to the previous position.
%s/searchterm/replaceterm/g
search and replace globally. If you don't use g then it will only replace the first instance only. Use c with g for vim to ask you every time it replaces the next search term.
ctrl + t, ctrl + d
Indent current line forward, backwards (insert mode).
shift >>, shift <<
Indent current line/block forward, backwards (normal mode and visual mode).
vim -p test.py test.R
opens multiple files in their respective tabs.
more information at
https://vim.fandom.com/wiki/Using_tab_pages
<leader>tnew
To open new tab window.
<leader>to
To only keep the current tab and close the rest.
<leader>tc
To close the current tab.
<leader>tm
To move to the next tab.
<leader>tn
To move to the next tab.
<leader>tp
To move to the previous tab.
ctrl + w v
or :vsplit
ctrl + w w
To navigate in between the split screens.
ctrl + w l
To move to the left screen.
ctrl + w h
To move to the right screen.
:split
or ctrl + w s
ctrl + w j
To move to the bottom screen.
ctrl + w k
To move to the top screen.
vim -o file1 file2
Opens files in horizontal split screens.
vim -O file1 file2
Opens files in vertical split screens.