Merge branch 'main' into live-docs-preview

This commit is contained in:
raf 2025-01-10 13:31:55 +03:00 committed by GitHub
commit 15ee6e0a35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 521 additions and 276 deletions

60
.github/README.md vendored
View file

@ -206,6 +206,20 @@ features.
## Credits ## Credits
### Co-Maintainers
Alongside myself, nvf is developed by those talented folk:
- [**@horriblename**](https://github.com/horriblename)
([Liberapay](https://liberapay.com/horriblename/))- For actively implementing
planned features and quality of life updates.
- [**@Diniamo**](https://github.com/Diniamo)
([Liberapay](https://en.liberapay.com/diniamo/)) - For actively submitting
pull requests, issues and assistance with maintenance of nvf.
Please do remember to extend your thanks (financially or otherwise) if this
project has been helpful to you.
### Contributors ### Contributors
[mnw]: https://github.com/gerg-l/mnw [mnw]: https://github.com/gerg-l/mnw
@ -213,21 +227,19 @@ features.
nvf would not be what it is today without the awesome people below. Special, nvf would not be what it is today without the awesome people below. Special,
heart-felt thanks to heart-felt thanks to
- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts and - [**@fufexan**](https://github.com/fufexan) - For the transition to flake-parts
invaluable Nix assistance. and invaluable Nix assistance.
- [@FlafyDev](https://github.com/FlafyDev) - For getting home-manager module to - [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module
work and Nix assistance. to work and Nix assistance.
- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally - [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally
possible, and other module additions. possible, and other module additions.
- [@horriblename](https://github.com/horriblename) - For actively implementing - [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo
planned features and quality of life updates. - [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes
- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo that I could not.
- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I - [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper,
could not. [mnw], and occasional code improvements.
- [@Diniamo](https://github.com/Diniamo) - For actively submitting pull - [**@Soliprem**](https://github.com/soliprem) - Rigorously implementing missing
requests, issues and assistance with maintenance of nvf. features and excellent work on new language modules.
- [@Gerg-l](https://github.com/gerg-l) - For the modern Neovim wrapper, [mnw],
and occasional code improvements.
and everyone who has submitted issues or pull requests! and everyone who has submitted issues or pull requests!
@ -237,17 +249,17 @@ This configuration borrows from and is based on a few other configurations,
including: including:
- [@jordanisaacs's](https://github.com/jordanisaacs) - [@jordanisaacs's](https://github.com/jordanisaacs)
[neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this flake [**neovim-flake**](https://github.com/jordanisaacs/neovim-flake) that this
is originally based on. flake is originally based on.
- [@sioodmy's](https://github.com/sioodmy)
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
choices for UI and plugin defaults.
- [@wiltaylor's](https://github.com/wiltaylor) - [@wiltaylor's](https://github.com/wiltaylor)
[neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and [neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and
design ideas. design ideas.
- [@gvolpe's](https://github.com/gvolpe) - [@gvolpe's](https://github.com/gvolpe)
[neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and [neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and
nix concepts. nix concepts.
- [@sioodmy's](https://github.com/sioodmy)
[dotfiles](https://github.com/sioodmy/dotfiles) that inspired the design
choices for UI and plugin defaults.
I am grateful for their previous work and inspiration, and I wholeheartedly I am grateful for their previous work and inspiration, and I wholeheartedly
recommend checking their work out. recommend checking their work out.
@ -255,12 +267,12 @@ recommend checking their work out.
## License ## License
Following the license of the Following the license of
[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf has [the original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf
been made available under the [**MIT License**](LICENSE). However, all assets has been made available under the [**MIT License**](LICENSE). However, all
and documentation are published under the assets and documentation are published under the
[**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE) [**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE)
under explicit permission by the artist. under explicit permission by the author or authors.
<h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6> <h6 align="center">Yes, this includes the logo work too. Stop taking artwork that is not yours!</h6>

View file

@ -10,12 +10,18 @@ To use it, we first add the input flake.
```nix ```nix
{ {
inputs = { inputs = {
# Optional, if you intend to follow nvf's obsidian-nvim input
# you must also add it as a flake input.
obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
# Required, nvf works best and only directly supports flakes
nvf = { nvf = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
# you can override input nixpkgs # You can override the input nixpkgs to follow your system's
# instance of nixpkgs. This is safe to do as nvf does not depend
# on a binary cache.
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
# you can also override individual plugins # Optionally, you can also override individual plugins
# for example: # for example:
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
}; };
@ -27,8 +33,8 @@ Followed by importing the home-manager module somewhere in your configuration.
```nix ```nix
{ {
# assuming nvf is in your inputs and inputs is in the argset # Assuming "nvf" is in your inputs and inputs is in the argument set.
# see example below # See example installation below
imports = [ inputs.nvf.homeManagerModules.default ]; imports = [ inputs.nvf.homeManagerModules.default ];
} }
``` ```
@ -44,12 +50,15 @@ Followed by importing the home-manager module somewhere in your configuration.
}; };
outputs = { nixpkgs, home-manager, nvf, ... }: let outputs = { nixpkgs, home-manager, nvf, ... }: let
system = "x86_64-linux"; in { system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
# ↓ this is your home output in the flake schema, expected by home-manager # ↓ this is your home output in the flake schema, expected by home-manager
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ modules = [
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
./home.nix # <- your home entrypoint ./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here
]; ];
}; };
}; };

View file

@ -10,12 +10,18 @@ To use it, we first add the input flake.
```nix ```nix
{ {
inputs = { inputs = {
# Optional, if you intend to follow nvf's obsidian-nvim input
# you must also add it as a flake input.
obsidian-nvim.url = "github:epwalsh/obsidian.nvim"; obsidian-nvim.url = "github:epwalsh/obsidian.nvim";
# Required, nvf works best and only directly supports flakes
nvf = { nvf = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
# you can override input nixpkgs # You can override the input nixpkgs to follow your system's
# instance of nixpkgs. This is safe to do as nvf does not depend
# on a binary cache.
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
# you can also override individual plugins # Optionally, you can also override individual plugins
# for example: # for example:
inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs
}; };
@ -42,13 +48,12 @@ Followed by importing the NixOS module somewhere in your configuration.
nvf.url = "github:notashelf/nvf"; nvf.url = "github:notashelf/nvf";
}; };
outputs = { nixpkgs, nvf, ... }: let outputs = { nixpkgs, nvf, ... }: {
system = "x86_64-linux"; in {
# ↓ this is your host output in the flake schema # ↓ this is your host output in the flake schema
nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem { nixosConfigurations."your-hostname" = nixpkgs.lib.nixosSystem {
modules = [ modules = [
nvf.nixosModules.default # <- this imports the NixOS module that provides the options nvf.nixosModules.default # <- this imports the NixOS module that provides the options
./configuration.nix # <- your host entrypoint ./configuration.nix # <- your host entrypoint, `programs.nvf.*` may be defined here
]; ];
}; };
}; };

View file

@ -11,6 +11,7 @@ try-it-out.md
default-configs.md default-configs.md
installation.md installation.md
configuring.md configuring.md
tips.md
``` ```
```{=include=} chapters ```{=include=} chapters

6
docs/manual/tips.md Normal file
View file

@ -0,0 +1,6 @@
# Helpful Tips {#ch-helpful-tips}
```{=include=} chapters
tips/debugging-nvf.md
tips/offline-docs.md
```

View file

@ -0,0 +1,19 @@
# Debugging nvf {#sec-debugging-nvf}
There may be instances where the your Nix configuration evaluates to invalid
Lua, or times when you will be asked to provide your built Lua configuration for
easier debugging by nvf maintainers. nvf provides two helpful utilities out of
the box.
**nvf-print-config** and **nvf-print-config-path** will be bundled with nvf as
lightweight utilities to help you view or share your built configuration when
necessary.
To view your configuration with syntax highlighting, you may use the
[bat pager](https://github.com/sharkdp/bat).
```bash
nvf-print-config | bat --language=lua
```
Alternatively, `cat` or `less` may also be used.

View file

@ -0,0 +1,11 @@
# Offline Documentation {#sec-offline-documentation}
[https://notashelf.github.io/nvf/options.html]: https://notashelf.github.io/nvf/options.html
The manpages provided by nvf contains an offline version of the option search
normally available at [https://notashelf.github.io/nvf/options.html]. You may
use the `man 5 nvf` command to view option documentation from the comfort of
your terminal.
Note that this is only available for NixOS and Home-Manager module
installations.

View file

@ -28,11 +28,11 @@ configuration formats.
### `vim.maps` rewrite {#sec-vim-maps-rewrite} ### `vim.maps` rewrite {#sec-vim-maps-rewrite}
Instead of specifying map modes using submodules (eg.: `vim.maps.normal`), a new Instead of specifying map modes using submodules (e.g.: `vim.maps.normal`), a
`vim.keymaps` submodule with support for a `mode` option has been introduced. It new `vim.keymaps` submodule with support for a `mode` option has been
can be either a string, or a list of strings, where a string represents the introduced. It can be either a string, or a list of strings, where a string
short-name of the map mode(s), that the mapping should be set for. See represents the short-name of the map mode(s), that the mapping should be set
`:help map-modes` for more information. for. See `:help map-modes` for more information.
For example: For example:

View file

@ -13,6 +13,19 @@
- Add [render-markdown.nvim] under - Add [render-markdown.nvim] under
`languages.markdown.extensions.render-markdown-nvim` `languages.markdown.extensions.render-markdown-nvim`
- Implement [](#opt-vim.git.gitsigns.setupOpts) for user-specified setup table
in gitsigns configuration.
- [](#opt-vim.options.mouse) no longer compares values to an enum of available
mouse modes. This means you can provide any string without the module system
warning you that it is invalid. Do keep in mind that this value is no longer
checked, so you will be responsible for ensuring its validity.
- Deprecate `vim.enableEditorconfig` in favor of
[](#opt-vim.globals.editorconfig).
- Deprecate rnix-lsp as it has been abandoned and archived upstream.
[amadaluzia](https://github.com/amadaluzia): [amadaluzia](https://github.com/amadaluzia):
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim [haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
@ -25,3 +38,16 @@
- Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave` - Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave`
instead. instead.
[horriblename](https://github.com/horriblename):
[aerial.nvim](https://github.com/stevearc/aerial.nvim)
[nvim-ufo](https://github.com/kevinhwang91/nvim-ufo)
- Add [aerial.nvim]
- Add [nvim-ufo]
[LilleAila](https://github.com/LilleAila):
- Remove `vim.notes.obsidian.setupOpts.dir`, which was set by default. Fixes
issue with setting the workspace directory.

View file

@ -51,27 +51,6 @@
"type": "github" "type": "github"
} }
}, },
"naersk": {
"inputs": {
"nixpkgs": [
"rnix-lsp",
"nixpkgs"
]
},
"locked": {
"lastModified": 1655042882,
"narHash": "sha256-9BX8Fuez5YJlN7cdPO63InoyBy7dm3VlJkkmTt6fS1A=",
"owner": "nix-community",
"repo": "naersk",
"rev": "cddffb5aa211f50c4b8750adbec0bbbdfb26bb9f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"nil": { "nil": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
@ -124,22 +103,6 @@
"url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/5487e69da40cbd611ab2cadee0b4637225f7cfae.tar.gz"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1656753965,
"narHash": "sha256-BCrB3l0qpJokOnIVc3g2lHiGhnjUi0MoXiw6t1o8H1E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "0ea7a8f1b939d74e5df8af9a8f7342097cdf69eb",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nmd": { "nmd": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -156,6 +119,22 @@
"type": "sourcehut" "type": "sourcehut"
} }
}, },
"plugin-aerial-nvim": {
"flake": false,
"locked": {
"lastModified": 1736064692,
"narHash": "sha256-7YQtkUTACTMfAGoqoFDPmRrqtw+ypxDbeLCTB3sy4Us=",
"owner": "stevearc",
"repo": "aerial.nvim",
"rev": "b3ec25ca8c347fafa976484a6cace162239112e1",
"type": "github"
},
"original": {
"owner": "stevearc",
"repo": "aerial.nvim",
"type": "github"
}
},
"plugin-alpha-nvim": { "plugin-alpha-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1502,6 +1481,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-nvim-ufo": {
"flake": false,
"locked": {
"lastModified": 1735147722,
"narHash": "sha256-etyfm4KpwjYN+kkotOMl0LgbQniILmqMqab4acMtTlw=",
"owner": "kevinhwang91",
"repo": "nvim-ufo",
"rev": "32cb247b893a384f1888b9cd737264159ecf183c",
"type": "github"
},
"original": {
"owner": "kevinhwang91",
"repo": "nvim-ufo",
"type": "github"
}
},
"plugin-nvim-web-devicons": { "plugin-nvim-web-devicons": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -1678,6 +1673,22 @@
"type": "github" "type": "github"
} }
}, },
"plugin-promise-async": {
"flake": false,
"locked": {
"lastModified": 1722813441,
"narHash": "sha256-9eM66brPjiFlY64vmBetRYrKnpDyN7+/URMm4GsGimA=",
"owner": "kevinhwang91",
"repo": "promise-async",
"rev": "119e8961014c9bfaf1487bf3c2a393d254f337e2",
"type": "github"
},
"original": {
"owner": "kevinhwang91",
"repo": "promise-async",
"type": "github"
}
},
"plugin-registers": { "plugin-registers": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -2062,26 +2073,6 @@
"type": "github" "type": "github"
} }
}, },
"rnix-lsp": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"utils": "utils"
},
"locked": {
"lastModified": 1669555118,
"narHash": "sha256-F0s0m62S5bHNVWNHLZD6SeHiLrsDx98VQbRjDyIu+qQ=",
"owner": "nix-community",
"repo": "rnix-lsp",
"rev": "95d40673fe43642e2e1144341e86d0036abd95d9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "rnix-lsp",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -2090,6 +2081,7 @@
"nil": "nil", "nil": "nil",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nmd": "nmd", "nmd": "nmd",
"plugin-aerial-nvim": "plugin-aerial-nvim",
"plugin-alpha-nvim": "plugin-alpha-nvim", "plugin-alpha-nvim": "plugin-alpha-nvim",
"plugin-base16": "plugin-base16", "plugin-base16": "plugin-base16",
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim", "plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
@ -2174,6 +2166,7 @@
"plugin-nvim-tree-lua": "plugin-nvim-tree-lua", "plugin-nvim-tree-lua": "plugin-nvim-tree-lua",
"plugin-nvim-treesitter-context": "plugin-nvim-treesitter-context", "plugin-nvim-treesitter-context": "plugin-nvim-treesitter-context",
"plugin-nvim-ts-autotag": "plugin-nvim-ts-autotag", "plugin-nvim-ts-autotag": "plugin-nvim-ts-autotag",
"plugin-nvim-ufo": "plugin-nvim-ufo",
"plugin-nvim-web-devicons": "plugin-nvim-web-devicons", "plugin-nvim-web-devicons": "plugin-nvim-web-devicons",
"plugin-obsidian-nvim": "plugin-obsidian-nvim", "plugin-obsidian-nvim": "plugin-obsidian-nvim",
"plugin-omnisharp-extended": "plugin-omnisharp-extended", "plugin-omnisharp-extended": "plugin-omnisharp-extended",
@ -2185,6 +2178,7 @@
"plugin-plenary-nvim": "plugin-plenary-nvim", "plugin-plenary-nvim": "plugin-plenary-nvim",
"plugin-precognition-nvim": "plugin-precognition-nvim", "plugin-precognition-nvim": "plugin-precognition-nvim",
"plugin-project-nvim": "plugin-project-nvim", "plugin-project-nvim": "plugin-project-nvim",
"plugin-promise-async": "plugin-promise-async",
"plugin-registers": "plugin-registers", "plugin-registers": "plugin-registers",
"plugin-render-markdown-nvim": "plugin-render-markdown-nvim", "plugin-render-markdown-nvim": "plugin-render-markdown-nvim",
"plugin-rose-pine": "plugin-rose-pine", "plugin-rose-pine": "plugin-rose-pine",
@ -2209,7 +2203,6 @@
"plugin-vim-repeat": "plugin-vim-repeat", "plugin-vim-repeat": "plugin-vim-repeat",
"plugin-vim-startify": "plugin-vim-startify", "plugin-vim-startify": "plugin-vim-startify",
"plugin-which-key": "plugin-which-key", "plugin-which-key": "plugin-which-key",
"rnix-lsp": "rnix-lsp",
"systems": "systems_2" "systems": "systems_2"
} }
}, },
@ -2263,21 +2256,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"utils": {
"locked": {
"lastModified": 1656928814,
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -89,7 +89,6 @@
}; };
# Language servers (use master instead of nixpkgs) # Language servers (use master instead of nixpkgs)
rnix-lsp.url = "github:nix-community/rnix-lsp";
nil = { nil = {
url = "github:oxalica/nil"; url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -720,6 +719,16 @@
flake = false; flake = false;
}; };
plugin-promise-async = {
url = "github:kevinhwang91/promise-async";
flake = false;
};
plugin-nvim-ufo = {
url = "github:kevinhwang91/nvim-ufo";
flake = false;
};
plugin-new-file-template-nvim = { plugin-new-file-template-nvim = {
# (required by new-file-template.nvim) # (required by new-file-template.nvim)
url = "github:otavioschwanck/new-file-template.nvim"; url = "github:otavioschwanck/new-file-template.nvim";
@ -730,5 +739,10 @@
url = "github:mrcjkb/haskell-tools.nvim"; url = "github:mrcjkb/haskell-tools.nvim";
flake = false; flake = false;
}; };
plugin-aerial-nvim = {
url = "github:stevearc/aerial.nvim";
flake = false;
};
}; };
} }

View file

@ -8,8 +8,10 @@
inherit system; inherit system;
overlays = [ overlays = [
inputs.self.overlays.default inputs.self.overlays.default
(_: _: { (_: _: {
rnix-lsp = inputs'.rnix-lsp.defaultPackage; # Build nil from source to get most recent
# features as they are added.
nil = inputs'.nil.packages.default; nil = inputs'.nil.packages.default;
}) })
]; ];

View file

@ -6,7 +6,12 @@
inherit (lib.nvim.attrsets) mapListToAttrs; inherit (lib.nvim.attrsets) mapListToAttrs;
in { in {
# Converts a boolean to a yes/no string. This is used in lots of # Converts a boolean to a yes/no string. This is used in lots of
# configuration formats. # configuration formats, and is not covered by `toLuaObject`
toVimBool = bool:
if bool
then "yes"
else "no";
diagnosticsToLua = { diagnosticsToLua = {
lang, lang,
config, config,
@ -30,8 +35,8 @@ in {
mkEnable = desc: mkEnable = desc:
mkOption { mkOption {
description = "Turn on ${desc} for enabled languages by default";
type = bool;
default = false; default = false;
type = bool;
description = "Turn on ${desc} for enabled languages by default";
}; };
} }

View file

@ -14,6 +14,7 @@
splitRight = "splitright"; splitRight = "splitright";
autoIndent = "autoindent"; autoIndent = "autoindent";
wordWrap = "wrap"; wordWrap = "wrap";
showSignColumn = "signcolumn";
}; };
in { in {
imports = concatLists [ imports = concatLists [
@ -35,23 +36,28 @@ in {
vim.autopairs.enable has been removed in favor of per-plugin modules. vim.autopairs.enable has been removed in favor of per-plugin modules.
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autopairs" "type"] '' (mkRemovedOptionModule ["vim" "autopairs" "type"] ''
vim.autopairs.type has been removed in favor of per-plugin modules. vim.autopairs.type has been removed in favor of per-plugin modules.
You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autocomplete" "enable"] '' (mkRemovedOptionModule ["vim" "autocomplete" "enable"] ''
vim.autocomplete.enable has been removed in favor of per-plugin modules. vim.autocomplete.enable has been removed in favor of per-plugin modules.
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autocomplete" "type"] '' (mkRemovedOptionModule ["vim" "autocomplete" "type"] ''
vim.autocomplete.type has been removed in favor of per-plugin modules. vim.autocomplete.type has been removed in favor of per-plugin modules.
You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead.
'') '')
(mkRemovedOptionModule ["vim" "autocomplete" "sources"] '' (mkRemovedOptionModule ["vim" "autocomplete" "sources"] ''
vim.autocomplete.sources has been removed in favor of per-plugin modules. vim.autocomplete.sources has been removed in favor of per-plugin modules.
You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources
instead. instead.
'') '')
(mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] '' (mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] ''
vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip. vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip.
'') '')
@ -84,9 +90,12 @@ in {
`tabstop` and `shiftwidth` manually in `vim.options` or per-filetype in a `tabstop` and `shiftwidth` manually in `vim.options` or per-filetype in a
`ftplugin` directory added to your runtime path. `ftplugin` directory added to your runtime path.
'') '')
# 2024-12-02
(mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"])
] ]
# 2024-12-1 # 2024-12-01
# Migrated via batchRenameOptions. Further batch renames must be below this line. # Migrated via batchRenameOptions. Further batch renames must be below this line.
renamedVimOpts renamedVimOpts
]; ];

View file

@ -5,6 +5,7 @@
}: let }: let
inherit (lib.options) mkOption mkEnableOption literalMD; inherit (lib.options) mkOption mkEnableOption literalMD;
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.attrsets) optionalAttrs;
inherit (lib.types) enum bool str int either; inherit (lib.types) enum bool str int either;
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.dag) entryAfter; inherit (lib.nvim.dag) entryAfter;
@ -58,24 +59,12 @@ in {
description = "Prevent swapfile and backupfile from being created"; description = "Prevent swapfile and backupfile from being created";
}; };
showSignColumn = mkOption {
type = bool;
default = true;
description = "Show the sign column";
};
bell = mkOption { bell = mkOption {
type = enum ["none" "visual" "on"]; type = enum ["none" "visual" "on"];
default = "none"; default = "none";
description = "Set how bells are handled. Options: on, visual or none"; description = "Set how bells are handled. Options: on, visual or none";
}; };
enableEditorconfig = mkOption {
type = bool;
default = true;
description = "Follow editorconfig rules in current directory";
};
searchCase = mkOption { searchCase = mkOption {
type = enum ["ignore" "smart" "sensitive"]; type = enum ["ignore" "smart" "sensitive"];
default = "sensitive"; default = "sensitive";
@ -106,63 +95,55 @@ in {
# Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o) # Set options that were previously interpolated in 'luaConfigRC.basic' as vim.options (vim.o)
# and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the # and 'vim.globals' (vim.g). Future options, if possible, should be added here instead of the
# luaConfigRC section below. # luaConfigRC section below.
options = pushDownDefault { options = pushDownDefault (lib.mergeAttrsList [
{
# Options that are always set, with a lower priority
encoding = "utf-8"; encoding = "utf-8";
hidden = true; hidden = true;
expandtab = true; expandtab = true;
};
globals = pushDownDefault { # Junkfile Behaviour
editorconfig = cfg.enableEditorconfig; swapfile = !cfg.preventJunkFiles;
}; backup = !cfg.preventJunkFiles;
writebackup = !cfg.preventJunkFiles;
}
# Options that are more difficult to set through 'vim.options'. Fear not, though (optionalAttrs cfg.undoFile.enable {
# as the Lua DAG is still as powerful as it could be. undofile = true;
undodir = cfg.undoFile.path;
})
(optionalAttrs (cfg.bell == "none") {
errorbells = false;
visualbell = false;
})
(optionalAttrs (cfg.bell == "on") {
visualbell = false;
})
(optionalAttrs (cfg.bell == "visual") {
visualbell = false;
})
(optionalAttrs (cfg.lineNumberMode == "relative") {
relativenumber = true;
})
(optionalAttrs (cfg.lineNumberMode == "number") {
number = true;
})
(optionalAttrs (cfg.lineNumberMode == "relNumber") {
number = true;
relativenumber = true;
})
]);
# Options that are more difficult to set through 'vim.options'. Namely, appending values
# to pre-set Neovim options. Fear not, though as the Lua DAG is still as powerful as it
# could be.
luaConfigRC.basic = entryAfter ["globalsScript"] '' luaConfigRC.basic = entryAfter ["globalsScript"] ''
-- Settings that are set for everything
vim.opt.shortmess:append("c")
${optionalString cfg.undoFile.enable ''
vim.o.undofile = true
vim.o.undodir = ${toLuaObject cfg.undoFile.path}
''}
${optionalString cfg.showSignColumn ''
vim.o.signcolumn = "yes"
''}
${optionalString cfg.preventJunkFiles ''
vim.o.swapfile = false
vim.o.backup = false
vim.o.writebackup = false
''}
${optionalString (cfg.bell == "none") ''
vim.o.errorbells = false
vim.o.visualbell = false
''}
${optionalString (cfg.bell == "on") ''
vim.o.visualbell = false
''}
${optionalString (cfg.bell == "visual") ''
vim.o.errorbells = false
''}
${optionalString (cfg.lineNumberMode == "relative") ''
vim.o.relativenumber = true
''}
${optionalString (cfg.lineNumberMode == "number") ''
vim.o.number = true
''}
${optionalString (cfg.lineNumberMode == "relNumber") ''
vim.o.number = true
vim.o.relativenumber = true
''}
${optionalString cfg.useSystemClipboard '' ${optionalString cfg.useSystemClipboard ''
vim.opt.clipboard:append("unnamedplus") vim.opt.clipboard:append("unnamedplus")
''} ''}

View file

@ -124,7 +124,6 @@ in {
nvim --headless --clean \ nvim --headless --clean \
--cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n --cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n
done done
''; '';
in in
mkIf (cfg.extraSpellWords != {}) [ mkIf (cfg.extraSpellWords != {}) [
@ -133,10 +132,12 @@ in {
compileJoinedSpellfiles.outPath compileJoinedSpellfiles.outPath
]; ];
luaConfigRC.spellcheck = entryAfter ["basic"] '' options = {
vim.opt.spell = true spell = true;
vim.opt.spelllang = ${listToLuaTable cfg.languages} spelllang = cfg.languages;
};
luaConfigRC.spellcheck = entryAfter ["basic"] ''
-- Disable spellchecking for certain filetypes -- Disable spellchecking for certain filetypes
-- as configured by `vim.spellcheck.ignoredFiletypes` -- as configured by `vim.spellcheck.ignoredFiletypes`
vim.api.nvim_create_augroup("nvf_autocmds", {clear = false}) vim.api.nvim_create_augroup("nvf_autocmds", {clear = false})

View file

@ -1,7 +1,7 @@
{ {
options,
config, config,
lib, lib,
pkgs,
... ...
}: let }: let
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
@ -11,8 +11,7 @@
inherit (lib.nvim.binds) pushDownDefault; inherit (lib.nvim.binds) pushDownDefault;
cfg = config.vim.filetree.nvimTree; cfg = config.vim.filetree.nvimTree;
self = import ./nvimtree.nix {inherit pkgs lib;}; inherit (options.vim.filetree.nvimTree) mappings;
inherit (self.options.vim.filetree.nvimTree) mappings;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim = {

View file

@ -7,6 +7,7 @@
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault; inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault;
inherit (lib.nvim.dag) entryAnywhere; inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.git.gitsigns; cfg = config.vim.git.gitsigns;
@ -70,7 +71,7 @@ in {
}; };
pluginRC.gitsigns = entryAnywhere '' pluginRC.gitsigns = entryAnywhere ''
require('gitsigns').setup{} require('gitsigns').setup(${toLuaObject cfg.setupOpts})
''; '';
}; };
} }

View file

@ -6,6 +6,7 @@
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkRenamedOptionModule; inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.binds) mkMappingOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in { in {
imports = [ imports = [
(mkRenamedOptionModule ["vim" "git" "gitsigns" "codeActions" "vim" "gitsigns" "codeActions"] ["vim" "git" "gitsigns" "codeActions" "enable"]) (mkRenamedOptionModule ["vim" "git" "gitsigns" "codeActions" "vim" "gitsigns" "codeActions"] ["vim" "git" "gitsigns" "codeActions" "enable"])
@ -13,6 +14,7 @@ in {
options.vim.git.gitsigns = { options.vim.git.gitsigns = {
enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;}; enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;};
setupOpts = mkPluginSetupOption "gitsigns" {};
codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls"; codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls";

View file

@ -130,7 +130,6 @@ in {
(mkIf cfg.lsp.enable { (mkIf cfg.lsp.enable {
vim.lsp.lspconfig.enable = true; vim.lsp.lspconfig.enable = true;
vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig; vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig;
}) })

View file

@ -71,7 +71,7 @@ in {
cmd = ${ cmd = ${
if isList cfg.lsp.package if isList cfg.lsp.package
then expToLua cfg.lsp.package then expToLua cfg.lsp.package
else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper"}'' else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper", "--lsp"}''
}, },
on_attach = function(client, bufnr, ht) on_attach = function(client, bufnr, ht)
default_on_attach(client, bufnr, ht) default_on_attach(client, bufnr, ht)

View file

@ -26,22 +26,6 @@
then expToLua package then expToLua package
else ''{"${package}/bin/${defaultCmd}"}''; else ''{"${package}/bin/${defaultCmd}"}'';
servers = { servers = {
rnix = {
package = pkgs.rnix-lsp;
internalFormatter = cfg.format.type == "nixpkgs-fmt";
lspConfig = ''
lspconfig.rnix.setup{
capabilities = capabilities,
${
if (cfg.format.enable && cfg.format.type == "nixpkgs-fmt")
then useFormat
else noFormat
},
cmd = ${packageToCmd cfg.lsp.package "rnix-lsp"},
}
'';
};
nil = { nil = {
package = pkgs.nil; package = pkgs.nil;
internalFormatter = true; internalFormatter = true;
@ -165,6 +149,7 @@ in {
type = enum (attrNames formats); type = enum (attrNames formats);
default = defaultFormat; default = defaultFormat;
}; };
package = mkOption { package = mkOption {
description = "Nix formatter package"; description = "Nix formatter package";
type = package; type = package;
@ -188,7 +173,18 @@ in {
assertions = [ assertions = [
{ {
assertion = cfg.format.type != "nixpkgs-fmt"; assertion = cfg.format.type != "nixpkgs-fmt";
message = "nixpkgs-fmt has been archived upstream. Please use one of the following instead: ${concatStringsSep ", " (attrNames formats)}"; message = ''
nixpkgs-fmt has been archived upstream. Please use one of the following available formatters:
${concatStringsSep ", " (attrNames formats)}
'';
}
{
assertion = cfg.lsp.server != "rnix";
message = ''
rnix-lsp has been archived upstream. Please use one of the following available language servers:
${concatStringsSep ", " (attrNames servers)}
'';
} }
]; ];
vim.pluginRC.nix = '' vim.pluginRC.nix = ''

View file

@ -24,12 +24,6 @@ in {
enable = mkEnableOption "complementary neovim plugins for Obsidian editor"; enable = mkEnableOption "complementary neovim plugins for Obsidian editor";
setupOpts = mkPluginSetupOption "Obsidian.nvim" { setupOpts = mkPluginSetupOption "Obsidian.nvim" {
dir = mkOption {
type = str;
default = "~/my-vault";
description = "Obsidian vault directory";
};
daily_notes = { daily_notes = {
folder = mkOption { folder = mkOption {
type = nullOr str; type = nullOr str;

View file

@ -2,6 +2,7 @@
imports = [ imports = [
./noice ./noice
./modes ./modes
./nvim-ufo
./notifications ./notifications
./smartcolumn ./smartcolumn
./colorizer ./colorizer

View file

@ -0,0 +1,20 @@
{
lib,
config,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.ui.nvim-ufo;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["promise-async"];
lazy.plugins.nvim-ufo = {
package = "nvim-ufo";
setupModule = "ufo";
inherit (cfg) setupOpts;
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./nvim-ufo.nix
./config.nix
];
}

View file

@ -0,0 +1,9 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.ui.nvim-ufo = {
enable = mkEnableOption "nvim-ufo";
setupOpts = mkPluginSetupOption "nvim-ufo" {};
};
}

View file

@ -1,5 +1,6 @@
{ {
imports = [ imports = [
./outline
./binds ./binds
./ccc ./ccc
./gestures ./gestures

View file

@ -15,9 +15,10 @@
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = ["gesture-nvim"]; vim = {
startPlugins = ["gesture-nvim"];
vim.maps.normal = mkMerge [ maps.normal = mkMerge [
(mkSetLuaBinding mappings.draw "require('gesture').draw") (mkSetLuaBinding mappings.draw "require('gesture').draw")
(mkSetLuaBinding mappings.finish "require('gesture').finish") (mkSetLuaBinding mappings.finish "require('gesture').finish")
(mkIf (mappings.draw.value == "<RightDrag>") { (mkIf (mappings.draw.value == "<RightDrag>") {
@ -25,20 +26,21 @@ in {
}) })
]; ];
vim.pluginRC.gesture-nvim = entryAnywhere '' options.mouse = "a";
vim.opt.mouse = "a" pluginRC.gesture-nvim = entryAnywhere ''
local gesture = require("gesture") local gesture = require("gesture")
gesture.register({ gesture.register({
name = "scroll to bottom", name = "scroll to bottom",
inputs = { gesture.up(), gesture.down() }, inputs = { gesture.up(), gesture.down() },
action = "normal! G", action = "normal! G",
}) })
gesture.register({ gesture.register({
name = "next tab", name = "next tab",
inputs = { gesture.right() }, inputs = { gesture.right() },
action = "tabnext", action = "tabnext",
}) })
gesture.register({ gesture.register({
name = "previous tab", name = "previous tab",
inputs = { gesture.left() }, inputs = { gesture.left() },
@ -46,6 +48,7 @@ in {
vim.cmd.tabprevious() vim.cmd.tabprevious()
end, end,
}) })
gesture.register({ gesture.register({
name = "go back", name = "go back",
inputs = { gesture.right(), gesture.left() }, inputs = { gesture.right(), gesture.left() },
@ -54,4 +57,5 @@ in {
}) })
''; '';
}; };
};
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./gesture-nvim.nix ./gesture-nvim.nix
./config.nix ./config.nix

View file

@ -0,0 +1,14 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.binds) mkMappingOption;
in {
options.vim.utility.outline.aerial-nvim = {
enable = mkEnableOption "Aerial.nvim";
setupOpts = mkPluginSetupOption "aerial.nvim" {};
mappings = {
toggle = mkMappingOption "Toggle aerial window" "gO";
};
};
}

View file

@ -0,0 +1,42 @@
{
options,
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.binds) mkKeymap;
cfg = config.vim.utility.outline.aerial-nvim;
inherit (options.vim.utility.outline.aerial-nvim) mappings;
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins.aerial-nvim = {
package = "aerial-nvim";
setupModule = "aerial";
inherit (cfg) setupOpts;
cmd = [
"AerialClose"
"AerialCloseAll"
"AerialGo"
"AerialInfo"
"AerialNavClose"
"AerialNavOpen"
"AerialNavToggle"
"AerialNext"
"AerialOpen"
"AerialOpenAll"
"AerialPrev"
"AerialToggle"
];
keys = [
(mkKeymap "n" cfg.mappings.toggle ":AerialToggle<CR>" {desc = mappings.toggle.description;})
];
};
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./aerial-nvim.nix
./config.nix
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./aerial-nvim
];
}

View file

@ -22,6 +22,12 @@ in {
package = "telescope"; package = "telescope";
setupModule = "telescope"; setupModule = "telescope";
inherit (cfg) setupOpts; inherit (cfg) setupOpts;
# HACK: workaround until https://github.com/NotAShelf/nvf/issues/535 gets resolved
before = ''
vim.g.loaded_telescope = nil
'';
after = '' after = ''
local telescope = require("telescope") local telescope = require("telescope")
${optionalString config.vim.ui.noice.enable "telescope.load_extension('noice')"} ${optionalString config.vim.ui.noice.enable "telescope.load_extension('noice')"}

View file

@ -1,18 +1,22 @@
{ {
config, config,
lib,
pkgs, pkgs,
lib,
... ...
}: let }: let
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.meta) getExe;
cfg = config.vim.utility.vim-wakatime; cfg = config.vim.utility.vim-wakatime;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim.startPlugins = [pkgs.vimPlugins.vim-wakatime]; vim = {
startPlugins = [pkgs.vimPlugins.vim-wakatime];
vim.pluginRC.vim-wakatime = mkIf (cfg.cli-package != null) '' # Wakatime configuration is stored as vim globals.
vim.g.wakatime_CLIPath = "${cfg.cli-package}" globals = {
''; "wakatime_CLIPath" = mkIf (cfg.cli-package != null) "${getExe cfg.cli-package}";
};
};
}; };
} }

View file

@ -1,4 +1,4 @@
_: { {
imports = [ imports = [
./config.nix ./config.nix
./vim-wakatime.nix ./vim-wakatime.nix

View file

@ -1,18 +1,24 @@
{ {
lib,
pkgs, pkgs,
lib,
... ...
}: let }: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) nullOr package; inherit (lib.types) nullOr package;
in { in {
options.vim.utility.vim-wakatime = { options.vim.utility.vim-wakatime = {
enable = mkEnableOption "vim-wakatime: live code statistics"; enable = mkEnableOption ''
automatic time tracking and metrics generated from your programming activity [vim-wakatime]
'';
cli-package = mkOption { cli-package = mkOption {
type = nullOr package; type = nullOr package;
default = pkgs.wakatime; default = pkgs.wakatime-cli;
description = "The package that should be used for wakatime-cli. Set as null to use the default path in `$XDG_DATA_HOME`"; example = null;
description = ''
The package that should be used for wakatime-cli.
Set as null to use the default path in {env}`$XDG_DATA_HOME`
'';
}; };
}; };
} }

View file

@ -49,6 +49,17 @@
flutter-tools-patched = buildPlug { flutter-tools-patched = buildPlug {
pname = "flutter-tools"; pname = "flutter-tools";
patches = [./patches/flutter-tools.patch]; patches = [./patches/flutter-tools.patch];
# Disable failing require check hook checks
nvimSkipModule = [
"flutter-tools.devices"
"flutter-tools.dap"
"flutter-tools.runners.job_runner"
"flutter-tools.decorations"
"flutter-tools.commands"
"flutter-tools.executable"
"flutter-tools.dev_tools"
];
}; };
}; };

View file

@ -3,9 +3,11 @@
lib, lib,
... ...
}: let }: let
inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.options) mkOption literalMD literalExpression;
inherit (lib.strings) optionalString; inherit (lib.strings) optionalString;
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything; inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything;
inherit (lib.trivial) isBool;
inherit (lib.nvim.languages) toVimBool;
inherit (lib.nvim.types) dagOf; inherit (lib.nvim.types) dagOf;
inherit (lib.nvim.lua) listToLuaTable; inherit (lib.nvim.lua) listToLuaTable;
@ -17,7 +19,7 @@ in {
default = false; default = false;
example = true; example = true;
description = '' description = ''
[{option}`official documentation`]: https://neovim.io/doc/user/lua.html#vim.loader.enable() [official documentation]: https://neovim.io/doc/user/lua.html#vim.loader.enable()
the experimental Lua module loader to speed up the start up process the experimental Lua module loader to speed up the start up process
@ -29,7 +31,7 @@ in {
::: {.note} ::: {.note}
The Lua module loader is *disabled* by default. Before setting this option, please The Lua module loader is *disabled* by default. Before setting this option, please
take a look at the [{option}`official documentation`]. This option may be enabled by take a look at the {option}`[official documentation]`. This option may be enabled by
default in the future. default in the future.
::: :::
''; '';
@ -81,7 +83,7 @@ in {
./nvim/my-lua-file.lua ./nvim/my-lua-file.lua
# source type path - pure and reproducible # source type path - pure and reproducible
(builtins.source { (builtins.path {
path = ./nvim/my-lua-file.lua; path = ./nvim/my-lua-file.lua;
name = "my-lua-file"; name = "my-lua-file";
}) })
@ -121,6 +123,21 @@ in {
default = ","; default = ",";
description = "The key used for `<localleader>` mappings"; description = "The key used for `<localleader>` mappings";
}; };
editorconfig = mkOption {
type = bool;
default = true;
description = ''
Whether to enable EditorConfig integration in Neovim.
This defaults to true as it is enabled by default in stock
Neovim, setting this option to false disables EditorConfig
integration entirely.
See [Neovim documentation](https://neovim.io/doc/user/editorconfig.html)
for more details on configuring EditorConfig behaviour.
'';
};
}; };
}; };
@ -150,16 +167,25 @@ in {
}; };
mouse = mkOption { mouse = mkOption {
type = enum ["a" "n" "v" "i" "c"]; type = str;
default = "a"; default = "nvi";
example = "a";
description = '' description = ''
Set modes for mouse support. Set modes for mouse support.
* a - all
* n - normal * n - normal
* v - visual * v - visual
* i - insert * i - insert
* c - command * c - command-line
* h - all modes when editing a help file
* a - all modes
* r - for hit-enter and more-prompt prompt
[neovim documentation]: https://neovim.io/doc/user/options.html#'mouse'"
This option takes a string to ensure proper conversion to the corresponding Lua type.
As such, we do not check the value passed to this option. Please ensure that any value
that is set here is a valid value as per [neovim documentation].
''; '';
}; };
@ -211,6 +237,16 @@ in {
description = "Enable word wrapping."; description = "Enable word wrapping.";
}; };
signcolumn = mkOption {
type = either str bool;
default = true;
apply = x:
if isBool x
then toVimBool x # convert to a yes/no str
else x;
description = "Show the sign column";
};
tabstop = mkOption { tabstop = mkOption {
type = int; type = int;
default = 8; # Neovim default default = 8; # Neovim default
@ -263,7 +299,11 @@ in {
vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths}) vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths})
''} ''}
${optionalString cfg.enableLuaLoader "vim.loader.enable()"} ${optionalString cfg.enableLuaLoader ''
if vim.loader then
vim.loader.enable()
end
''}
''; '';
defaultText = literalMD '' defaultText = literalMD ''
@ -273,7 +313,7 @@ in {
if [](#opt-vim.enableLuaLoader) is set to true. if [](#opt-vim.enableLuaLoader) is set to true.
''; '';
example = literalExpression ''"$${builtins.readFile ./my-lua-config-pre.lua}"''; example = literalExpression ''''${builtins.readFile ./my-lua-config-pre.lua}'';
description = '' description = ''
Verbatim lua code that will be inserted **before** Verbatim lua code that will be inserted **before**