/neovim-flake

Nix flake for neovim with configuration

Primary LanguageNixMIT LicenseMIT

neovim-flake

A highly configurable nix flake for neovim

Originally based on Wil Taylor's amazing neovim-flake

Installation

While I am working towards this config being more stable so people can point to it directly, its origins are as an opinionated personal config. Thus, I recommend cloning the config and running it locally with:

nix run .

If you want to live life on the edge you can run from this repository directly with:

nix run github:jordanisaacs/neovim-flake

Philosophy

The philosophy behind this flake configuration is to allow for easily configurable and reproducible neovim environments. Enter a directory and have a ready to go neovim configuration that is the same on every machine. Whether you are a developer, writer, or live coder (see tidal cycles below!), quickly craft a config that suits every project's need. Think of it like a distribution of Neovim that takes advantage of pinning vim plugins and third party dependencies (such as tree-sitter grammars, language servers, and more).

As a result, one should never get a broken config when setting options. If setting multiple options results in a broken neovim, file an issue! Each plugin knows when another plugin which allows for smart configuration of keybindings and automatic setup of things like completion sources and languages.

Default Configs

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. Type on the first line of your tidal file, 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.

Screenshot

screenshot

Language Support

Most languages use nvim-lspconfig to set up language server. Additionally some languages also (or exclusively) use null-ls to extend capabilities.

Rust

LSP Server: rust-analyzer

Formatting

Rust analyzer provides builtin formatting with rustfmt

Plugins

Nix

LSP Server: nil

Formatting

nil provides builtin formatting with nixpkgs-fmt but it is disabled and I am instead using null-ls with alejandra

SQL

LSP Server: sqls

Formatting

sqls provides formatting but it does not work very well so it is disabled. Instead using sqlfluff through null-ls.

Linting

Using sqlfluff through null-ls to provide linting diagnostics set at information severity.

Plugins

  • sqls.nvim for useful actions that leverage sqls LSP

C/C++

LSP Server: ccls

Typescript

LSP Server: typescript-language-server

Linting

Using eslint through null-ls.

Formatting

Disabled lsp server formatting, using prettier through null-ls.

Python

LSP Server: pyright

Formatting:

Using black through null-ls

Markdown

Plugins

  • glow.nvim for preview directly in neovim buffer (broken, waiting on issue)

HTML

Plugins

  • nvim-ts-autotag for autoclosing and renaming html tags. Works with html, tsx, vue, svelte, and php

All Plugins

A list of all plugins that can be enabled

LSP

Buffers

Statuslines

Filetrees

Git

Treesitter

Visuals

Utilities

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

Markdown

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

Completions

Snippets

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

Autopairs

Themes

Dependencies

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