Neovim 0.9
github.com
github.com
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.
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!
- https://github.com/NvChad/NvChad
- https://github.com/LunarVim/LunarVim
- https://github.com/AstroNvim/AstroNvim
All of them have a Docker command where you can try them out in a container.
awesome-neovim has more configs:
https://github.com/rockerBOO/awesome-neovim#preconfigured-co...
https://github.com/weakphish/dotfiles/blob/master/.config/nv...
Can see it here https://github.com/hauxir/dotfiles/blob/master/devenv.sh
then i can simply run it anywhere that has docker with a curl/bash script :)
can run it by running
. <(curl https://haukur.io/shell)
in bash
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.
Still is feels like Neovim is more stable and faster than the regular Vim somehow. Plus it has much better defaults.
I hate to break this to you, but Vim itself is in the process of converting its runtime files into Vim9script (which is Vim specific), and many new Vim plugins are also being written in Vim9script.
Neovim has always supported "traditional" Vimscript, and has ported all runtime file changes from Vim (think filetype plugins, syntax highlighting, etc.). In fact, we explicitly request that any runtime file changes first go through Vim precisely because we want to keep the two projects aligned. But the more that Vim transitions to Vim9script, the less can be shared between the two projects. So unfortunately the "fracturing of the ecosystem" is not specific to Neovim.
From my perspective as a vim user, neovim has only made my life worse by splitting plugin authors into two camps without any real benefit over what we had in vim. The only good thing about neovim is it caused some nice features to be added to vim, which the neovim authors could have just contributed themselves without trying to fight for control of the ecosystem with Bram. Neovim has really just made things worse for everyone.
Vim ecosystem is 'controlled' by the community not Bram. If Neovim/Lua is not good enough there wouldn't be a fracture in the first place.
The fact that Bram saw the success of Lua with Neovim but insisted on inventing Vim9Script speaks for itself. Yet you somehow manage to blame everything on Neovim.
I see what you did there.
It's his project he can do whatever he wants, but I'm planning on using this tool for the rest of my career so I went with the fork. Moving my config to XDG_CONFIG_HOME was a welcome side-effect.
rm -rf ~/.local/{bin,share}/nvimNot sure if adding ppas is the problem, i think that's ok, but making packages when none exist is more of a hassle.
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.1. https://launchpad.net/~neovim-ppa/+archive/ubuntu/stable 2. https://launchpad.net/~neovim-ppa/+archive/ubuntu/unstable
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!
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.
As a counter-counterpoint: I tried switching to neovim a couple of weeks ago, and gave up after half a day trying to get syntax highlighting working.
plugin-baby: (complicated setup?) I see errors
worksonmine: WFM
No disparagement intended. I'm sure you're both right.My vim config is simple, and neovim handles it well. Including syntax highlighting (some custom). I don't like some of the defaults as much as what shipped with vim, but I know I could configure them out if I cared enough.
Why do you use neovim when it sounds like you’re marginally less happy with it?
I don't use neovim, per se.
But sometimes when I run "vi" on one of the various systems I frequent, neovim is what I get.
It doesn't break any of the config I've set explicitly, and doesn't give me wildly unexpected settings aside from that, so I'm good. :)
There are different defaults for the pane management and the terminal. The vim defaults, IMO, allow a more consistent user experience. E.g. when you are in a vim terminal and you go to normal mode to yank some stuff to put it in the other pane with the code, nvim defaults adds line numbers to the terminal that need to be cleaned up afterwards, vim just does not add them. This is just one small example, but there are several edge cases where the vim defaults behave like I would expect and nvim either does something unexpected or it lags or it crashes.
Maybe I'm misunderstanding, but the Nvim terminal does not do this, at least by default (maybe some plugin enables this "feature"). If you yank some text from a terminal buffer in Nvim and paste it into another buffer with p, no line numbers are added.
GitHub release page with build artifacts: https://github.com/neovim/neovim/releases/tag/v0.9.0
That's great, one less plugin to install.
1. I can't create configs myself. 2. Astro, Lunar ... all break at sometime.
Telemetry reduced -
https://github.com/VSCodium/vscodium/blob/master/DOCS.md#dis...
- Using too many plugins without understanding all that vim has to offer.
- Cargo culting configs instead of building up little by little.
- Trying too hard to rice vim in appearance without adding meaningful utility.
The same applies for Emacs. Vim and emacs are powerful editors not controlled by corporations, have succeeded for decades when other editors have floundered, can run in any basic computing environment/terminal, and are logically present in many Unix tools. Like all of software engineering, a deeper understanding of the system you're using pays huge dividends in the long run.
In short, take the time to learn one of these editors in it's basic form and then nurture a small config that can go a long way, and you will find success.
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.
For me it's mastery of my toolbox. Understanding vim pushed me further down the rabbit hole and now my computer works for me. If I help anyone my palms get sweaty as they scroll scroll scroll through the code, but I keep it to myself and remember to breath. Maybe I could do some leetcode (whatever that is) while waiting?
Part of motivation of the switch was getting a lean environment that doesn't hog resources.
Resources was my only motivation when I made the switch, had to because everything was electron and my laptop couldn't handle it. Now I'm a few years in and whenever I get tired of doing something repetitive I create a keybinding to perform that action.
A recent example is take the current filename (%) remove the extension (:r) and run it with valgrind to monitor memory usage. Bind it to <leader>vg and it looks like this:
nnoremap <leader>vg :!valgrind ./%:r<CR>
When I hit it in the file 'my-program.c' it runs 'valgrind ./my-program' and I get the output in the built-in terminal. Very simple example but shows how easy it is to add any command-line tool you want without reaching for plugins, and integrate into your workflow instead of inheriting someone else's. Any command and combination of keypresses can be turned into a keybinding.I understand it's not for everyone, but comparing it to vscode and judging from that perspective is missing the point entirely. I don't type letters when I edit code, I execute and compose commands, it's a different mindset.
I was using the VSCodeVim plugin, but it kept breaking. I now moved to the Neovim plugin and works great!
I sometimes use Zed but it's subpar in terms of features.
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.
On vim, I was using vim-plug, which works fine with neovim too.
At some point I switched to Packer, which is written in Lua and is definitely more powerful. Now I would recommend Lazy instead: https://github.com/folke/lazy.nvim
Yes, it's silly that neovim still doesn't come with built-in plugin management. Installing a plugin should require 0 lines of config.
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.
You'd want their framework to end up in a very popular IDE for example, and that's just not happening.
All major IDEs will want full control over their editing component.
Because of that they won't implement "IDE-like" features such as a file explorer (I know there are plugins out there, plugin based systems are always slower and more brittle, both in the present and for updates), moving the command bar to the top, having powerful built-in fuzzy file finding, etc.
Perfect is the enemy of good, since perfect might never come and we could instead have good now or at least soon.
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.
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 :)
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.
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.
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).
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
Could you elaborate on this? Out of the box, Neovim and Vim are extremely similar, almost identical to a first approximation (Neovim has different defaults for some options than Vim, but that's about it). The two start to diverge dramatically when you begin writing or using plugins as the extensibility/API model is quite different between the two, but I am very surprised to hear you had difficulty trying to make Neovim behave like Vim.
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?
I left some instructions for how to get started with this in this comment, if you're interested: https://news.ycombinator.com/item?id=35482673
The only other "advantage" is that the Neovim development team is 100% all in on Lua, and Vimscript is essentially in "maintenance mode". We still port patches from Vim, but even Vim has moved on to Vim9script, which Neovim has no plans to support, so traditional Vimscript is very likely not going to see any improvements from either Vim or Neovim.
Might as well use lisp at that point.
Helix uses the kakoune model:
vi basic grammar is verb followed by object; it’s nice because it matches well with the order we use in English, "delete word". On the other hand, it does not match well with the nature of what we express: There is only a handful of verbs in text editing (delete, yank, paste, insert… ), and they don’t compose, contrarily to objects which can be arbitrarily complex, and difficult to express. That means that errors are not handled well. If you express your object wrongly with a delete verb, the wrong text will get deleted, you will need to undo, and try again.
Kakoune’s grammar is object followed by verb, combined with instantaneous feedback, that means you always see the current object (In Kakoune we call that the selection) before you apply your change, which allows you to correct errors on the go.
I'm not familiar with the Kakoune or Helix selection UX, but it's keystroke-economical in vim (of course).
I started using helix a few months ago because of the batteries included zero config language server setup, i have one line in my config and that is the theme, thats it, just install the language server [1] and you are ready to go.
But I stayed for the kakoune model. Yes, it is different than vim, yes it may not be for you, but to me it feels so much superior, i feel way more productive with the kakoune way. I guess i had the advantage of not having vim keybindings (except the most basic) in my muscle memory. I never really got warm with the more "advanced" vim keybindings. But in helix it is so easy to learn them. You either have a popup that shows you the next available key and what it does or you have `Space + ?` Where you can fuzzy find commands and their corresponding keyboard shortcut. Helix took that huge learning curve I had with (n)vim and turned it into learning by doing and their little tutor at the beginning.
With nvim I used lunarvim config, as I didn't want to roll my own config and it was the best I could find, and I tried all the most popular configs. They always updated something, they often broke, they felt bloated (compared to helix or plain [n]vim) and most importantely I didn't really know whats happening under the hood. With helix I only need to update my languageservers (which get automatically updated by my system package manager) and there was no need for me to touch the config files except setting the theme to one of the themes that it shipped with and I have more the feeling that I know whats happening under the hood.
Except a file tree instead of a fuzzy file picker I don't miss anything, I don't have any need for plugins, as everything I personally need is already in there.
[1] https://github.com/helix-editor/helix/wiki/How-to-install-th...
It lacks a good config and plugin story though, so if you're not happy with the defaults its not great.
I also just dislike the different actions. Having everything be a selection just doesn't make sense to me compared to the vim style.
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?