vifm / vifm.vim

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

Can't replace netRW with Vifm in Neovim. #77

Closed homie-desktop closed 2 years ago

homie-desktop commented 2 years ago

Hi, I'm having trouble replacing netRW with VIFM. However, when trying NERDTree and LF plugin, they work fine as intended. I've already tried the following to add to my .vimrc file.

let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
let g:vifm_replace_netrw = 1

But when I try to open a directory the following error occurs:

Error detected while processing function 24_HandleBufEnter: line 2: E86: Buffer 1 does not exist Press ENTER or type command to continue

This happens when I try to use Vifm, but NERDTree and LF works fine replacing netRW as intended. I'd like to use VIFM as my main file manager, I've already uninstalled LF and NERDTree because VIFM suits my needs. Thanks!

xaizek commented 2 years ago

Hello,

I've already tried the following to add to my .vimrc file.

Why .vimrc? I think you need to add these lines to ~/.config/nvim/init.vim. Have you tried that?

homie-desktop commented 2 years ago

@xaizek just tried it, still doesn't work. Same error;

Error detected while processing function 24_HandleBufEnter:
line 2:
E86: Buffer 1 does not exist
Press ENTER or type command to continue

I'm confused, LF and NERDTree seems to work fine when I try to use them to replace netRW. But when I try with VIFM, I got this same error.

xaizek commented 2 years ago

Try changing line 413 in plugin/vifm.vim to this:

            if bufexists(0)
                buffer #
            else
                enew
            endif

and see if the error goes away.

homie-desktop commented 2 years ago

@xaizek thanks! it's working now. I did what you said and update my .vimrc file

plugin-vifm vim

vimrc-vifm

Now I can fully utilize vim key bindings to my workflow! Thank you so much for the quick response and your time! 👍👍👍

xaizek commented 2 years ago

Thanks for testing. Everything works for me even without this change, I'll commit it then.