DEV Community

Discussion on: Why aren't you on Neovim yet?

Collapse
 
pbnj profile image
Peter Benjamin (they/them)
  • Exactly like VIM, but faster
  • Better performances

That has not been my experience. I have seen micro-benchmarks of LuaJIT outperforming vimscript, but in practice, neovim was noticeably slower on larger files. I've spent days trying to identify the root cause and disabled or removed many lua-based plugins (e.g. tree-sitter, lsp, lualine, ...etc) and was able to narrow it down to neovim's syntax parser. I've tried ruling out unoptimized colorschemes (esp. ones that have a lot of function calls to set colors), syntax files due to inefficient regex pattern matching, :syntax sync minlines=256 and :set synmaxcol=1500 but it all came down to :syntax off. Disabling it brought neovim's (v0.7.0) performance on par with syntax-enabled Vim (8.2.5050).

  • Works out-of-the-box with my extensive VIM configuration
  • Installation and configuration was a breeze, don't need to change anything

The gap will widen over time, esp. that Vim is coming out with vim9script and neovim has been working on making lua a first-class configuration language. More plugins are coming out now requiring luarocks dependencies.

why aren't you on Neovim yet?

I was on Neovim since 0.4 (~2019) until 0.6 (~2022) and I switched back to Vim.
I was using Neovim because it was interchangeable with Vim, but Neovim ecosystem is moving at a frantic pace with everything being re-written in Lua and supporting Neovim-only APIs. I believe (I hope I am wrong) Vim's upcoming vim9script will be the final nail in the coffin of the interop story between Vim and Neovim (ref).

Considering:

  1. how daunting it is to implement custom functionality in Lua and have to interface with vimscript through Lua APIs [0]
  2. the breaking changes in Neovim APIs between 0.5 and 0.7
  3. plugins requiring v0.7+, which in turn would require me to build neovim from source on virtually every remote host I may need neovim on because v0.7 is not available in the package manager repositories,

I would much rather use Vim and write Vimscript, even if vim9script wasn't a thing, just because of how stable Vim has been and I don't feel like I am missing anything in Vim-land, besides some eye-candy which isn't very portable anyway.

It almost feels like NeoVim's decision to maintain interop with Vim at this point is forcing it to be in this awkward middle-of-the-road position, where it tries to be as close as possible to Vim but different enough than Vim. Instead, a clean break from Vim would allow Neovim to design and implement clean/easy/pleasant APIs that are more suitable for their future direction, than trying to maintain compatibility with Vim that is getting more tenuous with every release.


0: Compare this contrived lua:

vim.api.nvim_create_user_command(
  'Foo', 
  'call some#vimscript#function(<args>)',
  { 
    nargs = '*', 
    complete = function(A,L,P) 
      vim.tbl_filter(function(value) 
        vim.... ??? I just want to filter results like `v:val =~ a:A` but WHY IS THIS SO HARD!!! 
      end, vim.fn.systemlist('some shell command')) 
    end
  }
)
Enter fullscreen mode Exit fullscreen mode

to its vimscript counterpart:

function! CommandCompletion(A,L,P) abort
  return filter(systemlist('some shell command'), 'v:val =~ a:A')
endfunction

command! -nargs=* -complete=customlist,CommandCompletion MyCommand
  \ call some#vimscript#function(<args>)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

Great arguments! I have nothing to reply to this except that you make a lot of sense and the performance gain I noticed on my own setup might vary with different conditions.