vifm / vifm.vim

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

Error when any random terminal buffer is already opened in neovim #55

Closed ahmadie closed 3 years ago

ahmadie commented 3 years ago

this seems to only happen with kitty terminal

call plug#begin('~/.vim/plugged') Plug 'vifm/vifm.vim' call plug#end() let mapleader =" " nnoremap n :Vifm

in nvim type :terminal then n

Error - Error detected while processing function 132[13]..72_HandleRunResults:
line 2: Got non-zero code from vifm: 1 Press ENTER or type command to continue

ahmadie commented 3 years ago

I found the problem, actually left side will try to expand to current file, which in case of terminal would be something like term://~//25789:/bin, so I changed following lines:

let ldir = (a:0 > 0) ? a:1 : expand('%:p:h') to let ldir = (a:0 > 0) ? a:1 : ''

which solved the problem

or just use: nnoremap <silent> <leader>n :exec ':Vifm ' . getcwd()<cr> to avoid expand func

xaizek commented 3 years ago

Thanks!