This is my personal, modular Nixvim configuration. It aims to provide a fluid editing experience with a rich set of features.
Built on a solid base configuration, it also includes several language modules (langs) and extra
modules (xtra) for enabling optional features. Feel free to use it if it fits your needs.
Contributions are also welcome.
Note
This is an opinionated configuration and may not suit everyone's taste. It prioritizes a fluid editing experience and a rich feature set.
To run without installing (e.g., for a demo), run the following:
NIXPKGS_ALLOW_UNFREE=1 nix run --impure git+https://github.com/ar-at-localhost/nv.gitYou can add nv as an input to your flake. By default, it follows the Nix master branch, but you
can override inputs.nixpkgs.follows to use your own nixpkgs input and follow whichever channel
you prefer.
{
inputs = {
# nixpkgs...
# other inputs...
nv = {
url = "github:ar-at-localhost/nv";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}Some features require the nv overlay, which is also necessary when using the provided package
directly.
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.nv.overlays.default
];
};Generally, you will want to import the modules into your configuration. Simply import the default module:
{
imports = [
# rest of imports
inputs.nv.nixvimModules.default
];
}Important
Using the default module will load the default configuration. You'll need to override it to reset the configuration.
If you want to use the base configuration as-is, you can add the overlay provided by the flake and include its package in your package set. With the appropriate wiring, it should work with both Home Manager and NixOS.
A common use case is adding it to development flakes for a personalized editing experience.
# Apply overlay
{
pkgs = import nixpkgs {
overlays = [
# other overlays...
inputs.nv.overlays.default
];
};
}
# Add package to your relevant package set
{
packages = with pkgs; [ nv ];
}Several languages are supported. You can enable them by setting the
nv.langs.<lang-name>.enable option to true.
{
# ...
nv.langs.xml.enable = true;
}Tip
Nix, Lua, Markdown, and Bash are supported by default.
- Astro
- C++
- CSS
- Docker
- .NET
- JavaScript / TypeScript
- Make
- MJML
- Python
- Rust
- SQL
- Web (JavaScript/TypeScript, HTML, CSS, SQL, XML)
- XML
A few extra features are also supported. You can enable them by setting the
nv.xtras.<lang-name>.enable option to true.
{
# ...
nv.xtras.orgmode.enable = true;
}- CI
- LDX - Lua Developer Experience
- Orgmode/Orgnomics
- TW - Theme watcher
- Yalms - Yet Another Set of Lua Modules
- Yarn Berry
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.## License