Vim: vim-vinegar
vim-vinegar
provides a thin layer to enhance the usability of netrw.
-
opens the parent directory of the file you are editing in a vertical split
above.
Now, -
was a key I liked using (it moves you to the first non-space character
on the line above). So I mapped the \
key to what -
does by default using
this mapping:
nnoremap \ :normal! -<cr>
Now, \
moves to the first non-space character on the line above and <cr>
moves to the first non-space character on the line below. These keys are
adjacent so that works quite nicely. This won’t work for everyone as \
is the
default leader key, but I use <space>
as my leader key so it works
for me.
vim-vinegar
commands:
-
open parent directory-
hop up directories~
go to your home directory.
to pre-populate the file name at the end of the command liney.
to yank the full path to the file
Plus you get all the regular netrw
commands, some of which I repeat here for
convenience:
I
toggle thenetrw
banner display (hidden by default)i
toggle display modesgh
toggle hiding dot filesC+6
orc+^
to return to the previous buffer and close thenetrw
splitj
andk
move up and down the directory listing<cr>
expand directory or open the file under the cursor%
create a file in the current directoryd
create a directory in the current directoryR
rename/move the file under the cursorD
delete the file under the cursor
Resources
:help vinegar