Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open directory under the cursor in other pane in vifm

Tags:

shortcut

vifm

Is there any shortcut in vifm to open the directory currently marked by the cursor in the second pane? and possibly switch to the other pane as well?

like image 369
Sebastian Avatar asked May 03 '16 21:05

Sebastian


2 Answers

The :cd command can receive two arguments, first for the current pane and second for inactive one (as described in this section of manual). This way you can open directory under cursor in other pane with the following command:

:cd %d %c

...where %d is a macro for current directory and %c is macro for file/directory under cursor (see vifm command macros). Or with a single sync command:

:sync %c

You can map it to some key or sequence in your vifmrc (with <Tab> at the end for automatic pane switching):

nnoremap zo :sync %c<CR><Tab>
like image 144
lufterd Avatar answered Jan 04 '23 17:01

lufterd


You can also do:

cd!

this opens the same dir in both panes. try:

cd! /opt
like image 29
Ярослав Рахматуллин Avatar answered Jan 04 '23 16:01

Ярослав Рахматуллин