1

Is there a way to change the directory of inactive pane using --remote argument in an existing instance of Vifm?

xaizek
  • 5,098
  • 1
  • 34
  • 60
NESHOM
  • 899
  • 16
  • 46

1 Answers1

1

This can be done via :winrun command or two argument form of :cd alone. Example:

# terminal #1
vifm --server-name test

# terminal #2
vifm --server-name test --remote +'winrun , cd /etc'
vifm --server-name test --remote +'cd . /etc'

Using :cd is simpler, but it will exit tree and custom views, so :winrun is preferable in general case, but :cd is more convenient for one off cases.

xaizek
  • 5,098
  • 1
  • 34
  • 60
  • Thank you, it works perfectly. A question: is it possible to also switch pane after this? So, basically, I want to update the inactive pane and then switch to it. – NESHOM Dec 16 '21 at 13:09
  • Yes, add `+'wincmd w'`. Could simplify to switch first and then cd: `+'wincmd w' +'cd /etc'` – xaizek Dec 16 '21 at 19:00
  • ~ it doesn't work for me. `+'cd . /etc' +'wincmd w'` only changes the inactive pane. Any suggestions? – NESHOM Dec 16 '21 at 20:31
  • I was using an older version of vifm. This works in latest version. Thank you! – NESHOM Dec 16 '21 at 21:01