Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

programs.neovim.enable

Whether to enable Neovim.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.neovim.package

The neovim package to use.

Type: package

Default:

pkgs.neovim-unwrapped

Declared by:

programs.neovim.autowrapRuntimeDeps

Whether to automatically wrap the binary with the runtime dependencies of the plugins.

Type: boolean

Default:

true

Declared by:

programs.neovim.coc.enable

Whether to enable Coc.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.neovim.coc.package

The coc-nvim package to use.

Type: package

Default:

pkgs.vimPlugins.coc-nvim

Declared by:

programs.neovim.coc.pluginConfig

Script to configure CoC. Must be viml.

Type: strings concatenated with “\n”

Default:

""

Declared by:

programs.neovim.coc.settings

Extra configuration lines to add to $XDG_CONFIG_HOME/nvim/coc-settings.json See https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file for options.

Type: JSON value

Default:

{ }

Example:

{
  languageserver = {
    haskell = {
      args = [
        "--lsp"
      ];
      command = "haskell-language-server-wrapper";
      filetypes = [
        "haskell"
        "lhaskell"
      ];
      rootPatterns = [
        "*.cabal"
        "stack.yaml"
        "cabal.project"
        "package.yaml"
        "hie.yaml"
      ];
    };
  };
  "suggest.disableKind" = true;
  "suggest.enablePreselect" = false;
  "suggest.enablePreview" = true;
  "suggest.noselect" = true;
}

Declared by:

programs.neovim.defaultEditor

Whether to configure nvim as the default editor using the EDITOR and VISUAL environment variables.

Type: boolean

Default:

false

Declared by:

programs.neovim.extraConfig

Custom vimrc lines.

Type: strings concatenated with “\n”

Default:

""

Example:

''
  set nobackup
''

Declared by:

programs.neovim.extraLuaPackages

The extra Lua packages required for your plugins to work. This option accepts a function that takes a Lua package set as an argument, and selects the required Lua packages from this package set. See the example for more info.

Type: function that evaluates to a(n) list of package

Default:

ps: [ ]

Example:

luaPkgs: with luaPkgs; [ luautf8 ]

Declared by:

programs.neovim.extraName

Extra name appended to the wrapper package name.

Type: string

Default:

""

Declared by:

programs.neovim.extraPackages

Extra packages available to nvim.

Type: list of package

Default:

[ ]

Example:

[ pkgs.shfmt ]

Declared by:

programs.neovim.extraPython3Packages

The extra Python 3 packages required for your plugins to work. This option accepts a function that takes a Python 3 package set as an argument, and selects the required Python 3 packages from this package set. See the example for more info.

Type: function that evaluates to a(n) list of package

Default:

ps: [ ]

Example:

pyPkgs: with pyPkgs; [ python-language-server ]

Declared by:

programs.neovim.extraWrapperArgs

Extra arguments to be passed to the neovim wrapper. This option sets environment variables required for building and running binaries with external package managers like mason.nvim.

Type: list of string

Default:

[ ]

Example:

[
  "--suffix"
  "LIBRARY_PATH"
  ":"
  "${lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.zlib ]}"
  "--suffix"
  "PKG_CONFIG_PATH"
  ":"
  "${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [ pkgs.stdenv.cc.cc pkgs.zlib ]}"
]

Declared by:

programs.neovim.finalPackage

Resulting customized neovim package.

Type: package (read only)

Declared by:

programs.neovim.generatedConfigViml

Generated vimscript config.

Type: strings concatenated with “\n” (read only)

Declared by:

programs.neovim.generatedConfigs

Generated configurations with as key their language (set via type).

Type: attribute set of strings concatenated with “\n” (read only)

Default:

{ }

Example:

{
  viml = ''
    " Generated by home-manager
    map <leader> ,
  '';

  lua = ''
    -- Generated by home-manager
    vim.opt.background = "dark"
  '';
}

Declared by:

programs.neovim.initLua

Content to be added to init.lua.

Automatically contains the advised plugin config

To specify the order, use lib.mkOrder, lib.mkBefore, lib.mkAfter.

Type: strings concatenated with “\n”

Default:

""

Example:

let
    nvimEarlyInit = lib.mkOrder 500 "set rtp+=vim.opt.rtp:prepend('/home/user/myplugin')";
    nvimLateInit = lib.mkAfter "vim.opt.signcolumn = 'auto:1-3'";
in
    lib.mkMerge [ nvimEarlyInit nvimLateInit ];

Declared by:

programs.neovim.plugins

List of vim plugins to install optionally associated with configuration to be placed in init.vim.

This option is mutually exclusive with configure.

Type: list of (package or (submodule))

Default:

[ ]

Example:

with pkgs.vimPlugins;
[
  yankring
  vim-nix
  { plugin = vim-startify;
    config = "let g:startify_change_to_vcs_root = 0";
  }
]

Declared by:

programs.neovim.plugins.*.config

Script to configure this plugin. The scripting language should match type.

Type: null or strings concatenated with “\n”

Default:

null

programs.neovim.plugins.*.optional

Don’t load by default (load with :packadd)

Type: boolean

Default:

false

Example:

true

programs.neovim.plugins.*.plugin

The plugin package to use.

Type: package

Example:

pkgs.vimPlugins.nvim-treesitter

programs.neovim.plugins.*.runtime

Set of files that have to be linked in nvim config folder.

Type: attribute set of (submodule)

Default:

{ }

Example:

{
  "ftplugin/c.vim" = {
    text = "setlocal omnifunc=v:lua.vim.lsp.omnifunc";
  };
}

programs.neovim.plugins.*.runtime.<name>.enable

Whether this file should be generated. This option allows specific files to be disabled.

Type: boolean

Default:

true

programs.neovim.plugins.*.runtime.<name>.executable

Set the execute bit. If null, defaults to the mode of the source file or to false for files created through the text option.

Type: null or boolean

Default:

null

programs.neovim.plugins.*.runtime.<name>.force

Whether the target path should be unconditionally replaced by the managed file source. Warning, this will silently delete the target regardless of whether it is a file or link.

Type: boolean

Default:

false

When recursive is enabled, adds the -ignorelinks flag to lndir.

It causes lndir to not treat symbolic links in the source directory specially. The link created in the target directory will point back to the corresponding symbolic link in the source directory. If that link points to a directory, the resulting target will be a link to the source tree’s symlink rather than a recursively linked directory tree.

Type: boolean

Default:

false

programs.neovim.plugins.*.runtime.<name>.onChange

Shell commands to run when file has changed between generations. The script will be run after the new files have been linked into place.

Note, this code is always run when recursive is enabled.

Type: strings concatenated with “\n”

Default:

""

programs.neovim.plugins.*.runtime.<name>.recursive

If the file source is a directory, then this option determines whether the directory should be recursively linked to the target location. This option has no effect if the source is a file.

If false (the default) then the target will be a symbolic link to the source directory. If true then the target will be a directory structure matching the source’s but whose leaves are symbolic links to the files of the source directory.

Type: boolean

Default:

false

programs.neovim.plugins.*.runtime.<name>.source

Path of the source file or directory. If is non-null then this option will automatically point to a file containing that text.

Type: absolute path

programs.neovim.plugins.*.runtime.<name>.target

Path to target file relative to xdg.configHome/nvim.

Type: non-empty string

Default:

name

programs.neovim.plugins.*.runtime.<name>.text

Text of the file. If this option is null then must be set.

Type: null or strings concatenated with “\n”

Default:

null

programs.neovim.plugins.*.type

Language used in config. Configurations are aggregated per-language.

Type: one of “lua”, “viml”, “teal”, “fennel” or string

Default:

if lib.versionAtLeast config.home.stateVersion "26.05" then "lua" else "viml"

programs.neovim.sideloadInitLua

Enable to avoid writing the content of initLua to the default location $XDG_CONFIG_HOME/nvim/init.lua and load it through neovim wrapper arguments instead.

This is useful if you want to manage your own init.lua imperatively.

Type: boolean

Default:

false

Declared by:

programs.neovim.viAlias

Symlink vi to nvim binary.

Type: boolean

Default:

false

Declared by:

programs.neovim.vimAlias

Symlink vim to nvim binary.

Type: boolean

Default:

false

Declared by:

programs.neovim.vimdiffAlias

Alias vimdiff to nvim -d.

Type: boolean

Default:

false

Declared by:

programs.neovim.waylandSupport

Whether to enable Wayland clipboard support.

Type: boolean

Default:

pkgs.stdenv.isLinux

Declared by:

programs.neovim.withNodeJs

Enable node provider. Set to true to use Node plugins.

Type: boolean

Default:

false

Declared by:

programs.neovim.withPerl

Enable perl provider. Set to true to use Perl plugins.

Type: boolean

Default:

false

Declared by:

programs.neovim.withPython3

Enable Python 3 provider. Set to true to use Python 3 plugins.

Type: boolean

Default:

if lib.versionAtLeast config.home.stateVersion "26.05" then false else true

Declared by:

programs.neovim.withRuby

Enable ruby provider.

Type: boolean

Default:

if lib.versionAtLeast config.home.stateVersion "26.05" then false else true

Declared by: