DEV Community

Cover image for Why aren't you on Neovim yet?
Samuel-Zacharie FAURE
Samuel-Zacharie FAURE

Posted on

Why aren't you on Neovim yet?

Just discovered Neovim today. I can't believe how much I've been missing out!

  • Exactly like VIM, but faster
  • Better performances
  • Works out-of-the-box with my extensive VIM configuration
  • Installation and configuration was a breeze, don't need to change anything
  • Did I mention that it was faster?

And obviously it's free and open-source.

Here's a quick installation guide if you want to get started: just copy-paste this in ~/.config/nvim/init.vim

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
Enter fullscreen mode Exit fullscreen mode

This will make Neovim pick up your current VIM config. So if you end up not liking Neovim for some reason, your VIM config is still intact. You can even have both installed at the same time.

So, why aren't you on Neovim yet?

Top comments (10)

Collapse
 
moopet profile image
Ben Sinclair • Edited

Why not? Because I don't understand the configuration, to be honest. I've tried it and it's too much like magic, and the things that are supposed to be great about it fall into precisely three camps:

  1. Stuff that's also in Vim since version 8.blah now.
  2. Stuff that I'll never use.
  3. Stuff that doesn't work.

So it's a learning curve for no benefit. I might try again sometime I have a weekend to play around.

EDIT: I just installed it, aliased it to vim and used your configuration snippet (though my .vimrc is actually ~/.vim/vimrc but that's a niggle).

Collapse
 
samuelfaure profile image
Samuel-Zacharie FAURE

Tell me if you notice performance improvements, cause I definitely did :)

Collapse
 
moopet profile image
Ben Sinclair

I've noticed one thing: when starting or stopping nvim it often hangs completely. I have to repeatedly bash ctrl-c until it comes to life or gives me a terminal back. I'm not sure what's causing that, there are no messages about it, but it's presumably something to do with my collection of plugins.

Thread Thread
 
samuelfaure profile image
Samuel-Zacharie FAURE

Hu that's weird. I didn't have that issue.

Thread Thread
 
moopet profile image
Ben Sinclair

Probably different plugins conflicting. It does indicate that its vim-ness isn't 100%, which is a downside, but it's probably easy to track down and comment out the offending plugin.

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.

Collapse
 
dumboprogrammer profile image
Tawhid

Who said I ain't running neovim 😁.

Collapse
 
bovermyer profile image
Ben Overmyer

Because I use mostly default vim and choose to optimize other things.

Collapse
 
bidotme profile image
Bakhtiyar Ismayil

Vim is enough fast for me , and short )