#2614·lf

The bundled Vim script plugin "lf.vim" only works in terminal vim not neovim. Why ?

Author: m040601Created Jun 11, 2026Updated Jun 11, 2026

Apologies if this has been clarified before or explained somewhere else. I cant find it.

TLDR:

  • Why is it that this script lf.vim only works in vim but not neovim ? Is it
  • Would it be possible to upgrade it to also work in neovim ?

I'm looking for a simple solution for using lf BOTH from vim or neovim. I like simplicity and have an aversion to installing extra stuff and wasting time customizing too much.

According to the lf wiki, "Integrations.md"

The bundled Vim script plugin `etc/lf.vim` only works in terminal vim and provides only a basic `:LF` command.
There are a number of vim plugins providing more features which can be used in gvim and neovim as well:
.....

On my system, Archlinux, the official package "lf" installs these two files,

lf /usr/share/vim/vimfiles/ftdetect/lf.vim
lf /usr/share/vim/vimfiles/syntax/lf.vim
  • They are exactly the same file. Why ?
  • They are under "vimfiles/syntax" and "vimfiles/ftdetect" not in "/etc/lf.vim" as stated in the wiki. Why ?

Also on my system, Archlinux, the official "vim" or "neovim" packages install,

vim:

/usr/share/vim/vim92/ftplugin/lf.vim
/usr/share/vim/vim92/indent/lf.vim
/usr/share/vim/vim92/syntax/lf.vim

neovim:

/usr/share/nvim/runtime/ftplugin/lf.vim
/usr/share/nvim/runtime/indent/lf.vim
/usr/share/nvim/runtime/syntax/lf.vim

That "vim92/syntax/lf.vim" or "nvim/runtime/syntax/lf.vim" are for the syntax highlighting. They have nothing to do with the lf package installed "/vim/vimfiles/syntax/lf.vim". They are different files.

Anyway.

I tested it in vim. I did what the lf wiki says, and added to my .vimrc,

"     let lfvim = "/usr/share/vim/vimfiles/ftdetect/lf.vim"
"     if filereadable(lfvim)
"         exec "source " . lfvim
"     endif
"     nnoremap <leader>l :LF<cr>

It works perfectly. It is simple and it is enough for me. It comes already shipped with lf. I do not need or want more.

The only issue is, it only works for vim, not neovim.

Would it be possible to change that situation ?

Thanks in advance.

Additionally, and to avoid confusion and misunderstandings with the syntax files, wouldnt it be more sensible for lf to rename that shipped script file "lf.vim" ? Maybe something like "lfopen.vim" or "open_with_lf.vim" ?