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
Install xdotool utility (e.g., in Ubuntu: sudo apt install xdotool)
Make sure Lua library is installed (e.g., in Ubuntu: sudo apt install liblua5.1-0)
Copy the contents of dcvim\mswin\toolbar_items.xml into doublecmd.xml, into the section enclosed by <Toolbars><MainToolbar><Row> tags (before copying, make sure DC is not running). [Note that this will introduce several buttons in the toolbar menu. They are used to launch key emulation utility from Lua scripts, since direct call of such utility from Lua does not work properly in Windows.]
(Optional) If you are fussy about running extraneous executables, you may prefer to build dcvim\mswin\keyemulate.exe from C++ code yourself.
Copy or move dcvim.scf from dcvim one level up into DC's config directory
Configure DC:
Options->Keys: set Typing->Letters to None
Options->Keys->Hotkeys: select dcvim.scf as the Shortcut file
cancel previous "modifier"-key - g, f, y, etc. (back to "normal" mode)
Q
quit
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.
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.
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)
dcvim
An extension for
Double Commander
file manager to provide Vim-like key bindingsWhile there is a number of console file managers with Vim-like keybindings (e.g.,
ranger
andvifm
), it seems that no GUI analogs exist. Thedcvim
extension allows to useDouble 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 inUnix/Linux
andMS Windows
only.If you want to keep your custom shortcuts along with
dcvim
keybindings, you should copy the contents ofkeys.xml
intoshortcuts.csf
instead of usingdcvim.csf
(but make sure there is no interference).Install
Linux
xdotool
utility (e.g., in Ubuntu:sudo apt install xdotool
)sudo apt install liblua5.1-0
)dcvim
directory into DC's config directorydcvim.scf
fromdcvim
one level up into DC's config directoryOptions->Keys
: setTyping->Letters
toNone
Options->Keys->Hotkeys
: selectdcvim.scf
as theShortcut file
MS Windows
lua5.1.dll
is present in your DC folderdcvim
directory into DC's config directorydcvim\mswin\toolbar_items.xml
intodoublecmd.xml
, into the section enclosed by<Toolbars><MainToolbar><Row>
tags (before copying, make sure DC is not running). [Note that this will introduce several buttons in the toolbar menu. They are used to launch key emulation utility from Lua scripts, since direct call of such utility from Lua does not work properly in Windows.]dcvim\mswin\keyemulate.exe
from C++ code yourself.dcvim.scf
fromdcvim
one level up into DC's config directoryOptions->Keys
: setTyping->Letters
toNone
Options->Keys->Hotkeys
: selectdcvim.scf
as theShortcut file
Keybindings
k
j
h
l
gg
G
gj
gk
]
[
H
L
f{char}
{char}
;
f{char}
,
f{char}
(exclude directories)/
gh
g/
:
vv
vu
va
,v+
vd
,v-
ve
vi
K
J
yy
yd
yf
yn
pp
cp
cm
dd
DD
sn
ss
sd
se
sa
m{char}
'{char}
,`{char}
''
,``
nf
nd
nn
x
gf
g.
gb
gy
gi
rr
ri
ra
re
rm
gs
z
>
<
u
R
e
gt
go
Esc
g
,f
,y
, etc. (back to "normal" mode)Q
Unlike in
ranger
andvifm
,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 casesl
acts as an Open action for files as well.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
.This key binding assumes you have set the option
Select file name without extension when renaming
inOptions->File Operations->User Interface
(if not,ra
acts asre
)