vifm / vifm.vim

Vim plugin that allows use of vifm as a file picker
325 stars 18 forks source link

Is it possible to select a directory to be neovim cwd within vifm? #86

Open satishskamath opened 1 year ago

xaizek commented 1 year ago

No, but it probably won't be hard to add.

satishskamath commented 4 months ago

Sorry for the really late reply @xaizek . I was wondering how this can be approached? I thought of 2 functions and I am not sure if this can already be achieved in some way other than vifm or default netrw has something built in for this:

xaizek commented 4 months ago

Yes, need to use result of --choose-dir, specifically feed it into :cd or :lcd. The catch though is that plugin's code is a mess. Code-wise:

  1. In s:StartVifm and s:HandleRunResults.
  2. Need to check cd for editcmd parameter and upon detection, pass --choose-dir instead of --choose-files.
  3. s:HandleRunResults should do exec cd <path> after checking that there is only one path.