Hacker News new | ask | show | jobs
by dyingkneepad 1365 days ago
Neovim is one of those things that seem maybe cool, but I just can't find a reason to switch. Vim works just fine for me, I don't know what I would be getting by switching, and I'd probably waste some time porting my config and workflow to whatever the differences are (I'm a heavy user of :terminal).
17 comments

I switched to neovim because of LSP (Language server protocol) support. I know there are libraries (or whatever cool kids call it these days), which brings this functionality to og vim, but the lsp integration in neovim just works so nicely out of the box.
og vim does not have full lsp out of the box. However it does have the the api and options to implement one easily.

see: https://vimhelp.org/channel.txt.html#language-server-protoco... https://vimhelp.org/channel.txt.html#channel-mode

Hold on, you don't need anything like Ale or CoC to run LSPs in neovim?
Nope, NeoVim has native LSP support https://neovim.io/doc/lsp/
Plugins built with lua, lsp, treesitter for syntax highlighting are the big ones.

https://neovimcraft.com — For neovim specific plugins

Yes, treesitter is a sea change. Besides the quick and error-tolerant syntax highlighting it provides, plug-ins which use it to manipulate syntax are remarkably fast and accurate.
Yeah it's a tough one. I've switched back and forth relatively freely over the years, but now that new VimScript (vim9 script) has breaking changes and neovim will not be supporting it, it's probably time to pick a pony.

I may end up sticking with og vim but my heart has always been with neovim. regular vim would undoubtedly still be stuck in the stone age (including with no :terminal) had neovim not started some competition. I get the feeling that VimL's evolution was done in a way that made it quite difficult or impossible for neovim to merge/rebase into. Hopefully that wasn't intentional.

The creator of Neovim's LSP integration is currently working on a VimL9 JIT compiler to make Vim9 plugins work for Neovim (early stages). So you still may be able to stay on the fence.
"Exciting progress on vim9script => Nvim-Lua transpiler”: https://twitter.com/Neovim/status/1575455161186664451
Vim has had :terminal since version 8.1 [1].

[1]: https://gist.github.com/mahemoff/8967b5de067cffc67cec174cb3a...

Going somewhat off memory here, but my recollection is that was like 3 or 4 years after neovim's first release.
That’s true.
The whole reason there ever was a vim 8 was neovim and the pressure it applied to implement async plugins and terminal.

Without neovim, we'd still be on vim 7.xxxxx

Vim user for 15+ years here. Switched to neovim last December to try out Github's Copilot plugin (which only supported neovim), and it was basically a drop-in replacement for vim. And I haven't looked back.

I'm also a heavy user of terminal though, and that was the one thing I spent extra time on, because there were subtle differences that I didn't like. If you give neovim a shot again, try this in your ~/.config/nvim/init.vim (aside: I do miss the simpler path of ~/.vimrc):

  " Neovim's default terminal mode bindings aren't great.                                                                  
  " This makes them behave like vim's.
  tnoremap <Esc> <C-\><C-n><C-w>
  tnoremap <C-w> <C-\><C-n><C-w>

  "Always enter the terminal in insert mode
  autocmd BufWinEnter,WinEnter,BufEnter term://* startinsert
  autocmd TermOpen,TermEnter * startinsert
  command! -nargs=0 Terminal :vsplit | term
This allows navigating across splits more seamlessly, and I like defaulting to insert mode whenever I move into a terminal. I also added the :Terminal command because I prefer them in a vsplit by default.
From the opposite side, I decided a few years ago to use neovim in place of vim, and there were no drawbacks to making the switch for me.

Then again, most of my time these days I spend in JetBrains Clion with Vim emulation, as it is much better suited to the kinds of projects that I currently work on than Vim or Neovim ever was. So take my opinion on Vim vs Neovim with a grain of salt.

The big downside is having to install neovim. Good old vim is in macos, git bash on windows, any random vm you’re thrown into… I also use the vim plugin for intellij et al, but I use vim on all the raspberry pi’s, weird windows boxes with some issue, and so forth. It’s already everywhere and neovim isn’t.
Neovim has official appimage-based binaries that you can simply download, chmod, and execute. Just move it into your personal binaries directory and you're done.
Treesitter integration is a bit easier in neovim IMHO (but I haven't tried to make it work with vim too much.)

Newer plugin development seems to be much more on the nvim side than vim as well. (Although I do feel fzf is superior to telescope, at least out of the box.)

I'm happy neovim exists, it rekindled vim development.

Also, someone correct me if I'm wrong, but isn't the bus factor 1 on vim?

> Also, someone correct me if I'm wrong, but isn't the bus factor 1 on vim?

There's a bunch of people who are "members" of the vim organisation on GitHub. I don't know if they have full admin privileges or just commit/issue access. I never really understood why this has to be a problem in the first place: can always clone the repo and continue working on it if Bram disappears.

-------

    vim/vim is licensed under the Vim License

    There are no restrictions on using or distributing an unmodified copy of the software. Parts of the software may also be distributed, but the license text must always be included. For modified versions a few restrictions apply. The license is GPL compatible, you may compile the software with GPL libraries and distribute it.
-------

Source, if anyone wants to dig deeper: https://www.gnu.org/licenses/vim-license.txt

Unsure why I'm being downvoted but okay.

In additional to all the features that others mention, I chose to support the Neovim project. It's a more open alternative without a BDFL that is willing to move forward and modernize the editor, drop support for ancient platforms, and regularly release improvements.

A big deal was splitting the editor engine from the interface so that it's embeddable in other editors.

Your .vimrc will probably work as-is without much work from you.

Plus Vim and Neovim can co-exist on the same machine without an issue to try it out [1].

[1]: https://neovim.io/doc/user/nvim.html#nvim-from-vim

Back in the day, Neovim has always felt about three times snappier than Vim (I think it was Vim 7.2). Also, I don't remember if the newer versions of Vim have it, but Neovim has native LSP support, which is also very nice.
fzf.vim works better, in my subjective opinion, but I haven't configured telescope a lot.
You can change the back-end for telescope so it uses FZF, of FZY or whatever for the filtering. But fzf.vim works a bit better out of the box
Personally I switched purely because of lua, I don't really gel with the vimscript.
I switched because the cursor handling is nicer in neovim. It puts a bar when editing so you can see if you're inserting before or after a character, and an underscore when operating on a single character (like after pressing "r").

The former sucks to do in vim, I couldn't get it working in tmux at all, and I don't think the latter is possible?

Apart from that I'm treating it like vim and using all my existing vimrc and vimscript plugins. It's been good.

Neovim is vim 8 compatible. It _also_ supports LUA script for config and plugins, has native LSP support, and runs much more efficiently.

You can run your current .vimrc using neovim.

  >Neovim ... supports LUA script for config and plugins
Except it doesn't really. Or at least it's very basic. I'll re-post a comment I made on this, when it was discussed a while back [0]

https://news.ycombinator.com/item?id=32624308

----

I've been using Neovim for several years now. Not for any real reason, other than "Let's try 'new & shiny'" when it first emerged. Last week I thought I'd finally get round to converting my existing Neovim init.vim config [which had itself been inherited and developed from my earlier Vim .vimrc one] to Lua [not a language I'd ever used before. But the syntax looked fairly straightforward].

What a waste of time! The easy stuff [enabling/disabling various options] was easy. But then it's easy in Vimscript too. The difficult stuff [defining autocmds, managing my plugins] was either completely ignored in every single "convert your init.vim to to init.lua" tutorial I read... or required wrapping the existing Vimscript block in

  vim.cmd[[ ... ]]
in Lua because Neovim's Lua support can't yet do a lot of this stuff natively. Oh, and this also had the brilliant side-effect of removing syntax highlighting from great swathes of my config file as everything inside vim.cmd[[ ... ]] is rendered as a comment. I spent the best part of a day wrestling with converting to init.lua, left it overnight and then, in the morning thought Why the fuck am I wasting time trying to beat this into shape, when my existing vim.init is already set up exactly how I want it?" and I reverted back to good ol' crusty ol' unfashionable Vimscript.

YMMV if you're actively developing plugins and want to use a more widely utilised language to write them in. But for configuring Neovim itself, Lua is more hassle than it's worth.

The Neovim API is more fully baked now than it was.

I went through the same thing back in the day… now it’s a breeze and I’ve never coded in Lua before. Part of the problem was different users suggesting different things.

"Build your first Neovim configuration in lua” is a good introduction [1].

[1]: https://vonheikemen.github.io/devlog/tools/build-your-first-...

I found this very helpful when switching to nvim recently. Kudos to the author for having the nvim config on github and making videos explaining how he set it all up:

https://github.com/LunarVim/Neovim-from-scratch

https://www.youtube.com/watch?v=ctH-a-1eUME&list=PLhoH5vyxr6...

I gotta say, the Neovim guys are killin’ it on YouTube and Twitch.

They’re reaching a new generation of Neovim/Vim users.

Couple things. Over the last year, the lua API has expanded. You can now do almost everything with only lua! Autocmds, commands, plugin management - all in lua. Even key-mappings can call lua closures directly! And with treesitter, the strings in `vim.cmd([[...]])` calls get highlighted as vimscript.

Not saying you should give it another go, just that your info is out of date ;)

when i switched to neovim, vim did not have :terminal and that was the real killer feature to me. neovim also had better async communication support than vim did. vim caught up, but in the meantime i had already gone full on nvim. Now, with the lua support, there's no way to make my config compatible between the two, and i'm "stuck" on nvim.
Embrace, extend, extinguish!
the reasons why i switched to nvim:

- configuring in lua (much easier than vimscript, imho) - treesitter - built-in language server protocol - plugins (id call them "projects") like telescope

I tried moving to neovim from vim mainly to try Copilot.
I think the selling points are supposed to target plugin authors, and people who like to use a ton of plugins.

However, I would imagine that well over 90% of Vim users don't use a single plugin. At all. They defined some look and feel defaults in a ".vimrc" file 10+ years ago, and never thought about it again. At least that's my user profile, anyway.

So to me, the NeoVim story is mostly Internet drama, about some salty devs who didn't get their patches merged and have been publicly jihading ever since. It's not enough to merely use NeoVim, you have be angry about it.