directory travesal, with simple extension (cp, mv, rm...)
(a gif showing coping files between different directories)
- Supports UNC path on Windows, like wsl folder, Virtual Box shared folder.
- When there are exactly two lf.vim buffers in a Vim tab, commands like
:LfMoveTo
/:LfCopyTo
can be used without a destination argument, emulating behavior like in Dual-Pane file manager. - Files copy operation (
:LfCopyTo
) is implemented as async operation: it does not block UI.
- From normal buffer, press
-
(the cursor is moved to the line representing the file); - In any buffer, run command
:Lf {argument}
: the argument can be a directory or a file; in the latter case, the parent directory of the file is open, while the cursor is moved to the line representing the file. - In one
lf buffer
, use window creating operation (likeCTRL-W_v
/:split
) to create a new window; operations in this new window is independent from the original window. (This is how we emulate Dual-Pane UI)
e
to edit the file where the cursor is on;h
to go to one level up (of the parent directory of current file);l
to go to one level down;K
(shift+k
) to show file info of current file;r
to refresh currentlf buffer
;R
to refresh alllf buffers
in current Vim tab;f
/F
accepts a following character, which will move cursor to the next (or previous) entry beginning with the character;;
/,
is likef
/F
, but reuse the character;yy
to yank full path of current entry;q
to quit Vim if there is only onelf buffer
;- all other key mappings operating on a buffer (like
gg
,G
,j
,k
,p
...).
:Lf {file-or-dir}
: create anlf buffer
(introduced above). All following commands ask for user confirmation before doing actions on files.:LfCopyTo [dest]
: copy entries selected by range, to[dest]
dir; the[dest]
can be omitted if exactly one anotherlf buffer
exists in current Tab;:LfMoveTo [dest]
: like:LfCopyTo
, but operation is replaced withmove
;:LfDelete
: delete entries selected by range.
The plugin name lf.vim
comes from Terminal file manager
lf, which I used in Vim as a file selector.
lf
does not support Dual-Pane UI natively (though can be done with terminal
multiplexer or terminal emulator), so I decided to implement it myself (in a
Vim plugin).
In this plugin, I also add support for Windows UNC path, which is missing from
vim-dirvish
(the directory viewer I used years ago).