A. Configuration Options

baseVimPlugins

Base set of vim plugin derivations to resolve string/name-based plugin dependencies against.

  • Type: attribute set

  • Default: pkgs.vimPlugins

earlyConfig

Extra lines of init.vim configuration that need to be as early as possible in the file.

  • Type: strings concatenated with "\n"

  • Default: ""

extraBinPackages

A list of derivations containing executables that need to be available in the $PATH of the neovim process for this plugin to use.

Using the per-plugin binDeps is generally preferred; this should only be necessary if you need to make executables available for either:

  • A plugin that is not being managed by this module.
  • A binding or function in your init.vim, or other direct use from within neovim.
  • Type: list of packages

  • Default: {}

extraConfig

Extra lines of init.vim configuration to append to the generated ones.

  • Type: strings concatenated with "\n"

  • Default: ""

extraPython2Packages

A function in python.withPackages format, which returns a list of Python 2 packages required for your plugins to work.

Using the per-plugin python2Deps is strongly preferred; this should only be necessary if you need some Python 2 packages made available to neovim for a plugin that is not being managed by this module.

  • Type: python2 packages in `python2.withPackages` format

  • Default: ps: []

  • Example:

    (ps: with ps; [ pandas jedi ])
    

extraPython3Packages

A function in python.withPackages format, which returns a list of Python 3 packages required for your plugins to work.

Using the per-plugin python3Deps is strongly preferred; this should only be necessary if you need some Python 3 packages made available to neovim for a plugin that is not being managed by this module.

  • Type: python3 packages in `python3.withPackages` format

  • Default: ps: []

  • Example:

    (ps: with ps; [ python-language-server ])
    

files

Files and folders to link into a folder in the runtimepath; outside of Nix these would typically be locally-managed files in the ~/.config/nvim folder.

  • Type: attribute set of submodules

  • Default: {}

  • Example:

    {
      autoload.source = ./neovim/autoload;
      ftplugin.source = ./neovim/ftplugin;
      "neosnippets/nix.snip".text = ''
        snippet nxo
        abbr    NixOS Module Option
        	mkOption {
        		type = with types; ''${1:str};
        		default = "''${2}";
        		description = ''
        		  ''${3}
        		'';
        		example = "''${4}''${0}";
        	};
      '';
    }
    

files.<name>.enable

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

  • Type: boolean

  • Default: true

files.<name>.source

Path to the file or directory to symlink in.

If the source is a directory, a directory with a corresponding name will be created in the folder added to the neovim runtimepath, with symlinks to files in the source directory, and same the treatment applied recursively for child directories.

Overrides the text option if both are set.

  • Type: path

files.<name>.target

Name of the symlink, relative to the folder added to the neovim runtimepath. Defaults to the attribute name.

  • Type: string

files.<name>.text

Literal text of the file. Used to generate a file to set the source option.

  • Type: null or strings concatenated with "\n"

  • Default: null

fullPluginRegistry.<name>.enable

Whether or not this neovim plugin should be installed and used.

  • Type: boolean

fullPluginRegistry.<name>.after

List of other vim plugins that this plugin should be loaded after.

This can be seen as a "soft" form of making each of the listed plugins dependencies of this plugin.

Items must be strings representings either vim-plug-compatible git repository urls, or base vimPlugins attribute names.

  • Type: list of strings

  • Default: {}

fullPluginRegistry.<name>.before

List of other vim plugins that this plugin should be loaded before.

This can be seen as a "soft" form of making this plugin a dependency of each of the listed plugins.

Items must be strings representings either vim-plug-compatible git repository urls, or base vimPlugins attribute names.

  • Type: list of strings

  • Default: {}

fullPluginRegistry.<name>.binDeps

A list of derivations containing executables that need to be available in the $PATH of the neovim process for this plugin to use.

  • Type: list of packages

  • Default: {}

fullPluginRegistry.<name>.branch

Branch of the git source to fetch and use. The tag and commit options effectively override this.

Leave as null to simply use the branch of HEAD (typically, master).

  • Type: null or string

  • Default: null

fullPluginRegistry.<name>.commit

Commit of the git source to fetch and use.

Leave as null to simply use the HEAD.

  • Type: null or string

  • Default: null

fullPluginRegistry.<name>.dependencies

List of other vim plugins that are dependencies of this plugin.

Items can be either strings representings vim-plug-compatible git repository urls, base vimPlugins attribute names, or existing vim plugin derivations.

  • Type: list of string or packages

  • Default: {}

fullPluginRegistry.<name>.dir

If set, specifies a directory path that the plugin should be loaded from at neovim run-time, avoiding the use of a Nix-provided plugin directory.

Relative paths will be relative to the generated init.vim, which is in the Nix store. As the value is passed into a '-quoted VimL string, it is possible to escape this to use a relative path, e.g.:

' . $HOME. '/.config/vim/local/some-plugin

If this is set, source will not be used.

  • Type: null or string

  • Default: null

fullPluginRegistry.<name>.for

One or more filetypes that should trigger on-demand loading of this plugin.

Can be specified with either a single string or list of strings.

  • Type: string or list of strings

  • Default: {}

fullPluginRegistry.<name>.luaDeps

A function that takes an attribute set of Lua packages (typically passed from nixpkgs) and returns a list of Lua packages that this plugin depends on.

  • Type: lua packages in `lua.withPackages` format

  • Default: packageSet: []

  • Example:

    (packageSet: with packageSet: [ luafilesystem ])
    

fullPluginRegistry.<name>.mergeable

Whether or not it is safe to merge this plugin with others in the same bucket in the load order.

  • Type: boolean

  • Default: true

fullPluginRegistry.<name>.nvimrc.condition

A VimL expression that will be evaluated to determine whether or not to execute the vim-plug 'Plug' command for this plugin (which will typically load the plugin, or configure it to be lazily loaded).

Leave null in order to unconditionally always run the 'Plug' command for this plugin.

  • Type: null or string

  • Default: null

fullPluginRegistry.<name>.nvimrc.early

Extra lines of init.vim configuration associated with this plugin, that need to be as early as possible in the file.

Leave null if no such extra configuration is required.

  • Type: null or strings concatenated with "\n"

  • Default: null

fullPluginRegistry.<name>.nvimrc.postPlugin

Extra lines of init.vim configuration associated with this plugin, that need to be executed after the plugin loading.

Leave null if no such extra configuration is required.

  • Type: null or strings concatenated with "\n"

  • Default: null

fullPluginRegistry.<name>.nvimrc.prePlugin

Extra lines of init.vim configuration associated with this plugin, that need to be executed before the plugin loading.

Leave null if no such extra configuration is required.

  • Type: null or strings concatenated with "\n"

  • Default: null

fullPluginRegistry.<name>.on

One or more command or <Plug>-mappings that should trigger on-demand loading of this plugin.

Can be specified with either a single string or list of strings.

  • Type: string or list of strings

  • Default: {}

fullPluginRegistry.<name>.remote.python2

Whether or not this plugin requires the remote plugin host for Python 2.

Will effectively be set to true if any Python 2 package dependencies are specified for this plugin.

  • Type: boolean

fullPluginRegistry.<name>.remote.python2Deps

A function that takes an attribute set of Python 2 packages (typically passed from nixpkgs) and returns a list of Python 2 packages that this plugin depends on.

  • Type: python2 packages in `python2.withPackages` format

  • Default: packageSet: []

  • Example:

    (packageSet: with packageSet: [ pandas jedi ])
    

fullPluginRegistry.<name>.remote.python3

Whether or not this plugin requires the remote plugin host for Python 3.

Will effectively be set to true if any Python 3 package dependencies are specified for this plugin.

  • Type: boolean

fullPluginRegistry.<name>.remote.python3Deps

A function that takes an attribute set of Python 3 packages (typically passed from nixpkgs) and returns a list of Python 3 packages that this plugin depends on.

  • Type: python3 packages in `python3.withPackages` format

  • Default: packageSet: []

  • Example:

    (packageSet: with packageSet: [ python-language-server ])
    

fullPluginRegistry.<name>.rtp

Subdirectory of the plugin source that contains the Vim plugin.

Leave as null to simply use the root of the source.

  • Type: null or string

  • Default: null

fullPluginRegistry.<name>.source

Source of the vim plugin.

Leave as null to let the module infer the source as a vim-plug shortname from the name of this pluginConfig attribute.

Otherwise, set to a string representing a vim-plug-compatible git repository url, an existing vim plugin derivation, or to a Nix store path to build a vim plugin derivation from.

If left null or set to a string, a pin for the source must be present in sourcePins in order to build the neovim configuration.

  • Type: null or package or string or path

  • Default: null

fullPluginRegistry.<name>.tag

Tag of the git source to fetch and use. The commit option effectively overrides this.

Leave as null to simply use the HEAD.

  • Type: null or string

  • Default: null

mergePlugins

Whether or not to collect plugins into "buckets" based upon their position in the load order, and then merge those which can be merged, in order to minimise the number of directories added to vim's runtimepath, decreasing startup time.

  • Type: boolean

neovimPackage

The base neovim package to wrap.

  • Type: package

  • Default: pkgs.neovim-unwrapped

pluginRegistry

An attribute set describing the available/known neovim plugins.

  • Type: attribute set of submodules

  • Default: {}

  • Example:

    {
      # A "source" plugin, where the source is inferred from the attribute
      # name, treated as a vim-plug-compatible shortname
      "bagrat/vim-buffet" = {
        enable = true;
        dependencies = [
          "lightline-vim"
        ];
        # The specific commit to use for the source checkout
        commit = "044f2954a5e49aea8625973de68dda8750f1c42d";
        nvimrc = {
          prePlugin = ''
            " Customize vim-workspace colours based on gruvbox colours
            function g:WorkspaceSetCustomColors()
              highlight WorkspaceBufferCurrentDefault guibg=#a89984 guifg=#282828
              highlight WorkspaceBufferActiveDefault guibg=#504945 guifg=#a89984
              highlight WorkspaceBufferHiddenDefault guibg=#3c3836 guifg=#a89984
              highlight WorkspaceBufferTruncDefault guibg=#3c3836 guifg=#b16286
              highlight WorkspaceTabCurrentDefault guibg=#689d6a guifg=#282828
              highlight WorkspaceTabHiddenDefault guibg=#458588 guifg=#282828
              highlight WorkspaceFillDefault guibg=#3c3836 guifg=#3c3836
              highlight WorkspaceIconDefault guibg=#3c3836 guifg=#3c3836
            endfunction
          '';
          postPlugin = ''
            " vim-workspace
            " Disable lightline's tabline functionality, as it conflicts with this
            let g:lightline.enable = { 'tabline': 0 }
            " Prettify
            let g:workspace_powerline_separators = 1
            let g:workspace_tab_icon = "\uf00a"
            let g:workspace_left_trunc_icon = "\uf0a8"
            let g:workspace_right_trunc_icon = "\uf0a9"
          '';
        };
      };
    
      "Shados/nvim-moonmaker" = {
        enable = false;
        # Decide whether or not to load at run-time based on the result of
        # a VimL expression
        nvimrc.condition = "executable('moonc')";
      };
    
      vim-auto-save = {
        enable = true;
        # Lazily load on opening a tex file
        for = "tex";
      };
    
      nerdtree = {
        enable = true;
        # Lazily load on command usage
        on = "NERDTreeToggle";
        nvimrc.postPlugin = ''
          " Prettify NERDTree
          let NERDTreeMinimalUI = 1
          let NERDTreeDirArrows = 1
        '';
      };
    
      # Use upstream LanguageClient-neovim derivation
      LanguageClient-neovim.enable = true;
    
      # A "path" plugin built from a source path
      "nginx.vim" = {
        enable = true;
        source = ../nvim-files/local/nginx;
      };
    
      # A "local" plugin not directly managed by Nix, merely loaded at nvim
      # run-time from the specified directory
      "devplugin" = {
        enable = true;
        dir = "/home/shados/projects/vim/devplugin";
      };
    
      # A plugin configured but not enabled
      vim-devicons = {
        # vim-devicons needs to be loaded after these plugins, if they
        # are being used, as per its installation guide
        after = [
          "nerdtree" "vim-airline" "ctrlp-vim" "powerline/powerline"
          "denite-nvim" "unite-vim" "lightline-vim" "vim-startify"
          "vimfiler" "vim-flagship"
        ];
      };
    }
    

pluginRegistry.<name>.enable

Whether or not this neovim plugin should be installed and used.

  • Type: boolean

pluginRegistry.<name>.after

List of other vim plugins that this plugin should be loaded after.

This can be seen as a "soft" form of making each of the listed plugins dependencies of this plugin.

Items must be strings representings either vim-plug-compatible git repository urls, or base vimPlugins attribute names.

  • Type: list of strings

  • Default: {}

pluginRegistry.<name>.before

List of other vim plugins that this plugin should be loaded before.

This can be seen as a "soft" form of making this plugin a dependency of each of the listed plugins.

Items must be strings representings either vim-plug-compatible git repository urls, or base vimPlugins attribute names.

  • Type: list of strings

  • Default: {}

pluginRegistry.<name>.binDeps

A list of derivations containing executables that need to be available in the $PATH of the neovim process for this plugin to use.

  • Type: list of packages

  • Default: {}

pluginRegistry.<name>.branch

Branch of the git source to fetch and use. The tag and commit options effectively override this.

Leave as null to simply use the branch of HEAD (typically, master).

  • Type: null or string

  • Default: null

pluginRegistry.<name>.commit

Commit of the git source to fetch and use.

Leave as null to simply use the HEAD.

  • Type: null or string

  • Default: null

pluginRegistry.<name>.dependencies

List of other vim plugins that are dependencies of this plugin.

Items can be either strings representings vim-plug-compatible git repository urls, base vimPlugins attribute names, or existing vim plugin derivations.

  • Type: list of string or packages

  • Default: {}

pluginRegistry.<name>.dir

If set, specifies a directory path that the plugin should be loaded from at neovim run-time, avoiding the use of a Nix-provided plugin directory.

Relative paths will be relative to the generated init.vim, which is in the Nix store. As the value is passed into a '-quoted VimL string, it is possible to escape this to use a relative path, e.g.:

' . $HOME. '/.config/vim/local/some-plugin

If this is set, source will not be used.

  • Type: null or string

  • Default: null

pluginRegistry.<name>.for

One or more filetypes that should trigger on-demand loading of this plugin.

Can be specified with either a single string or list of strings.

  • Type: string or list of strings

  • Default: {}

pluginRegistry.<name>.luaDeps

A function that takes an attribute set of Lua packages (typically passed from nixpkgs) and returns a list of Lua packages that this plugin depends on.

  • Type: lua packages in `lua.withPackages` format

  • Default: packageSet: []

  • Example:

    (packageSet: with packageSet: [ luafilesystem ])
    

pluginRegistry.<name>.mergeable

Whether or not it is safe to merge this plugin with others in the same bucket in the load order.

  • Type: boolean

  • Default: true

pluginRegistry.<name>.nvimrc.condition

A VimL expression that will be evaluated to determine whether or not to execute the vim-plug 'Plug' command for this plugin (which will typically load the plugin, or configure it to be lazily loaded).

Leave null in order to unconditionally always run the 'Plug' command for this plugin.

  • Type: null or string

  • Default: null

pluginRegistry.<name>.nvimrc.early

Extra lines of init.vim configuration associated with this plugin, that need to be as early as possible in the file.

Leave null if no such extra configuration is required.

  • Type: null or strings concatenated with "\n"

  • Default: null

pluginRegistry.<name>.nvimrc.postPlugin

Extra lines of init.vim configuration associated with this plugin, that need to be executed after the plugin loading.

Leave null if no such extra configuration is required.

  • Type: null or strings concatenated with "\n"

  • Default: null

pluginRegistry.<name>.nvimrc.prePlugin

Extra lines of init.vim configuration associated with this plugin, that need to be executed before the plugin loading.

Leave null if no such extra configuration is required.

  • Type: null or strings concatenated with "\n"

  • Default: null

pluginRegistry.<name>.on

One or more command or <Plug>-mappings that should trigger on-demand loading of this plugin.

Can be specified with either a single string or list of strings.

  • Type: string or list of strings

  • Default: {}

pluginRegistry.<name>.remote.python2

Whether or not this plugin requires the remote plugin host for Python 2.

Will effectively be set to true if any Python 2 package dependencies are specified for this plugin.

  • Type: boolean

pluginRegistry.<name>.remote.python2Deps

A function that takes an attribute set of Python 2 packages (typically passed from nixpkgs) and returns a list of Python 2 packages that this plugin depends on.

  • Type: python2 packages in `python2.withPackages` format

  • Default: packageSet: []

  • Example:

    (packageSet: with packageSet: [ pandas jedi ])
    

pluginRegistry.<name>.remote.python3

Whether or not this plugin requires the remote plugin host for Python 3.

Will effectively be set to true if any Python 3 package dependencies are specified for this plugin.

  • Type: boolean

pluginRegistry.<name>.remote.python3Deps

A function that takes an attribute set of Python 3 packages (typically passed from nixpkgs) and returns a list of Python 3 packages that this plugin depends on.

  • Type: python3 packages in `python3.withPackages` format

  • Default: packageSet: []

  • Example:

    (packageSet: with packageSet: [ python-language-server ])
    

pluginRegistry.<name>.rtp

Subdirectory of the plugin source that contains the Vim plugin.

Leave as null to simply use the root of the source.

  • Type: null or string

  • Default: null

pluginRegistry.<name>.source

Source of the vim plugin.

Leave as null to let the module infer the source as a vim-plug shortname from the name of this pluginConfig attribute.

Otherwise, set to a string representing a vim-plug-compatible git repository url, an existing vim plugin derivation, or to a Nix store path to build a vim plugin derivation from.

If left null or set to a string, a pin for the source must be present in sourcePins in order to build the neovim configuration.

  • Type: null or package or string or path

  • Default: null

pluginRegistry.<name>.tag

Tag of the git source to fetch and use. The commit option effectively overrides this.

Leave as null to simply use the HEAD.

  • Type: null or string

  • Default: null

postPluginConfig

Extra lines of init.vim configuration that need to be executed after the plugin loading.

  • Type: strings concatenated with "\n"

  • Default: ""

prePluginConfig

Extra lines of init.vim configuration that need to be executed before the plugin loading.

  • Type: strings concatenated with "\n"

  • Default: ""

sourcePins

Attribute set of source pins for vim plugins. Attribute names should map directly to pluginRegistry attribute names.

  • Type: attribute set of submodules

  • Default: {}

sourcePins.<name>.fetchType

Type of the fetcher to use.

  • Type: one of "git", "github"

sourcePins.<name>.rev

pkgs.fetchgit-compatible git revision string.

  • Type: string

sourcePins.<name>.sha256

pkgs.fetchgit-compatible sha256 string.

  • Type: string

sourcePins.<name>.url

pkgs.fetchgit-compatible git url string.

  • Type: string

sourcePins.<name>.version

Version string appropriate for a nixpkgs derivation.

  • Type: string

withPython2

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

  • Type: boolean

withPython3

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

  • Type: boolean