neovim-flake Manual


Preface
1. Default Configs
1.1. Tidal Cycles
1.2. Nix
1.3. Maximal
2. Custom Configuration
3. Language Support
3.1. Rust
3.2. Nix
3.3. SQL
3.4. C/C++
3.5. Typescript
3.6. Python
3.7. Zig
3.8. Markdown
3.9. HTML
4. Plugins
4.1. Language Server
4.2. Buffers
4.3. Statuslines
4.4. Filetrees
4.5. Git
4.6. Treesitter
4.7. Visuals
4.8. Utilities
4.9. Completions
4.10. Snippets
4.11. Autopairs
4.12. Themes
4.13. Markdown
4.14. Rust
4.15. Tidal Cycles
4.16. SQL
4.17. HTML
4.18. Dependencies
A. Configuration Options
B. Release Notes
B.1. Release 0.1
B.1.1. Changelog

Preface

If you encounter problems or want to discuss neovim-flake then join the Matrix room #neovim-flake:matrix.org. If your problem is caused by a bug in neovim-flake then it should be reported on the neovim-flake issue tracker.

Chapter 1. Default Configs

While you can configure neovim-flake yourself using the builder, here are a few default configurations you can use.

1.1. Tidal Cycles

$ nix run github:jordanisaacs/neovim-flake#tidal file.tidal

Utilizing vim-tidal and mitchmindtree’s fantastic tidalcycles.nix start playing with tidal cycles in a single command.

In your tidal file, type a cycle e.g. d1 $ s "drum" and then press ctrl+enter. Super collider with superdirt, and a modified GHCI with tidal will start up and begin playing. Note, you need jack enabled on your system. If you are using pipewire, its as easy as setting services.pipewire.jack.enable = true.

1.2. Nix

$ nix run github:jordanisaacs/neovim-flake#nix test.nix

Enables all the of neovim plugins, with language support for specifically Nix. This lets you see what a fully configured neovim setup looks like without downloading a whole bunch of language servers and associated tools.

1.3. Maximal

$ nix shell github:jordanisaacs/neovim-flake#maximal test.nix

It is the same fully configured neovim as with the Nix config, but with every supported language enabled.

Note

Running the maximal config will download a lot of packages as it is downloading language servers, formatters, and more.

Chapter 2. Custom Configuration

Custom configuration is done with the neovimConfiguration function. It takes in the configuration as a module. The output of the configuration function is an attrset.

{
  options = "The options that were available to configure";
  config = "The outputted configuration";
  pkgs = "The package set used to evaluate the module";
  neovim = "The built neovim package";
}

The following is an example of a barebones vim configuration with the default theme enabled.

{
  inputs.neovim-flake.url = "github:jordanisaacs/neovim-flake";

  outputs = {nixpkgs, neovim-flake, ...}: let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
    configModule = {
      # Add any custom options (and feel free to upstream them!)
      # options = ...

      config.vim.theme.enable = true;
    };

    customNeovim = neovim-flake.lib.neovimConfiguration {
      modules = [configModule];
      inherit pkgs;
    };
  in {
    packages.${system}.neovim = customNeovim.neovim;
  };
}

Chapter 3. Language Support

Language specific support combines some combination of language specific plugins, treesitter support, nvim-lspconfig langauge servers, and null-ls integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have support beyond just treesitter highlighting.

3.1. Rust

LSP Server: rust-analyzer

Formatting: Built into LSP, uses rustfmt

Plugins: See here

3.2. Nix

LSP Server: Choice between nil and rnix-lsp

Formatting: Choice between alejandra and nixpkgs-fmt

3.3. SQL

LSP Server: sqls

Formatting: Disabled LSP formatting, instead using sqlfluff

Linting: sqlfluff

Plugins: See here

3.4. C/C++

LSP Server: ccls

Formatting: Built into language server

3.5. Typescript

LSP Server: typescript-language-server

Formatting: Disabled LSP formatting, instead using prettier

Linting: eslint

3.6. Python

LSP Server: pyright

Formatting: black

3.7. Zig

LSP Server: zls

Formatting: Built into LSP, uses zig fmt.

3.8. Markdown

Plugins: See here

3.9. HTML

Plugins: See here

Chapter 4. Plugins

The following are the neovim plugins used within neovim-flake. Some plugins are explicitly enabled by the user, while others are enabled implicitly.

4.1. Language Server

4.2. Buffers

4.3. Statuslines

4.4. Filetrees

4.5. Git

4.6. Treesitter

4.7. Visuals

4.8. Utilities

  • telescope an extendable fuzzy finder of lists. Working ripgrep and fd
  • which-key a popup that displays possible keybindings of command being typed

4.9. Completions

4.10. Snippets

  • vim-vsnip a snippet plugin that supports LSP/VSCode’s snippet format

4.11. Autopairs

4.12. Themes

4.13. Markdown

  • glow.nvim a markdown preview directly in neovim using glow

4.14. Rust

4.15. Tidal Cycles

  • vim-tidal for tidal cycles integration into vim

4.16. SQL

  • sqls.nvim for useful actions that leverage sqls LSP

4.17. HTML

4.18. Dependencies

  • plenary which is a dependency of some plugins, installed automatically if needed