Closed vlcinsky closed 7 years ago
The problem seems to be generally bound to opening editor window from within vifm.
Apart from rename
on multiple windows, also command :clone?
has the same type of problem. Note the ?
which shall allow editing target file names before completing the clone action.
It seems like you didn't configure vifm to run nvim instead of Vim (see 'vicmd'
option). The issue arises from the fact that nvim defines $VIM
and $VIMRUNTIME
forcing Vim to process nvim files and something goes wrong (if you don't have Vim configured you it might work in vi compatible mode). Setting 'vicmd'
to nvim
should fix it.
@xaizek I set vicmd
in my ~/.vifm/vifmrc
to nvim
and the first part of the problem seems resolved - the long (translated) list of compains is gone now.
Now when I select multiple files (nvim -> :e .
-> select few files -> :rename
) it opens (without complains) file containing names of selected files.
Anyway, trying to edit the file does not work. I see two status lines at the bottom what means, I have nvim with one terminal window open and in that is another nvim running.
The outer window shows "Normal" mode, the inner one is in "insert" mode.
I am unable to finish editing file names, it does not react to normal nvim commands as it seems the outer windows is catching most of my key strokes. For this reason, when I enter :q
, the outer nvim windows closes (what was not my intention).
For me nested nvim works fine, but maybe that's because I don't have anything configured for nvim except this plugin. Outer nvim remains in --TERMINAL--
mode as it should, maybe something in your configuration of nvim triggers switching back to normal mode?
Yes, I shall try the neovim only with neovim-vifm extension.
I got it.
It was not about any plugin, but keyboard mapping for my terminal mode:
tnoremap <esc> <c-\><c-n>
I use this mapping to make switching between "command-like" terminal mode and normal mode. It allows me to jump around terminal output just by <esc>
and then using vim normal mode navigation commands.
The reasons for mappint it to <esc>
is very simple. I work exclusively on Czech keyboard layout (following advice of my touch typing teacher who explained me, that programming is still possible but my mind will not have to swap two different keyboard layouts). And on Czech keyboard I have to use <altgr>-q
to produce \
what makes <c-\>
a bit difficult (involves three fingers).
Two productivity tools are competing here: terminal mode (I am havy user of it) and vifm within neovim (being heavy user outside of neovim).
Do you have any idea, if I could remap my <esc>
mapping for the time I use the vifm
window?
PS: If there is no simple solution, I agree on closing this issue anyway as the main problem "it does not work" is resolved now.
I'd expect something like this to do the job:
augroup InVifm
autocmd!
autocmd TermOpen term://*:vifm tnoremap <esc> <esc>
augroup END
It works with :VifmToggle
, but not with :e .
. Looks like TermOpen
autocommand isn't fired on termopen()
, while I think it should (per documentation), so it might be a bug in nvim or I'm missing something.
Yes, I can confirm your description:
:Vifm .
and not for other edit stuff.anyway, my mapping for normal terminal use got lost this way.
My current solution is using alternative mapping to escape terminal mode to normal one using Alt-n:
tnoremap <a-n> <c-\><c-n>
Later on I can dive a bit deeper into understanding autocommands and possibly filing issue with neovim. Thanks so far. Using vifm inside of nvim is great.
I'm closing this then, since the plugin itself appears to be working fine.
I just had another idea to implement the mapping, which seems to work:
tnoremap <expr> <esc> bufname('%') !~ '^term://.*:vifm$' ? "\<c-\>\<c-n>" : ''
I have problems to use
:rename
on multiple files.neovim version:
vifm version:
When I open neovim, start vifm from here (by
:e .
), select visually few files and call:rename
, it prints:What translates (translation might not be precise) to:
and vifm opens editor window with the selected files. Neovim shows terminal mode.
After that, I am unable to complete the rename as neovim seems to be completely confused (neovim with terminal window running vifm and vim or neovim editor open from here).
The only sane method to procede is
:cq
.