top | item 35480629

Neovim 0.9

117 points| eugene_pirogov | 3 years ago |github.com | reply

104 comments

order
[+] gpanders|3 years ago|reply
One feature I'm personally excited about is the "undeprecation" of the 'exrc' option, which allows project-specific configuration.

Vim (and thus Neovim) has had the 'exrc' option for a long time, which loads any .exrc or .vimrc (or in Neovim's case, .nvimrc) files in the current directory. However, it does this unconditionally, which is obviously a bit of a security concern as a random .vimrc file could contain arbitrary code. For this reason, Vim recommends not using this option and Neovim even went so far as to mark it deprecated.

In this release, Neovim adds the concept of a "trust database", which is used for the 'exrc' option. When 'exrc' is enabled and a .nvimrc or .nvim.lua file is found in the current directory, Neovim will ask the user if the file is trusted (with the ability to first view the file). The file is only executed if the user explicitly marks it as trusted. Because this solves at least the most egregious security issues with the 'exrc' option, it is now marked undeprecated in Neovim.

I have been using .nvim.lua files for project specific configuration to great effect at work. Hopefully others find this feature useful as well.

[+] pxc|3 years ago|reply
> In this release, Neovim adds the concept of a "trust database", which is used for the 'exrc' option.

This is basically how direnv and shadowenv work. So if anyone has used those, this is the same idea but it lets you layer on project-specific nvim config without shipping a whole, preconfigured nvim with your projects. Pretty cool!

[+] lenkite|3 years ago|reply
I just use a Neovim distro like https://nvchad.com/ and I am reasonably happy. Can customize anything specific on top of that.
[+] wadd1e|3 years ago|reply
Congrats to the Neovim team! I know one complaint that people tend to have with nvim is that they can never get to a stable config that they don't need to keep tweaking; I used to be one of those users that kept making changes to their config but I've had a stable config for roughly 6 or so months now and I've been loving neovim and the fact that it's personalised exactly to my liking. So what I'm trying to say is that there's hope for those who are still in the depths of the configuration rabbit hole :)
[+] gorjusborg|3 years ago|reply
Custom config is not necessary to leverage vim or neovim effectively.

This is a personal usage issue. The fact that you can customize it doesn't mean one needs to, or should.

I run with a mostly vanilla config and a few plugins and have not had to change config for years.

[+] kzrdude|3 years ago|reply
I would suggest everyone to use a neovim plugin manager that has a lockfile, like lazy.nvim, and check in the lockfile. This adds stability.
[+] mattrighetti|3 years ago|reply
Any chance your config is public? I always find cool new stuff when I look at other people’s nvim configs
[+] noloblo|3 years ago|reply
Use Space vim Astrovim or Lunar vim
[+] yanis_t|3 years ago|reply
I just realised that I'm using Neovim despite there are no nvim-specific plugins in my config (CoC covers most of my needs), and I don't use lua.

Still is feels like Neovim is more stable and faster than the regular Vim somehow. Plus it has much better defaults.

[+] ilovecaching|3 years ago|reply
I use default vim, I believe it was a mistake to fracture the ecosystem with plugins that can only be used with neovim. I have also not found any neovim functionality that sells neovim over vim. Vim is fast enough that I have never even thought about it's speed. With term, termdebug, fzf, ripgrep, and ALE with LSPs and Vim's excellent built in support for auto-completion, tag browsing, and cscope, there's really nothing I can't do in another editor I can't do faster in vim and as a bonus I find that I know more about regular expressions than most IDE programmers.
[+] kzrdude|3 years ago|reply
How do you all install neovim on Linux? The .deb is gone with this release, which I think was the most orderly way to fit into my install. I think I'll want to find a PPA solution now. I am not a fan of installs that are not reversible.
[+] pxc|3 years ago|reply
You can always find the latest Neovim in Nixpkgs Unstable, modulo a week or two. Neovim 0.9 is on its way in right now: https://github.com/NixOS/nixpkgs/pull/225152

Just make sure your user's Nix profile is included in your XDG paths like so, and the .desktop files Nix installs will get picked up by your DE: https://nixos.wiki/wiki/Nix_Cookbook#Desktop_environment_doe...

If you really want to stay on top of the bleeding edge, you can use this overlay to run prebuilt copies of Neovim nightly on any distro: https://github.com/nix-community/neovim-nightly-overlay

To ensure that the Nix installation itself is easily removable and sets everything up correctly for you, use the Determinate Nix Installer for a fast and easy installation: https://github.com/DeterminateSystems/nix-installer

In case you don't want to wait for the final package to land in Nixpkgs, command for installing 0.9 from that PR branch after using the above Nix installer is

  nix profile install github:GaetanLePage/nixpkgs/neovim#neovim
which will build from source against that PR branch.

Nix can be a great complement to a stable, conventional base system like Debian for use cases like this. I hope you give it a try!

[+] manaskarekar|3 years ago|reply
If you don't want an older version from your distro, it's easy to use the appImage.

    cd ~
    wget --quiet https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage --output-document nvim
    chmod +x nvim
    sudo chown root:root nvim
    sudo mv nvim /usr/bin
    mkdir -p .config/nvim

To uninstall, one would delete the binary, and .config/nvim + any other folders specified in your plugin manager.
[+] earthling8118|3 years ago|reply
I'm not a fan of installs that aren't reversible either. That's why I don't touch any distro that fights me on that (such as one that supports .deb)
[+] merrickluo|3 years ago|reply
You should get a better package manager/distro. With emerge or pacman, it's easy to find/write your own ebuild/pkgbuild, way better than adding ppas.
[+] gpanders|3 years ago|reply
I have been installing into $HOME/.local for a while now and it works wonderfully. I build from source, but it should work just as well from a tar or AppImage.
[+] jgb1984|3 years ago|reply
A shame they removed the .deb package. Oh well, I use gvim as my daily driver anyway.
[+] collinvandyck76|3 years ago|reply
I have a script in my dotfiles that installs neovim from source, based on a version I set elsewhere.
[+] brotherjerky|3 years ago|reply
We are stuck with the app images now it seems
[+] eterps|3 years ago|reply
I began utilizing Vim approximately three decades ago, and experiencing a contemporary tool like Neovim still feels incredibly astounding.
[+] quesera|3 years ago|reply
As a counterpoint of sorts, if you are accustomed to vim, moving to neovim entails almost zero switching friction.

Everything works just like it's supposed to. In fact sometimes I get neovim instead of vim (when I run "vi" from the shell) and I don't even notice.

I have a fairly simple vim config.

I'm sure this means that I'm missing out on all the great new things about neovim, and maybe I'll get there some day. But I am happy with how vi/vim/neovim work reliably and consistently every time.

[+] favadi|3 years ago|reply
> EditorConfig support is now builtin.

That's great, one less plugin to install.

[+] theusus|3 years ago|reply
I have tried many times to switch to Neovim, but I keep coming back to VS Code.

1. I can't create configs myself. 2. Astro, Lunar ... all break at sometime.

[+] csomar|3 years ago|reply
I don't disagree, but then you shouldn't update Neovim if you are not ready for that. I'll go even farther: don't use Neovim if you are not going to write the config yourself.
[+] velcrovan|3 years ago|reply
Agreed. Neither VS Code nor VS Codium (my preferred variant, telemetry-free) have ever broken my setup with an update, something I can’t say about NeoVim or Emacs.
[+] worksonmine|3 years ago|reply
I'd suggest learning and understanding the vim way of doing things instead of trying to shoehorn the workflow you're used to from VSCode. It's a different world, and it can be really fun to explore but you have to commit.

Start small with empty config and no plugins and search the web when ever you want to do things. Yes at first it feels strange and even stupid that you search replace with '%s/oldword/newword/gc'. Then you realize sed in the terminal is the same syntax, 'sed s/old/new/g' and things start to click.

Once you're comfortable you know what you want out of the tool and what features you'd like to add. Chances are you'll find completely new ways of doing things with much more flexibility so don't limit yourself to the plugins too early. The only plugins I use today is fzf, and nvim-lspconfig.

[+] cutler|3 years ago|reply
After hacking around with various Neovim "frameworks" I decided I want my text editor to but just that and no more so switched back to Vim and MacVim. The improvements to Vim's scripting language were icing on the cake.
[+] codewiz|3 years ago|reply
I decided not to give in to any configuration frameworks and I see them as unnecessary complexity.

Initially, I just symlinked my old .vimrc to ~/.config/nvim/init.vim and started adding if sections to configure neovim features while keeping the config backwards-compatible.

Eventually I started rewriting small chunks of it in Lua, and now I'm 100% migrated to init.lua. I think it's a little cleaner this way, but not a life changer. The real power of Lua is for plugin authors.

[+] AlexSW|3 years ago|reply
What did Vim give you that Neovim didn't provide?
[+] gpanders|3 years ago|reply
You can use Neovim without a framework. In fact, for the most part Neovim will work as-is with a .vimrc written for Vim (there are some options that are specific to Vim or Neovim, but not many, as both projects port features from the other).
[+] crop_rotation|3 years ago|reply
I spent a good amount of time learning vim/neovim and installed tons of plugins, but in the end I didn't see the point. Language support is still nowhere near VSCode, let alone Jetbrains products. I do all my development on a macbook so ultra low memory or being installed by default is not a requirement.

People praise vim/neovim for being small but to get any decent functionality you will end up with tons of plugins. The default vim/neovim is a fine text editor but when you need to write text you have better tools anyways. Maybe one can type fast in vim, but who is writing code limited by the speed of typing.

[+] fernandotakai|3 years ago|reply
>Language support is still nowhere near VSCode, let alone Jetbrains products.

and vscode/jetbrains vim mode is nowhere near what neovim can provide. so between using a bad version of vim with features, i prefer a bit less features with more... you know, vim :)

[+] worksonmine|3 years ago|reply
> People praise vim/neovim for being small but to get any decent functionality you will end up with tons of plugins.

If a writer compares VSCode to Word and claims exporting as PDF is "decent functionality" making VSCode a useless tool does he even understand what he's looking at?

You have the same language servers as VSCode, GDB is integrated and works really well. On top of that you have the entire OS and unix philosophy at your fingertips. Even with vanilla vim I have many more features than I ever had with VSCode and the likes.

It's not all about buttons and pretty dropdrowns. I agree the discoverability could be better, but that's a necessary compromise for making just about anything you'd like to do possible.

[+] konart|3 years ago|reply
>Maybe one can type fast in vim, but who is writing code limited by the speed of typing.

Most of the time we edit code, not write it. And this is where (neo)vim shines. You can move between places you want to modify and do so with as little afford as possible.

Language support (at least for languages I use the most) is the same as VSCode and IDEA (give or take) but at least I get to decide what do I want to get from the tool.

>People praise vim/neovim for being small but to get any decent functionality you will end up with tons of plugins.

No, these days you basically need only a plugin manager + treesitter + LSP (add a few UI plugins to your taste).

[+] AlexSW|3 years ago|reply
I think that, strictly speaking, this cannot be entirely true, as VS Code gets language support from the same place that Neovim does - namely from LSP servers. VS Code simply packages these up in extensions, whereas in Neovim you need to install them. Plugins exist to automate this entirely - see Mason. Yes, it is all plugin-based, but this is as opposed to extension-based VS Code.

Some of the VS Code extensions provide some nice added value, such as LLDB debugging for C/C++ and Rust, but you can actually get this in Neovim, you just need to install the extension in VS Code and then point to it from Neovim. If you dig around, you can see this in my dotfiles, linked in another comment. And this is only an issue for debugging compiled code to give nicer variable information for e.g. strings, which is quite specific.

I've also found Microsoft's recent move to Pylance from Pyright has meant a few small things aren't there for Python, which admittedly was disappointed, but again, broadly this isn't an issue at all.

Otherwise, I've not found this issue with Neovim at all.

[+] xigoi|3 years ago|reply
I prefer an editor that I can customize to my liking and I don't have a conflict of interest with the developers.
[+] benjaminwootton|3 years ago|reply
A few months ago I stumbled on Astrovim which is an opinionated NVim setup. They have built pretty much exactly what I was trying to do by hand. After 20 years of flirting with Vim then going back to other IDEs I think I’ve made the Vim thing finally stick and become productive with it.

It’s partly the type of coding I do, but I’m always contributing on the DevOps side too - Dockerfiles, .env files and the like. Being close to the terminal and within a Tmux session is perfect for that type of work.

[+] pyrophane|3 years ago|reply
Id gotten busy at work and was using vscode because it was very easy to set up and use, but I never really liked it.

Recently had some downtime and finally got around to setting up nvim and writing a config for it to get an IDE experience from it, and I love it!

Probably the biggest pain-point was wrapping my head around all of the plugins and config needed for language server completion, but overall configuring it was a good experience.

Really happy to see the .9 release out, as I've been using the daily builds for a while now

[+] vander_elst|3 years ago|reply
I've really tried to move from vim to neovim for a long time and spent many hours trying to configure it to behave like vim, but every time I try it breaks in unexpected ways or it hungs up, while vim for my workflow never flinks. I hope that they'll reach a 1.0 soon where things are more stable.
[+] tgz|3 years ago|reply
I try this release on debian buster:

nvim: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by nvim)

Why binary doesn't support old glibc?

[+] tarkin2|3 years ago|reply
Since I've learnt vimscript and am relatively happy using it, what's the advantage of writing plugins in lua for neovim?
[+] BaculumMeumEst|3 years ago|reply
i'm considering hopping over from emacs but i'm not sure how to kick off an async shell command, pass the current buffer to its stdin, and write its output to a buffer. does anyone know if should i be using job_control or io.popen for that sort of thing?
[+] pydry|3 years ago|reply
For people who have used helix and neovim recently, how do they compare?
[+] sauercrowd|3 years ago|reply
Does anyone have a TLDR/highlights of the release?
[+] bilalq|3 years ago|reply
I'll kind of hijack this thread to ask a support question:

I often use neovim within the terminal in VSCode. Lately, I've had issues with the cursor becoming invisible while in normal mode. The line cursor works as expected in insert mode. Changing the settings for cursor style in VSCode temporarily fixes it, but the problem comes right back when I transition to insert mode and come back to normal mode. Anyone have any suggestions for a fix?