Skip to content

Latest commit

 

History

82 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nvimx

Project-based, modular Neovim configuration via NixVim.

Nvimx provides many presets based on different language (lsp, treesitter) support and different uses, allowing you to choose what is installed on a neovim instance per project. Works well with direnv.

Nvimx exports different module/package presets:

  • default/base - Base Neovim instance, contains all plugins, no language support. All other presets automatically includes this base.
  • Language-based - See the end of this readme.

Additionally, you can set nvimx.treesitter.enableAllGrammars = true to get ts for all languages without individually enabling variants.

Usage

  1. Run directly:
nix run github:allen-liaoo/nvimx

You can run a preset by appending #{preset}.

You may need to enable experimental features by passing in this environment variable:

NIX_CONFIG="extra-experimental-featues = nix-command flakes"
  1. Construct a module in a flake (i.e. in devShells). Nvimx flake outputs makeNvimxWithModule (system: nvimxModule: ...) to be used in this case. Presents have options under nvimx.preset.${preset}, and need to be opted in with nvimx.preset.${preset}.enable = true.
{
  outputs = { self, nixpkgs, nixvim }: let
  in {
    devShells = let 
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in ${system}.default = pkgs.mkShell (let
      nixvimModule = {
        # enable the presets you want to use
        nvimx.preset.typst.enable = true;

        # or add custom nixvim or nvimx options here
        plugins.xyz.enable = true;
      };
      nixvimPkg = nvimx.makeNvimxWithModule system nixvimModule; # package it!
    in {
      packages = [ nixvimPkg ];
    });
  };

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nvimx = {
      url = "github:allen-liaoo/nvimx";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
}

For more examples, see the projs/ directory.

Presets

Preset Languages TreeSitter LSP
c C ✅ ccls
configs ini, json, kdl, toml, yaml ✅ —
egglog egglog ✅* —
java Java ✅ jdtls
latex LaTeX ✅ texlab
llvm-ir LLVM IR ✅ llvm-ir-lsp*
nix Nix ✅ nixd
rust Rust ✅ rust-analyzer
shells bash, fish, zsh ✅ bashls (bash only)
typst Typst ✅ tinymist

*: Manually packaged here (Not in neovim-treesitter or nixvim lsps)

Credits

Inspired by ar-at-localhost/np.

About

Project Based, Modular Neovim Config (via NixVim)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages