Neovim: Difference between revisions
imported>Toastal Adding note about using the default package management system with Lua requires and how it can give errors on loading |
imported>JRavi2 m Corrected link format |
||
Line 24: | Line 24: | ||
== Note on errors using default `packages` for plugins requiring Lua modules == | == Note on errors using default `packages` for plugins requiring Lua modules == | ||
[ | [https://github.com/nanotee/nvim-lua-guide#a-note-about-packages Due to how the `runtimepath` for Lua modules is processed], your configuration may require `packadd! plugin-name` to require a module. A home-manager example: | ||
programs.neovim = { | programs.neovim = { |
Revision as of 17:05, 24 April 2021
Configure Neovim as the default Editor
Add this to your configuration.nix
environment.variables.EDITOR = "nvim";
Set Neovim as vi
and vim
Add this to your configuration.nix
nixpkgs.overlays = [ (self: super: { neovim = super.neovim.override { viAlias = true; vimAlias = true; }; }) ];
Alternatively you can use the neovim module (merged in september 2020).
programs.neovim.enable = true;
Note on errors using default `packages` for plugins requiring Lua modules
Due to how the `runtimepath` for Lua modules is processed, your configuration may require `packadd! plugin-name` to require a module. A home-manager example:
programs.neovim = { plugins = [ { plugin = nvim-colorizer-lua config = packadd! nvim-colorizer.lua lua require 'colorizer'.setup() ; } ]; }
To build neovim master
Use the official documentation: https://github.com/neovim/neovim/wiki/Building-Neovim#nix-or-nixos The neovim repository now contains a flake so you can run the master version via `nix run github:neovim/neovim?dir=contrib`
There is also an overlay available: https://github.com/nix-community/neovim-nightly-overlay