Vim Tip #7: Vifm

Vim Tips

I've never been a huge fan of the plethora of graphical file managers available for Linux. I agree with a friend that "none of them get it right." So I've tried many file managers over the years, but I mostly manage my files from the command line.

So your tip for today is to install vifm (it's available in the regular repos for Fedora, Ubuntu, and Debian). It's a file manager I've looked in on about once a year for the past five or six years, and I think it's finally got to the point where I'm going to start using it. I love the dual pane layout, and of course the Vim integration. I'd suggest you fire it up, notice that <Tab> gets you between the panes, /searchterm finds file names, j and k move you up and down ...

Now quit (I know you're having fun playing, but do this first). Use your favourite editor to edit ~/.config/vifm/vifmrc (that's where it was on my system: it may be ~/.vifmrc on yours - if neither, I'm afraid you'll have to look at the docs). There's only one reason we're editing this file: the very first uncommented line in the file says:

set vicmd=vim

This is clearly wrong. Change it:

set vicmd=nvim

(Obviously you shouldn't do this if you're not using NeoVim ... you should be.) Now you can play. Try renaming a file by typing :rename when the file is under the cursor. Move to another directory in one of the panes. Use dd on a file, hit <Tab>, then p to paste the deleted file. You can of course also do yy to yank a file and paste a copy into the other directory.

Special bonus extra (I haven't tried this, but I'm glad it's available): if you really like vifm, you can use it as the file picker inside NeoVim to replace netrw and/or Nerdtree. ( https://github.com/vifm/neovim-vifm )