Explore & Netrw

:E to enter explore
/search-query to start searching through directory list
:Rex to return to netrw
v to open file in vertical split from

:FZF // find files in current directory
control + v open n vertical split


:vsplit file or :vsp file // open new file vertically
:split file or :sp file // open horizontally

"+p paste the buffer to avoid pasting comments

> from Visual block to bulk indent

d$ or D // delete to end-of-line
dw // delete to next word

:set paste // toggle paste formatting
:set nopaste

:e // edit the file (or re-load) if changed elsewhere


Shift-8 // search for word beginning at cursor

:%s/foo/bar/g // Find each occurrence of 'foo' (in all lines), and replace it with 'bar'.
:s/foo/bar/g // Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
:%s/foo/bar/gc // Change each 'foo' to 'bar', but ask for confirmation first.
:%s/\<foo\>/bar/gc // Change only whole words exactly matching 'foo' to 'bar'; ask for confirmation


:E to open Explorer
:Rex to return to Explorer
R on file to rename
<CR> to enter

h move one character left
j move one row down
k move one row up
l move one character right
w move to beginning of next word
b move to previous beginning of word
e move to end of word
W move to beginning of next word after a whitespace
B move to beginning of previous word before a whitespace
E move to end of word before a whitespace

gg move to first line
G move to last line
nG move to n'th line of file (n is a number; 12G moves to line 12)

Ctrl-D move half-page down
Ctrl-U move half-page up
Ctrl-B page up
Ctrl-F page down
Ctrl-O jump to last (older) cursor position
Ctrl-I jump to next cursor position (after Ctrl-O)
Ctrl-Y move view pane up
Ctrl-E move view pane down

Quit or close file

:bd close buffer (exit file)
:qa! // quit after unsaved changes and buffer has no name


Ctrl+W R // Swap top/bottom or left/right split
ctrl + w _ // max out height of current split
ctrl + w | // max out width of current split
ctrl + w = // normalise all split sizes