11

With my pending adoption of Ubuntu MATE 22.04, I am looking primarily at , with possible adaptation as /. I am very comfortable with Vim, but am looking for a proper layer for that tool of choice (want to do some for CAD, for personal medical), and it seems from what I have come across that Neovim is the way to go (or as some have said, the way of the future). (I DO NOT want answers discussing it here, but have posted separately on suitability of GNAT Studio for Python)

I want to make sure that I don't jump out of the frying pan into the fire.

Are there any gotchas that someone evaluating such a transition needs to know before making the move? Such as (please make reference to category in your response):

  1. things that would "break" what are normal practice from within Vim,
  2. things that are not portable from Vim to Neovim,
  3. things that cannot be migrated as-is,
  4. things that need "tweeks" to migrate,
  5. things that need to be "translated" to a new language but would still work in Neovim,
  6. things that need to be "adapted" via lua because the functionality cannot be migrated as-is to neovim,
  7. things that require a new skillset (more than ; I don't currently know VimScript; trying to decide learning one or the other),
  8. things that need a major change in mind-set of the approach to using Vim

Thank you all for your inputs.

10
  • 1
    If I may, I would suggest that for your Collected Community Response, you include the description of what is lacking/broken, along with the specific sequence to follow to reproduce the failed condition. That way, there can be no basis for rejecting the claims being stated, and all can independantly re-confirm those claims. Sep 22, 2022 at 17:32
  • 5
    I dispute categorically the labelling of my question as opinion-based. Answers may be opinion-driven, but there is NO opinion in the original question. I also made another coment where I asked for specific references to be documented for reproducing claimed responses. How can this not be more fact-based? Please re-open. Sep 22, 2022 at 20:10
  • 2
    Even more important, the most voted answer is written in such a way that cannot be described as opinion-based, which means that the question doesn't encourage opinion-based answers. The reason for closing this question should be stated clearly so that it can be modified. Maybe just remove "not widely known" and structure the question in terms of "drawbacks of switching to neovim"?
    – r_31415
    Sep 22, 2022 at 20:41
  • 1
    I agree this is not an opinion-based question, as it focuses on objective differences. I do think it has the potential to attract opinionated answers (e.g. MDeBusk's answer probably falls in that category), but that's not really a problem with the question as such. Sep 23, 2022 at 10:32
  • 1
    I agree it's a bit broad @D.BenKnoble, but I think that's okay; it's a really useful question to have IMO, and I've seen it come up in various places a whole bunch of times. There is also some precedent here, e.g. Biggest differences between Vim and vi, What is Neovim, and how is it different from Vim?, What are the differences between the vim plugin managers?, and the occasional question like that hasn't really caused any great problems. Sep 23, 2022 at 20:17

5 Answers 5

13

Neovim has most of the feature of Vim, but not all of them.

Here are a non-exhautive list of features missing in Neovim:

  • not yet support for --remote-silent.
  • dropped support for interactive external command (!).
  • dropped support for encrypted files (via cryptmethod).
  • no direct integration with the system clipboard (but you can use external "providers").
  • removed cscope support

Remote Silent

The --remote-silent flag lets you make sure you have only one instance of gVim running when opening documents from the file browser.

Interactive External Command

In Vim when running an external command via the ! modifier you get a prompt where the user can interact with the program.

In Neovim that has been dropped. The ! still exist and the program is launched but the user can't interact with the program anymore.

A typical example is :w !sudo tee used to write a file that requires administrative rights. The trick requires the user to enter a password but Neovim is not anymore letting the user do.

Cryptmethod

Vim can encrypt file:

  • Using the :X command associate a password to a buffer.
  • Buffer associated to a password are saved encrypted (:w).
  • When reading (:e) an encrypted file the user is prompted for the password to decode the file.

This encryption/decryption is not supported by Neovim.

11
  • Neovim has not yet support for --remote-silent That's not true. --remote-silent is supported in 0.8, at least (and it was probably there starting from 0.7.2 or so).
    – Matt
    Sep 22, 2022 at 15:46
  • @Matt thanks for the hint! I tried to make working with version 0.7 and I have failed. I'll give another try with the new stable release 0.7.2 and adapt the answer accordingly. Sep 22, 2022 at 17:10
  • @Matt, I have tried the --remote-silent option with nvim-qt.exe 0.8.0.1135 and I get a popup saying that --remote-silent option is not supported. Do you have any idea of what I'm doing wrong? Sep 22, 2022 at 18:52
  • Must specify server.
    – Matt
    Sep 22, 2022 at 19:03
  • @Matt, my formulation is indeed not correct. To fulfill my wish to have only one instance I need a script that verify that one instance is already running if not start one otherwise determine which instance exist and connect to it and probably make sure the focus moves to that server. Do you know if such script exist? Anyhow it is much more complex than for gVim don't you think? Sep 22, 2022 at 19:15
2

The biggest thing that's keeping me from switching is that I haven't yet learned lua. If I'm going to switch, I don't want to do it halfway. I currently share vimrc between vim 9 and neovim and I had to make a few changes to it so it'd work with both.

There's also the idea I have that neovim isn't "done". I know no software under active development is truly "done", and no work of art is ever considered by the artist to be "done", but it seems to me that neovim is more of a moving target than I'd care to work with right now. Compared to vim, that is to say.

I'm not a programmer, though. If I were, I likely would have switched already. I've heard too many good things from programmers about neovim to think otherwise.

2
  • 3
    I consider myself a programmer, but even though I would be happy to use Lua for other things, I don't have any interest in using Lua as a configuration language for neovim.
    – r_31415
    Sep 22, 2022 at 19:51
  • @r_31415 Before bash scripting, the last language I bothered getting more than a casual skill level in was Rexx, and we see where that is now. Lua looks interesting to me, and neovim is an excuse to eventually learn it. :)
    – MDeBusk
    Sep 22, 2022 at 21:34
1

List of everything that is supported in Vim but not in Neovim and vise versa regarding the Lua language support

1
  • 2
    those just list lua incompatibilities, there are various others (in Vimscripts, in supported features, etc) Sep 26, 2022 at 9:13
1
  1. Both vim and neovim supports vimscript. If a functionality is supported in both vim and neovim then nothing has be translated if you use vimscript.

  2. If you want to use lua in neovim then you you have to translate everything from vimscript to lua because it's a completely different language.

Depending on what configurations you use in vim you have to google how to write that in lua. There are thousands of options to translate from vimscript to lua, so its practically impossible to answer how to write each of them without seeing your .vimrc

2
  • Note that it is possible to use Lua in Neovim without needing to translate your configuration to Lua using heredoc. See :help :lua-heredoc
    – UnrealApex
    Sep 25, 2022 at 7:19
  • Falsy operator from vimscript is not supported in neovim ??
    – Maxim Kim
    Sep 25, 2022 at 19:38
0

The biggest one for me was getting over the hurdle of learning lua and esp learning how to use the neovim lua api. Vimscript, as flawed as it is, is exceptionally good at the one thing it was made for which is for configuring vim.

For example something as simple as:

  • set clipboard+=unnamedplus in vimscript becomes
  • vim.opt.clipboard:append { 'unnamedplus' } in lua

Also you mentioned

things that require a new skillset (more than lua; I don't currently know VimScript; trying to decide learning one or the other),

You will obviously need to know lua but from my experience, at least if you want to get a bit more involved with your config, you will likely also need to be at least a bit familiar with vimscript as well, as many of the options in neovim (mostly ones relating back to classic vim) still need to be set through vimscript. For example there is no vim.opt.colorscheme "nord" in neovim, instead you'll have to do vim.cmd "colorscheme nord". This is a very simple example but there are many more things like this that require you write vimscript sometimes even if you're trying to completely write your coniguration in lua.

And even apart from that most of the documentation in neovim assumes you're configuring it in vimscipt in which case you'll need to translate that information to lua yourself, and in these cases being able to at least read vimscript and understand what a function requires/does is very very handy. For example I use vimr as my gui client for neovim which has documentation for how to detect if you're running it to be able to set settings that only apply to vimr, but nothing on how to do the same thing in lua so i largely had to find out how to do so myself by reading the documentation for both vim functions and for vims lua api (In this case it was through using if has('vimr') endif which i found i could somewhat recreate in lua since neovim provides the vim.fn module that i could use to access the has() function from vimscript so it just became if vim.fn.has('gui_vimr') == 1 then end)


Fortunately though lua really isn't that hard to learn i think, you can learn basically everything about it in a day and thats coming from someone like me whose still extremely new to programming. The hard parts initially getting started with understanding how neovims lua api works but i think you do get the hang of it very quickly and also since you're planning on using lunarvim/spacevim anyway i think you'll largely be able to get away with not knowing too much for a long time. Also you don't even necessarily have to use lua anyway you can largely just use vimscript in your init.vim from your .vimrc and only really touch lua when plugins require you to do so

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.