neovim-flake/index.html

102 lines
26 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>neovim-flake Manual</title><link rel="stylesheet" type="text/css" href="style.css" /><link rel="stylesheet" type="text/css" href="overrides.css" /><link rel="stylesheet" type="text/css" href="mono-blue.css" /><script src="highlight.pack.js" type="text/javascript"></script><script src="highlight.load.js" type="text/javascript"></script><meta name="generator" content="DocBook XSL Stylesheets V1.79.2" /><link rel="home" href="index.html" title="neovim-flake Manual" /><link rel="next" href="options.html" title="Appendix A. Configuration Options" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">neovim-flake Manual</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="options.html">Next</a></td></tr></table><hr /></div><div class="book"><div class="titlepage"><div><div><h1 class="title"><a id="book-neovim-flake-manual"></a>neovim-flake Manual</h1></div></div><hr /></div><div class="toc"><dl class="toc"><dt><span class="preface"><a href="index.html#idm140737328811312">Preface</a></span></dt><dt><span class="chapter"><a href="index.html#ch-default-configs">1. Default Configs</a></span></dt><dd><dl><dt><span class="section"><a href="index.html#sec-default-tidal">1.1. Tidal Cycles</a></span></dt><dt><span class="section"><a href="index.html#sec-default-nix">1.2. Nix</a></span></dt><dt><span class="section"><a href="index.html#sec-default-maximal">1.3. Maximal</a></span></dt></dl></dd><dt><span class="chapter"><a href="index.html#ch-custom-configuration">2. Custom Configuration</a></span></dt><dt><span class="chapter"><a href="index.html#ch-languages">3. Language Support</a></span></dt><dd><dl><dt><span class="section"><a href="index.html#sec-languages-rust">3.1. Rust</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-nix">3.2. Nix</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-sql">3.3. SQL</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-clang">3.4. C/C++</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-typescript">3.5. Typescript</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-python">3.6. Python</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-zig">3.7. Zig</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-markdown">3.8. Markdown</a></span></dt><dt><span class="section"><a href="index.html#sec-languages-html">3.9. HTML</a></span></dt></dl></dd><dt><span class="chapter"><a href="index.html#ch-plugins">4. Plugins</a></span></dt><dd><dl><dt><span class="section"><a href="index.html#sec-plugins-server">4.1. Language Server</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-buffer">4.2. Buffers</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-statuslines">4.3. Statuslines</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-filetrees">4.4. Filetrees</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-git">4.5. Git</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-treesitter">4.6. Treesitter</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-visuals">4.7. Visuals</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-utilities">4.8. Utilities</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-completions">4.9. Completions</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-snippets">4.10. Snippets</a></span></dt><dt><span class="section"><a href="index.html#sec-plugins-autopairs">4.11. Autopairs</a></span></dt><dt><span class="section"><a href="index.html#sec-plugi
If you encounter problems or want to discuss neovim-flake then join the Matrix room
<a class="link" href="https://matrix.to/#/%23neovim-flake:matrix.org" target="_top">#neovim-flake:matrix.org</a>.
If your problem is caused by a bug in neovim-flake then it should be reported on the
<a class="link" href="https://github.com/jordanisaacs/neovim-flake/issues" target="_top">neovim-flake issue tracker</a>.
</p></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="ch-default-configs"></a>Chapter 1. Default Configs</h1></div></div></div><p>While you can configure neovim-flake yourself using the builder, here are a few default configurations you can use.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-default-tidal"></a>1.1. Tidal Cycles</h2></div></div></div><pre class="programlisting console">$ nix run github:jordanisaacs/neovim-flake#tidal file.tidal</pre><p>Utilizing <a class="link" href="https://github.com/tidalcycles/vim-tidal" target="_top">vim-tidal</a> and mitchmindtrees fantastic <a class="link" href="https://github.com/mitchmindtree/tidalcycles.nix" target="_top">tidalcycles.nix</a> start playing with tidal cycles in a single command.</p><p>In your tidal file, type a cycle e.g. <code class="literal">d1 $ s "drum"</code> and then press <span class="emphasis"><em>ctrl+enter</em></span>. 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 <code class="literal">services.pipewire.jack.enable = true</code>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-default-nix"></a>1.2. Nix</h2></div></div></div><pre class="programlisting console">$ nix run github:jordanisaacs/neovim-flake#nix test.nix</pre><p>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.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-default-maximal"></a>1.3. Maximal</h2></div></div></div><pre class="programlisting console">$ nix shell github:jordanisaacs/neovim-flake#maximal test.nix</pre><p>It is the same fully configured neovim as with the <a class="link" href="index.html#sec-default-nix" title="1.2. Nix">Nix</a> config, but with every supported language enabled.</p><div class="note"><h3 class="title">Note</h3><p>Running the maximal config will download <span class="strong"><strong>a lot</strong></span> of packages as it is downloading language servers, formatters, and more.</p></div></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="ch-custom-configuration"></a>Chapter 2. Custom Configuration</h1></div></div></div><p>Custom configuration is done with the <code class="literal">neovimConfiguration</code> function. It takes in the configuration as a module. The output of the configuration function is an attrset.</p><pre class="programlisting nix">{
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";
}</pre><p>The following is an example of a barebones vim configuration with the default theme enabled.</p><pre class="programlisting nix">{
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;
};
}</pre></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="ch-languages"></a>Chapter 3. Language Support</h1></div></div></div><p>Language specific support combines some combination of language specific plugins, <code class="literal">treesitter</code> support, <code class="literal">nvim-lspconfig</code> langauge servers, and <code class="literal">null-ls</code> integration. This gets you capabilities ranging from autocompletion to formatting to diagnostics. The following languages have support beyond just <code class="literal">treesitter</code> highlighting.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-languages-rust"></a>3.1. Rust</h2></div></div></div><p><span class="strong"><strong>LSP Server</strong></span>: <a class="link" href="https://github.com/rust-analyzer/rust-analyzer" target="_top">rust-analyzer</a></p><p><span class="strong"><strong>Formatting</strong></span>: Built into LSP, uses <a class="link" href="https://github.com/rust-lang/rustfmt" target="_top">rustfmt</a></p><p><span class="strong"><strong>Plugins</strong></span>: See <a class="link" href="index.html#sec-plugins-rust" title="4.14. Rust">here</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-languages-nix"></a>3.2. Nix</h2></div></div></div><p><span class="strong"><strong>LSP Server</strong></span>: Choice between <a class="link" href="https://github.com/oxalica/nil" target="_top">nil</a> and <a class="link" href="https://github.com/nix-community/rnix-lsp" target="_top">rnix-lsp</a></p><p><span class="strong"><strong>Formatting</strong></span>: Choice between <a class="link" href="https://github.com/kamadorueda/alejandra" target="_top">alejandra</a> and <a class="link" href="https://github.com/nix-community/nixpkgs-fmt" target="_top">nixpkgs-fmt</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-languages-sql"></a>3.3. SQL</h2></div></div></div><p><span class="strong"><strong>LSP Server</strong></span>: <a class="link" href="https://github.com/lighttiger2505/sqls" target="_top">sqls</a></p><p><span class="strong"><strong>Formatting</strong></span>: Disabled LSP formatting, instead using <a class="link" href="https://github.com/sqlfluff/sqlfluff" target="_top">sqlfluff</a></p><p><span class="strong"><strong>Linting</strong></span>: <a class="link" href="https://github.com/sqlfluff/sqlfluff" target="_top">sqlfluff</a></p><p><span class="strong"><strong>Plugins</strong></span>: See <a class="link" href="index.html#sec-plugins-sql" title="4.16. SQL">here</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-languages-clang"></a>3.4. C/C++</h2></div></div></div><p><span class="strong"><strong>LSP Server</strong></span>: <a class="link" href="https://github.com/MaskRay/ccls" target="_top">ccls</a></p><p><span class="strong"><strong>Formatting</strong></span>: Built into language server</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-languages-typescript"></a>3.5. Typescript</h2></div></div></div><p><span class="strong"><strong>LSP Server</strong></span>: <a class="link" href="https://github.com/typescript-language-server/typescript-language-server" target="_top">typescript-language-server</a></p><p><span class="strong"><strong>Formatting</strong></span>: Disabled LSP formatting, instead using <a class="link" href="https://github.com/prettier/prettier" target="_top">prettier</a></p><p><span class="strong"><strong>Linting</strong></span>: <a class="link" href="https://github.com/prettier/prettier" target="_top">eslint</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-languages-python"></a>3.6. Python</h2></div></div></div><p><span class="strong"><strong>LSP Server</strong></span>: <a class="link" href="https://github.com/microsoft/pyrig
<a class="link" href="https://github.com/neovim/nvim-lspconfig" target="_top">nvim-lspconfig</a> common configurations for built-in language server
</li><li class="listitem">
<a class="link" href="https://github.com/jose-elias-alvarez/null-ls.nvim" target="_top">null-ls.nvim</a> neovim as a language server to inject LSP diagnostics, code actions, etc.
</li><li class="listitem">
<a class="link" href="https://github.com/glepnir/lspsaga.nvim" target="_top">lspsaga.nvim</a> useful UI and tools for lsp
</li><li class="listitem">
<a class="link" href="https://github.com/folke/trouble.nvim" target="_top">trouble.nvim</a> pretty list of lsp data
</li><li class="listitem">
<a class="link" href="https://github.com/weilbith/nvim-code-action-menu" target="_top">nvim-code-action-menu</a> a better code action menu with diff support
</li><li class="listitem">
<a class="link" href="https://github.com/ray-x/lsp_signature.nvim" target="_top">lsp-signature</a> show function signatures as you type
</li><li class="listitem">
<a class="link" href="https://github.com/onsails/lspkind-nvim" target="_top">lspkind-nvim</a> for pictograms in lsp (with support for nvim-cmp)
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-buffer"></a>4.2. Buffers</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/akinsho/bufferline.nvim" target="_top">nvim-bufferline-lua</a> a buffer line with tab integration
</li><li class="listitem">
<a class="link" href="https://github.com/famiu/bufdelete.nvim" target="_top">bufdelete-nvim</a> delete buffers without losing window layout
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-statuslines"></a>4.3. Statuslines</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/hoob3rt/lualine.nvim" target="_top">lualine.nvim</a> statusline written in lua.
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-filetrees"></a>4.4. Filetrees</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/kyazdani42/nvim-tree.lua" target="_top">nvim-tree-lua</a> a file explorer tree written in lua. Using
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-git"></a>4.5. Git</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/lewis6991/gitsigns.nvim" target="_top">gitsigns.nvim</a> a variety of git decorations
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-treesitter"></a>4.6. Treesitter</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/romgrk/nvim-treesitter-context" target="_top">nvim-treesitter-context</a> a context bar using tree-sitter
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-visuals"></a>4.7. Visuals</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/lukas-reineke/indent-blankline.nvim" target="_top">indent-blankline</a> for indentation guides
</li><li class="listitem">
<a class="link" href="https://github.com/kyazdani42/nvim-web-devicons" target="_top">nvim-web-devicons</a> Plugins and colors for icons. Requires patched font
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-utilities"></a>4.8. Utilities</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/nvim-telescope/telescope.nvim" target="_top">telescope</a> an extendable fuzzy finder of lists. Working ripgrep and fd
</li><li class="listitem">
<a class="link" href="https://github.com/folke/which-key.nvim" target="_top">which-key</a> a popup that displays possible keybindings of command being typed
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-completions"></a>4.9. Completions</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p class="simpara">
<a class="link" href="https://github.com/hrsh7th/nvim-cmp" target="_top">nvim-cmp</a> a completion engine that utilizes sources
</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem">
<a class="link" href="https://github.com/hrsh7th/cmp-buffer" target="_top">cmp-buffer</a> a source for buffer words
</li><li class="listitem">
<a class="link" href="https://github.com/hrsh7th/cmp-nvim-lsp" target="_top">cmp-nvim-lsp</a> a source for builtin LSP client
</li><li class="listitem">
<a class="link" href="https://github.com/hrsh7th/cmp-vsnip" target="_top">cmp-vsnip</a> a source for vim-vsnip autocomplete
</li><li class="listitem">
<a class="link" href="https://github.com/hrsh7th/cmp-path" target="_top">cmp-path</a> a source for path autocomplete
</li><li class="listitem">
<a class="link" href="https://github.com/ray-x/cmp-treesitter" target="_top">cmp-treesitter</a> treesitter nodes autcomplete
</li></ul></div></li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-snippets"></a>4.10. Snippets</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/hrsh7th/vim-vsnip" target="_top">vim-vsnip</a> a snippet plugin that supports LSP/VSCodes snippet format
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-autopairs"></a>4.11. Autopairs</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/windwp/nvim-autopairs" target="_top">nvim-autopairs</a> an autopair plugin for neovim
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-themes"></a>4.12. Themes</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/navarasu/onedark.nvim" target="_top">onedark</a> a dark colorscheme with multiple options
</li><li class="listitem">
<a class="link" href="https://github.com/folke/tokyonight.nvim" target="_top">tokyonight-nvim</a> a neovim theme with multiple color options
</li><li class="listitem">
<a class="link" href="https://github.com/catppuccin/nvim" target="_top">catppuccin</a> a pastel theme with 4 color options
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-markdown"></a>4.13. Markdown</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/ellisonleao/glow.nvim" target="_top">glow.nvim</a> a markdown preview directly in neovim using glow
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-rust"></a>4.14. Rust</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/simrat39/rust-tools.nvim" target="_top">rust-tools</a> provides tools for rust
</li><li class="listitem">
<a class="link" href="https://github.com/Saecki/crates.nvim" target="_top">crates.nvim</a> provides tools for working with <code class="literal">cargo.toml</code>
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-tidalcycles"></a>4.15. Tidal Cycles</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/tidalcycles/vim-tidal" target="_top">vim-tidal</a> for tidal cycles integration into vim
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-sql"></a>4.16. SQL</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/nanotee/sqls.nvim" target="_top">sqls.nvim</a> for useful actions that leverage <code class="literal">sqls</code> LSP
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-html"></a>4.17. HTML</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/windwp/nvim-ts-autotag" target="_top">nvim-ts-autotag</a> uses treesitter to autoclose/rename html tags
</li></ul></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="sec-plugins-dependencies"></a>4.18. Dependencies</h2></div></div></div><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
<a class="link" href="https://github.com/nvim-lua/plenary.nvim" target="_top">plenary</a> which is a dependency of some plugins, installed automatically if needed
</li></ul></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="options.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Appendix A. Configuration Options</td></tr></table></div></body></html>