yaohunzhanyue / collcetion

6 stars 0 forks source link

Galicarnax/dcvim: An extension for Double Commander file manager to provide Vim-like key bindings #48

Open yaohunzhanyue opened 4 years ago

yaohunzhanyue commented 4 years ago

dcvim

An extension for Double Commander file manager to provide Vim-like key bindings

While there is a number of console file managers with Vim-like keybindings (e.g., ranger and vifm), it seems that no GUI analogs exist. The dcvim extension allows to use Double Commander (DC), a cross-platform GUI file manager, in Vim-like manner to the extent allowed by the application's API. Since DC does not expose some of its functionality (e.g., basic cursor movements) to its scripts, dcvim relies on external key emulation utilities (xdotool in case of Unix/Linux, and an ad hoc self-made small utility in case of MS Windows).

Currently, dcvim works in Unix/Linux and MS Windows only.

If you want to keep your custom shortcuts along with dcvim keybindings, you should copy the contents of keys.xml into shortcuts.csf instead of using dcvim.csf (but make sure there is no interference).

Install

Linux

MS Windows

Keybindings

Keys Description
k move cursor up
j move cursor down
h move to parent directory
l enter subdirectory or archive1
gg go to top of list
G go to bottom of list
gj move page down
gk move page up
] move 5 entries down
[ move 5 entries up
H move back in history
L move forward in history
f{char} jump to first entry which starts with the character {char}
; jump to next entry in the search initiated with f{char}
, jump to next entry in the search initiated with f{char} (exclude directories)
/ quick search
gh go to home directory
g/ go to root directory
: command line
vv select (mark) all entries
vu unselect all entries
va, v+ add entries to selection using masks
vd, v- remove entries from selection using masks
ve select files with the same extension as that of the file under cursor
vi invert selection
K move cursor up and toggle selection of entries
J move cursor down and toggle selection of entries
yy yank (copy) to clipboard
yd cut to clipboard
yf copy full paths to clipboard
yn copy names only
pp put (paste) from clipboard
cp copy into opposite panel (without confirmation)
cm move into opposite panel (without confirmation)
dd delete to trash
DD delete permanently
sn sort by name / toggle direction
ss sort by size / toggle direction
sd sort by date / toggle direction
se sort by extension / toggle direction
sa sort by attribute / toggle direction
m{char} bookmark current location2
'{char}, `{char} go to bookmarked location
'', `` show DC's directory hotlist
nf new file
nd new directory
nn new network connection
x close network connection
gf advanced search
g. toggle hidden files
gb toggle flat view of directory contents
gy sync directories
gi show history
rr rename
ri rename (put cursor in front of file name)
ra rename (put cursor after file name)3
re rename (put cursor after file extension)
rm multi-rename tool
gs count sizes of subdirectories
z hide/show right (or lower) panel
> increment size of the left/upper panel
< decrement size of the left/upper panel
u swap panels
R refresh
e edit file
gt open terminal
go open Options window
Esc cancel previous "modifier"-key - g, f, y, etc. (back to "normal" mode)
Q quit
  1. Unlike in ranger and vifm, l does not open files, only directories. Binding it to open files is not a good idea as it often leads to casual launch of apps while navigating. However, this might be Ok if a file is an archive, in which case DC enters it as if it was a directory. However, with DC APIs it seems impossible to distinguish files and directories within archives, as well as within remote (FTP) paths, so in these cases l acts as an Open action for files as well.

  2. These bookmarks are different from DC's own directory hotlist. NB: when bookmarking a remote (FTP) location, DC API does not provide WFX-plugin prefix in the path (although internally it works correct for DC's directory hotlist). So to be able to jump to that bookmark, you have to manually add a prefix (e.g., wfx://FTP/...) for the corresponding entry in dcvim/vars/bookmarks.

  3. This key binding assumes you have set the option Select file name without extension when renaming in Options->File Operations->User Interface (if not, ra acts as re)