diff --git a/.github/README.md b/.github/README.md index 9a059419..5d10c73f 100644 --- a/.github/README.md +++ b/.github/README.md @@ -206,20 +206,6 @@ features. ## 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 [mnw]: https://github.com/gerg-l/mnw @@ -227,19 +213,21 @@ project has been helpful to you. nvf would not be what it is today without the awesome people below. Special, heart-felt thanks to -- [**@fufexan**](https://github.com/fufexan) - For the transition to flake-parts - and invaluable Nix assistance. -- [**@FlafyDev**](https://github.com/FlafyDev) - For getting Home-Manager module - to work and Nix assistance. -- [**@n3oney**](https://github.com/n3oney) - For making custom keybinds finally +- [@fufexan](https://github.com/fufexan) - For the transition to flake-parts and + invaluable Nix assistance. +- [@FlafyDev](https://github.com/FlafyDev) - For getting home-manager module to + work and Nix assistance. +- [@n3oney](https://github.com/n3oney) - For making custom keybinds finally possible, and other module additions. -- [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo -- [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes - that I could not. -- [**@Gerg-l**](https://github.com/gerg-l) 🐸 - For the modern Neovim wrapper, - [mnw], and occasional code improvements. -- [**@Soliprem**](https://github.com/soliprem) - Rigorously implementing missing - features and excellent work on new language modules. +- [@horriblename](https://github.com/horriblename) - For actively implementing + planned features and quality of life updates. +- [@Yavko](https://github.com/Yavko) - For the amazing **nvf** logo +- [@FrothyMarrow](https://github.com/FrothyMarrow) - For seeing mistakes that I + could not. +- [@Diniamo](https://github.com/Diniamo) - For actively submitting pull + requests, issues and assistance with maintenance of nvf. +- [@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! @@ -249,17 +237,17 @@ This configuration borrows from and is based on a few other configurations, including: - [@jordanisaacs's](https://github.com/jordanisaacs) - [**neovim-flake**](https://github.com/jordanisaacs/neovim-flake) that this - flake is originally based on. + [neovim-flake](https://github.com/jordanisaacs/neovim-flake) that this 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) [neovim-flake](https://github.com/wiltaylor/neovim-flake) for plugin and design ideas. - [@gvolpe's](https://github.com/gvolpe) [neovim-flake](https://github.com/gvolpe/neovim-flake) for plugin, design and 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 recommend checking their work out. @@ -267,12 +255,12 @@ recommend checking their work out. ## License -Following the license of -[the original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf -has been made available under the [**MIT License**](LICENSE). However, all -assets and documentation are published under the +Following the license of the +[original neovim-flake](https://github.com/jordanisaacs/neovim-flake), nvf has +been made available under the [**MIT License**](LICENSE). However, all assets +and documentation are published under the [**CC BY License**](https://github.com/NotAShelf/nvf/blob/main/.github/assets/LICENSE) -under explicit permission by the author or authors. +under explicit permission by the artist.
Yes, this includes the logo work too. Stop taking artwork that is not yours!
diff --git a/docs/manual/installation/modules/home-manager.md b/docs/manual/installation/modules/home-manager.md index 34f2757e..a2170159 100644 --- a/docs/manual/installation/modules/home-manager.md +++ b/docs/manual/installation/modules/home-manager.md @@ -10,18 +10,12 @@ To use it, we first add the input flake. ```nix { 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"; - - # Required, nvf works best and only directly supports flakes nvf = { url = "github:notashelf/nvf"; - # 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. + # you can override input nixpkgs inputs.nixpkgs.follows = "nixpkgs"; - # Optionally, you can also override individual plugins + # you can also override individual plugins # for example: inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs }; @@ -33,8 +27,8 @@ Followed by importing the home-manager module somewhere in your configuration. ```nix { - # Assuming "nvf" is in your inputs and inputs is in the argument set. - # See example installation below + # assuming nvf is in your inputs and inputs is in the argset + # see example below imports = [ inputs.nvf.homeManagerModules.default ]; } ``` @@ -50,15 +44,12 @@ Followed by importing the home-manager module somewhere in your configuration. }; outputs = { nixpkgs, home-manager, nvf, ... }: let - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - in { + system = "x86_64-linux"; in { # ↓ this is your home output in the flake schema, expected by home-manager - "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; + "your-username@your-hostname" = home-manager.lib.homeManagerConfiguration modules = [ nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options - ./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here + ./home.nix # <- your home entrypoint ]; }; }; diff --git a/docs/manual/installation/modules/nixos.md b/docs/manual/installation/modules/nixos.md index bcf7472b..d8be2035 100644 --- a/docs/manual/installation/modules/nixos.md +++ b/docs/manual/installation/modules/nixos.md @@ -10,18 +10,12 @@ To use it, we first add the input flake. ```nix { 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"; - - # Required, nvf works best and only directly supports flakes nvf = { url = "github:notashelf/nvf"; - # 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. + # you can override input nixpkgs inputs.nixpkgs.follows = "nixpkgs"; - # Optionally, you can also override individual plugins + # you can also override individual plugins # for example: inputs.obsidian-nvim.follows = "obsidian-nvim"; # <- this will use the obsidian-nvim from your inputs }; @@ -48,12 +42,13 @@ Followed by importing the NixOS module somewhere in your configuration. nvf.url = "github:notashelf/nvf"; }; - outputs = { nixpkgs, nvf, ... }: { + outputs = { nixpkgs, nvf, ... }: let + system = "x86_64-linux"; in { # ↓ this is your host output in the flake schema - nixosConfigurations."your-hostname" = nixpkgs.lib.nixosSystem { + nixosConfigurations."yourUsername»" = nixpkgs.lib.nixosSystem { modules = [ nvf.nixosModules.default # <- this imports the NixOS module that provides the options - ./configuration.nix # <- your host entrypoint, `programs.nvf.*` may be defined here + ./configuration.nix # <- your host entrypoint ]; }; }; diff --git a/docs/manual/manual.md b/docs/manual/manual.md index fd225766..fd7ddcd9 100644 --- a/docs/manual/manual.md +++ b/docs/manual/manual.md @@ -11,7 +11,6 @@ try-it-out.md default-configs.md installation.md configuring.md -tips.md ``` ```{=include=} chapters diff --git a/docs/manual/tips.md b/docs/manual/tips.md deleted file mode 100644 index 0d2637f1..00000000 --- a/docs/manual/tips.md +++ /dev/null @@ -1,6 +0,0 @@ -# Helpful Tips {#ch-helpful-tips} - -```{=include=} chapters -tips/debugging-nvf.md -tips/offline-docs.md -``` diff --git a/docs/manual/tips/debugging-nvf.md b/docs/manual/tips/debugging-nvf.md deleted file mode 100644 index a642b0a7..00000000 --- a/docs/manual/tips/debugging-nvf.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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. diff --git a/docs/manual/tips/offline-docs.md b/docs/manual/tips/offline-docs.md deleted file mode 100644 index ed11d965..00000000 --- a/docs/manual/tips/offline-docs.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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. diff --git a/docs/release-notes/rl-0.7.md b/docs/release-notes/rl-0.7.md index 32186a8f..59267ddf 100644 --- a/docs/release-notes/rl-0.7.md +++ b/docs/release-notes/rl-0.7.md @@ -28,11 +28,11 @@ configuration formats. ### `vim.maps` rewrite {#sec-vim-maps-rewrite} -Instead of specifying map modes using submodules (e.g.: `vim.maps.normal`), a -new `vim.keymaps` submodule with support for a `mode` option has been -introduced. It can be either a string, or a list of strings, where a string -represents the short-name of the map mode(s), that the mapping should be set -for. See `:help map-modes` for more information. +Instead of specifying map modes using submodules (eg.: `vim.maps.normal`), a new +`vim.keymaps` submodule with support for a `mode` option has been introduced. It +can be either a string, or a list of strings, where a string represents the +short-name of the map mode(s), that the mapping should be set for. See +`:help map-modes` for more information. For example: diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index c65defeb..e41911ba 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -13,19 +13,6 @@ - Add [render-markdown.nvim] under `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): [haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim @@ -38,16 +25,3 @@ - Disable the built-in format-on-save feature of zls. Use `vim.lsp.formatOnSave` 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. diff --git a/flake.lock b/flake.lock index da38b967..0a7ee1a5 100644 --- a/flake.lock +++ b/flake.lock @@ -51,6 +51,27 @@ "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": { "inputs": { "flake-utils": [ @@ -103,6 +124,22 @@ "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": { "flake": false, "locked": { @@ -119,22 +156,6 @@ "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": { "flake": false, "locked": { @@ -1481,22 +1502,6 @@ "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": { "flake": false, "locked": { @@ -1673,22 +1678,6 @@ "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": { "flake": false, "locked": { @@ -2073,6 +2062,26 @@ "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": { "inputs": { "flake-parts": "flake-parts", @@ -2081,7 +2090,6 @@ "nil": "nil", "nixpkgs": "nixpkgs", "nmd": "nmd", - "plugin-aerial-nvim": "plugin-aerial-nvim", "plugin-alpha-nvim": "plugin-alpha-nvim", "plugin-base16": "plugin-base16", "plugin-bufdelete-nvim": "plugin-bufdelete-nvim", @@ -2166,7 +2174,6 @@ "plugin-nvim-tree-lua": "plugin-nvim-tree-lua", "plugin-nvim-treesitter-context": "plugin-nvim-treesitter-context", "plugin-nvim-ts-autotag": "plugin-nvim-ts-autotag", - "plugin-nvim-ufo": "plugin-nvim-ufo", "plugin-nvim-web-devicons": "plugin-nvim-web-devicons", "plugin-obsidian-nvim": "plugin-obsidian-nvim", "plugin-omnisharp-extended": "plugin-omnisharp-extended", @@ -2178,7 +2185,6 @@ "plugin-plenary-nvim": "plugin-plenary-nvim", "plugin-precognition-nvim": "plugin-precognition-nvim", "plugin-project-nvim": "plugin-project-nvim", - "plugin-promise-async": "plugin-promise-async", "plugin-registers": "plugin-registers", "plugin-render-markdown-nvim": "plugin-render-markdown-nvim", "plugin-rose-pine": "plugin-rose-pine", @@ -2203,6 +2209,7 @@ "plugin-vim-repeat": "plugin-vim-repeat", "plugin-vim-startify": "plugin-vim-startify", "plugin-which-key": "plugin-which-key", + "rnix-lsp": "rnix-lsp", "systems": "systems_2" } }, @@ -2256,6 +2263,21 @@ "repo": "default", "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", diff --git a/flake.nix b/flake.nix index 89690cad..d5a7b709 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,7 @@ }; # Language servers (use master instead of nixpkgs) + rnix-lsp.url = "github:nix-community/rnix-lsp"; nil = { url = "github:oxalica/nil"; inputs.nixpkgs.follows = "nixpkgs"; @@ -719,16 +720,6 @@ 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 = { # (required by new-file-template.nvim) url = "github:otavioschwanck/new-file-template.nvim"; @@ -739,10 +730,5 @@ url = "github:mrcjkb/haskell-tools.nvim"; flake = false; }; - - plugin-aerial-nvim = { - url = "github:stevearc/aerial.nvim"; - flake = false; - }; }; } diff --git a/flake/legacyPackages.nix b/flake/legacyPackages.nix index b77d057a..389ca0ce 100644 --- a/flake/legacyPackages.nix +++ b/flake/legacyPackages.nix @@ -8,10 +8,8 @@ inherit system; overlays = [ inputs.self.overlays.default - (_: _: { - # Build nil from source to get most recent - # features as they are added. + rnix-lsp = inputs'.rnix-lsp.defaultPackage; nil = inputs'.nil.packages.default; }) ]; diff --git a/lib/languages.nix b/lib/languages.nix index 56c225d6..52f1b5b8 100644 --- a/lib/languages.nix +++ b/lib/languages.nix @@ -6,12 +6,7 @@ inherit (lib.nvim.attrsets) mapListToAttrs; in { # Converts a boolean to a yes/no string. This is used in lots of - # configuration formats, and is not covered by `toLuaObject` - toVimBool = bool: - if bool - then "yes" - else "no"; - + # configuration formats. diagnosticsToLua = { lang, config, @@ -35,8 +30,8 @@ in { mkEnable = desc: mkOption { - default = false; - type = bool; description = "Turn on ${desc} for enabled languages by default"; + type = bool; + default = false; }; } diff --git a/modules/extra/deprecations.nix b/modules/extra/deprecations.nix index 8d27d7ac..e4cb193f 100644 --- a/modules/extra/deprecations.nix +++ b/modules/extra/deprecations.nix @@ -14,7 +14,6 @@ splitRight = "splitright"; autoIndent = "autoindent"; wordWrap = "wrap"; - showSignColumn = "signcolumn"; }; in { imports = concatLists [ @@ -36,28 +35,23 @@ in { vim.autopairs.enable has been removed in favor of per-plugin modules. You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. '') - (mkRemovedOptionModule ["vim" "autopairs" "type"] '' vim.autopairs.type has been removed in favor of per-plugin modules. You can enable nvim-autopairs with vim.autopairs.nvim-autopairs.enable instead. '') - (mkRemovedOptionModule ["vim" "autocomplete" "enable"] '' vim.autocomplete.enable has been removed in favor of per-plugin modules. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. '') - (mkRemovedOptionModule ["vim" "autocomplete" "type"] '' vim.autocomplete.type has been removed in favor of per-plugin modules. You can enable nvim-cmp with vim.autocomplete.nvim-cmp.enable instead. '') - (mkRemovedOptionModule ["vim" "autocomplete" "sources"] '' vim.autocomplete.sources has been removed in favor of per-plugin modules. You can add nvim-cmp sources with vim.autocomplete.nvim-cmp.sources instead. '') - (mkRemovedOptionModule ["vim" "snippets" "vsnip" "enable"] '' vim.snippets.vsnip.enable has been removed in favor of the more modern luasnip. '') @@ -90,12 +84,9 @@ in { `tabstop` and `shiftwidth` manually in `vim.options` or per-filetype in a `ftplugin` directory added to your runtime path. '') - - # 2024-12-02 - (mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"]) ] - # 2024-12-01 + # 2024-12-1 # Migrated via batchRenameOptions. Further batch renames must be below this line. renamedVimOpts ]; diff --git a/modules/neovim/init/basic.nix b/modules/neovim/init/basic.nix index 532ebcea..9370fa8f 100644 --- a/modules/neovim/init/basic.nix +++ b/modules/neovim/init/basic.nix @@ -5,7 +5,6 @@ }: let inherit (lib.options) mkOption mkEnableOption literalMD; inherit (lib.strings) optionalString; - inherit (lib.attrsets) optionalAttrs; inherit (lib.types) enum bool str int either; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.dag) entryAfter; @@ -59,12 +58,24 @@ in { description = "Prevent swapfile and backupfile from being created"; }; + showSignColumn = mkOption { + type = bool; + default = true; + description = "Show the sign column"; + }; + bell = mkOption { type = enum ["none" "visual" "on"]; default = "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 { type = enum ["ignore" "smart" "sensitive"]; default = "sensitive"; @@ -95,55 +106,63 @@ in { # 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 # luaConfigRC section below. - options = pushDownDefault (lib.mergeAttrsList [ - { - # Options that are always set, with a lower priority - encoding = "utf-8"; - hidden = true; - expandtab = true; + options = pushDownDefault { + encoding = "utf-8"; + hidden = true; + expandtab = true; + }; - # Junkfile Behaviour - swapfile = !cfg.preventJunkFiles; - backup = !cfg.preventJunkFiles; - writebackup = !cfg.preventJunkFiles; - } + globals = pushDownDefault { + editorconfig = cfg.enableEditorconfig; + }; - (optionalAttrs cfg.undoFile.enable { - 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. + # Options that are more difficult to set through 'vim.options'. Fear not, though + # as the Lua DAG is still as powerful as it could be. 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 '' vim.opt.clipboard:append("unnamedplus") ''} diff --git a/modules/neovim/init/spellcheck.nix b/modules/neovim/init/spellcheck.nix index f8d784da..5d6f5bed 100644 --- a/modules/neovim/init/spellcheck.nix +++ b/modules/neovim/init/spellcheck.nix @@ -124,6 +124,7 @@ in { nvim --headless --clean \ --cmd "mkspell $out/spell/$name.add.spl $spellfile" -Es -n done + ''; in mkIf (cfg.extraSpellWords != {}) [ @@ -132,12 +133,10 @@ in { compileJoinedSpellfiles.outPath ]; - options = { - spell = true; - spelllang = cfg.languages; - }; - luaConfigRC.spellcheck = entryAfter ["basic"] '' + vim.opt.spell = true + vim.opt.spelllang = ${listToLuaTable cfg.languages} + -- Disable spellchecking for certain filetypes -- as configured by `vim.spellcheck.ignoredFiletypes` vim.api.nvim_create_augroup("nvf_autocmds", {clear = false}) diff --git a/modules/plugins/filetree/nvimtree/config.nix b/modules/plugins/filetree/nvimtree/config.nix index 0d0381a0..11fa9fed 100644 --- a/modules/plugins/filetree/nvimtree/config.nix +++ b/modules/plugins/filetree/nvimtree/config.nix @@ -1,7 +1,7 @@ { - options, config, lib, + pkgs, ... }: let inherit (lib.strings) optionalString; @@ -11,7 +11,8 @@ inherit (lib.nvim.binds) pushDownDefault; cfg = config.vim.filetree.nvimTree; - inherit (options.vim.filetree.nvimTree) mappings; + self = import ./nvimtree.nix {inherit pkgs lib;}; + inherit (self.options.vim.filetree.nvimTree) mappings; in { config = mkIf cfg.enable { vim = { diff --git a/modules/plugins/git/gitsigns/config.nix b/modules/plugins/git/gitsigns/config.nix index 9aee73b7..039ab635 100644 --- a/modules/plugins/git/gitsigns/config.nix +++ b/modules/plugins/git/gitsigns/config.nix @@ -7,7 +7,6 @@ inherit (lib.modules) mkIf mkMerge; inherit (lib.nvim.binds) addDescriptionsToMappings mkSetExprBinding mkSetLuaBinding pushDownDefault; inherit (lib.nvim.dag) entryAnywhere; - inherit (lib.nvim.lua) toLuaObject; cfg = config.vim.git.gitsigns; @@ -71,7 +70,7 @@ in { }; pluginRC.gitsigns = entryAnywhere '' - require('gitsigns').setup(${toLuaObject cfg.setupOpts}) + require('gitsigns').setup{} ''; }; } diff --git a/modules/plugins/git/gitsigns/gitsigns.nix b/modules/plugins/git/gitsigns/gitsigns.nix index 9c2375d8..ef880bce 100644 --- a/modules/plugins/git/gitsigns/gitsigns.nix +++ b/modules/plugins/git/gitsigns/gitsigns.nix @@ -6,7 +6,6 @@ inherit (lib.options) mkEnableOption; inherit (lib.modules) mkRenamedOptionModule; inherit (lib.nvim.binds) mkMappingOption; - inherit (lib.nvim.types) mkPluginSetupOption; in { imports = [ (mkRenamedOptionModule ["vim" "git" "gitsigns" "codeActions" "vim" "gitsigns" "codeActions"] ["vim" "git" "gitsigns" "codeActions" "enable"]) @@ -14,7 +13,6 @@ in { options.vim.git.gitsigns = { enable = mkEnableOption "gitsigns" // {default = config.vim.git.enable;}; - setupOpts = mkPluginSetupOption "gitsigns" {}; codeActions.enable = mkEnableOption "gitsigns codeactions through null-ls"; diff --git a/modules/plugins/languages/dart.nix b/modules/plugins/languages/dart.nix index e2b3182e..ee069a7d 100644 --- a/modules/plugins/languages/dart.nix +++ b/modules/plugins/languages/dart.nix @@ -130,6 +130,7 @@ in { (mkIf cfg.lsp.enable { vim.lsp.lspconfig.enable = true; + vim.lsp.lspconfig.sources.dart-lsp = servers.${cfg.lsp.server}.lspConfig; }) diff --git a/modules/plugins/languages/haskell.nix b/modules/plugins/languages/haskell.nix index ff6c7d78..62f4cd41 100644 --- a/modules/plugins/languages/haskell.nix +++ b/modules/plugins/languages/haskell.nix @@ -71,7 +71,7 @@ in { cmd = ${ if isList cfg.lsp.package then expToLua cfg.lsp.package - else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper", "--lsp"}'' + else ''{"${cfg.lsp.package}/bin/haskell-language-server-wrapper"}'' }, on_attach = function(client, bufnr, ht) default_on_attach(client, bufnr, ht) diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index 1120633c..ffb69e92 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -26,6 +26,22 @@ then expToLua package else ''{"${package}/bin/${defaultCmd}"}''; 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 = { package = pkgs.nil; internalFormatter = true; @@ -149,7 +165,6 @@ in { type = enum (attrNames formats); default = defaultFormat; }; - package = mkOption { description = "Nix formatter package"; type = package; @@ -173,18 +188,7 @@ in { assertions = [ { assertion = cfg.format.type != "nixpkgs-fmt"; - 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)} - ''; + message = "nixpkgs-fmt has been archived upstream. Please use one of the following instead: ${concatStringsSep ", " (attrNames formats)}"; } ]; vim.pluginRC.nix = '' diff --git a/modules/plugins/notes/obsidian/obsidian.nix b/modules/plugins/notes/obsidian/obsidian.nix index 2da2127b..2dae5a9c 100644 --- a/modules/plugins/notes/obsidian/obsidian.nix +++ b/modules/plugins/notes/obsidian/obsidian.nix @@ -24,6 +24,12 @@ in { enable = mkEnableOption "complementary neovim plugins for Obsidian editor"; setupOpts = mkPluginSetupOption "Obsidian.nvim" { + dir = mkOption { + type = str; + default = "~/my-vault"; + description = "Obsidian vault directory"; + }; + daily_notes = { folder = mkOption { type = nullOr str; diff --git a/modules/plugins/ui/default.nix b/modules/plugins/ui/default.nix index e9489e9b..34076600 100644 --- a/modules/plugins/ui/default.nix +++ b/modules/plugins/ui/default.nix @@ -2,7 +2,6 @@ imports = [ ./noice ./modes - ./nvim-ufo ./notifications ./smartcolumn ./colorizer diff --git a/modules/plugins/ui/nvim-ufo/config.nix b/modules/plugins/ui/nvim-ufo/config.nix deleted file mode 100644 index 7b40386f..00000000 --- a/modules/plugins/ui/nvim-ufo/config.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - 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; - }; - }; - }; -} diff --git a/modules/plugins/ui/nvim-ufo/default.nix b/modules/plugins/ui/nvim-ufo/default.nix deleted file mode 100644 index 9f541f97..00000000 --- a/modules/plugins/ui/nvim-ufo/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./nvim-ufo.nix - ./config.nix - ]; -} diff --git a/modules/plugins/ui/nvim-ufo/nvim-ufo.nix b/modules/plugins/ui/nvim-ufo/nvim-ufo.nix deleted file mode 100644 index d5ad4933..00000000 --- a/modules/plugins/ui/nvim-ufo/nvim-ufo.nix +++ /dev/null @@ -1,9 +0,0 @@ -{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" {}; - }; -} diff --git a/modules/plugins/utility/default.nix b/modules/plugins/utility/default.nix index 686295e2..835ebf6e 100644 --- a/modules/plugins/utility/default.nix +++ b/modules/plugins/utility/default.nix @@ -1,6 +1,5 @@ { imports = [ - ./outline ./binds ./ccc ./gestures diff --git a/modules/plugins/utility/gestures/gesture-nvim/config.nix b/modules/plugins/utility/gestures/gesture-nvim/config.nix index 9838c178..2996f7d2 100644 --- a/modules/plugins/utility/gestures/gesture-nvim/config.nix +++ b/modules/plugins/utility/gestures/gesture-nvim/config.nix @@ -15,47 +15,43 @@ mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; in { config = mkIf cfg.enable { - vim = { - startPlugins = ["gesture-nvim"]; + vim.startPlugins = ["gesture-nvim"]; - maps.normal = mkMerge [ - (mkSetLuaBinding mappings.draw "require('gesture').draw") - (mkSetLuaBinding mappings.finish "require('gesture').finish") - (mkIf (mappings.draw.value == "") { - "" = {action = "";}; - }) - ]; + vim.maps.normal = mkMerge [ + (mkSetLuaBinding mappings.draw "require('gesture').draw") + (mkSetLuaBinding mappings.finish "require('gesture').finish") + (mkIf (mappings.draw.value == "") { + "" = {action = "";}; + }) + ]; - options.mouse = "a"; - pluginRC.gesture-nvim = entryAnywhere '' - local gesture = require("gesture") - gesture.register({ - name = "scroll to bottom", - inputs = { gesture.up(), gesture.down() }, - action = "normal! G", - }) + vim.pluginRC.gesture-nvim = entryAnywhere '' + vim.opt.mouse = "a" - gesture.register({ - name = "next tab", - inputs = { gesture.right() }, - action = "tabnext", - }) - - gesture.register({ - name = "previous tab", - inputs = { gesture.left() }, - action = function(ctx) -- also can use callable - vim.cmd.tabprevious() - end, - }) - - gesture.register({ - name = "go back", - inputs = { gesture.right(), gesture.left() }, - -- map to `` keycode - action = [[lua vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true)]], - }) - ''; - }; + local gesture = require("gesture") + gesture.register({ + name = "scroll to bottom", + inputs = { gesture.up(), gesture.down() }, + action = "normal! G", + }) + gesture.register({ + name = "next tab", + inputs = { gesture.right() }, + action = "tabnext", + }) + gesture.register({ + name = "previous tab", + inputs = { gesture.left() }, + action = function(ctx) -- also can use callable + vim.cmd.tabprevious() + end, + }) + gesture.register({ + name = "go back", + inputs = { gesture.right(), gesture.left() }, + -- map to `` keycode + action = [[lua vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true)]], + }) + ''; }; } diff --git a/modules/plugins/utility/gestures/gesture-nvim/default.nix b/modules/plugins/utility/gestures/gesture-nvim/default.nix index 4c7987e7..27e7e09f 100644 --- a/modules/plugins/utility/gestures/gesture-nvim/default.nix +++ b/modules/plugins/utility/gestures/gesture-nvim/default.nix @@ -1,4 +1,4 @@ -{ +_: { imports = [ ./gesture-nvim.nix ./config.nix diff --git a/modules/plugins/utility/outline/aerial-nvim/aerial-nvim.nix b/modules/plugins/utility/outline/aerial-nvim/aerial-nvim.nix deleted file mode 100644 index beede428..00000000 --- a/modules/plugins/utility/outline/aerial-nvim/aerial-nvim.nix +++ /dev/null @@ -1,14 +0,0 @@ -{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"; - }; - }; -} diff --git a/modules/plugins/utility/outline/aerial-nvim/config.nix b/modules/plugins/utility/outline/aerial-nvim/config.nix deleted file mode 100644 index 803302f7..00000000 --- a/modules/plugins/utility/outline/aerial-nvim/config.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - 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" {desc = mappings.toggle.description;}) - ]; - }; - }; - }; -} diff --git a/modules/plugins/utility/outline/aerial-nvim/default.nix b/modules/plugins/utility/outline/aerial-nvim/default.nix deleted file mode 100644 index ea782c89..00000000 --- a/modules/plugins/utility/outline/aerial-nvim/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./aerial-nvim.nix - ./config.nix - ]; -} diff --git a/modules/plugins/utility/outline/default.nix b/modules/plugins/utility/outline/default.nix deleted file mode 100644 index d8262edd..00000000 --- a/modules/plugins/utility/outline/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./aerial-nvim - ]; -} diff --git a/modules/plugins/utility/telescope/config.nix b/modules/plugins/utility/telescope/config.nix index 95f81327..76cfa8bd 100644 --- a/modules/plugins/utility/telescope/config.nix +++ b/modules/plugins/utility/telescope/config.nix @@ -22,12 +22,6 @@ in { package = "telescope"; setupModule = "telescope"; inherit (cfg) setupOpts; - - # HACK: workaround until https://github.com/NotAShelf/nvf/issues/535 gets resolved - before = '' - vim.g.loaded_telescope = nil - ''; - after = '' local telescope = require("telescope") ${optionalString config.vim.ui.noice.enable "telescope.load_extension('noice')"} diff --git a/modules/plugins/utility/wakatime/config.nix b/modules/plugins/utility/wakatime/config.nix index 675f0034..a1892e7b 100644 --- a/modules/plugins/utility/wakatime/config.nix +++ b/modules/plugins/utility/wakatime/config.nix @@ -1,22 +1,18 @@ { config, - pkgs, lib, + pkgs, ... }: let inherit (lib.modules) mkIf; - inherit (lib.meta) getExe; cfg = config.vim.utility.vim-wakatime; in { config = mkIf cfg.enable { - vim = { - startPlugins = [pkgs.vimPlugins.vim-wakatime]; + vim.startPlugins = [pkgs.vimPlugins.vim-wakatime]; - # Wakatime configuration is stored as vim globals. - globals = { - "wakatime_CLIPath" = mkIf (cfg.cli-package != null) "${getExe cfg.cli-package}"; - }; - }; + vim.pluginRC.vim-wakatime = mkIf (cfg.cli-package != null) '' + vim.g.wakatime_CLIPath = "${cfg.cli-package}" + ''; }; } diff --git a/modules/plugins/utility/wakatime/default.nix b/modules/plugins/utility/wakatime/default.nix index c72189d5..d6d67d57 100644 --- a/modules/plugins/utility/wakatime/default.nix +++ b/modules/plugins/utility/wakatime/default.nix @@ -1,4 +1,4 @@ -{ +_: { imports = [ ./config.nix ./vim-wakatime.nix diff --git a/modules/plugins/utility/wakatime/vim-wakatime.nix b/modules/plugins/utility/wakatime/vim-wakatime.nix index 04f27868..6b853821 100644 --- a/modules/plugins/utility/wakatime/vim-wakatime.nix +++ b/modules/plugins/utility/wakatime/vim-wakatime.nix @@ -1,24 +1,18 @@ { - pkgs, lib, + pkgs, ... }: let inherit (lib.options) mkEnableOption mkOption; inherit (lib.types) nullOr package; in { options.vim.utility.vim-wakatime = { - enable = mkEnableOption '' - automatic time tracking and metrics generated from your programming activity [vim-wakatime] - ''; + enable = mkEnableOption "vim-wakatime: live code statistics"; cli-package = mkOption { type = nullOr package; - default = pkgs.wakatime-cli; - 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` - ''; + default = pkgs.wakatime; + description = "The package that should be used for wakatime-cli. Set as null to use the default path in `$XDG_DATA_HOME`"; }; }; } diff --git a/modules/wrapper/build/config.nix b/modules/wrapper/build/config.nix index 46d99b36..ee5b4fda 100644 --- a/modules/wrapper/build/config.nix +++ b/modules/wrapper/build/config.nix @@ -49,17 +49,6 @@ flutter-tools-patched = buildPlug { pname = "flutter-tools"; 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" - ]; }; }; diff --git a/modules/wrapper/rc/options.nix b/modules/wrapper/rc/options.nix index 36296f02..df3831ec 100644 --- a/modules/wrapper/rc/options.nix +++ b/modules/wrapper/rc/options.nix @@ -3,11 +3,9 @@ lib, ... }: let - inherit (lib.options) mkOption literalMD literalExpression; + inherit (lib.options) mkOption mkEnableOption literalMD literalExpression; inherit (lib.strings) optionalString; 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.lua) listToLuaTable; @@ -19,7 +17,7 @@ in { default = false; example = true; description = '' - [official documentation]: https://neovim.io/doc/user/lua.html#vim.loader.enable() + [{option}`official documentation`]: https://neovim.io/doc/user/lua.html#vim.loader.enable() the experimental Lua module loader to speed up the start up process @@ -31,7 +29,7 @@ in { ::: {.note} 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. ::: ''; @@ -83,7 +81,7 @@ in { ./nvim/my-lua-file.lua # source type path - pure and reproducible - (builtins.path { + (builtins.source { path = ./nvim/my-lua-file.lua; name = "my-lua-file"; }) @@ -123,21 +121,6 @@ in { default = ","; description = "The key used for `` 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. - ''; - }; }; }; @@ -167,25 +150,16 @@ in { }; mouse = mkOption { - type = str; - default = "nvi"; - example = "a"; + type = enum ["a" "n" "v" "i" "c"]; + default = "a"; description = '' Set modes for mouse support. + * a - all * n - normal * v - visual * i - insert - * 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]. + * c - command ''; }; @@ -237,16 +211,6 @@ in { 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 { type = int; default = 8; # Neovim default @@ -299,11 +263,7 @@ in { vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths}) ''} - ${optionalString cfg.enableLuaLoader '' - if vim.loader then - vim.loader.enable() - end - ''} + ${optionalString cfg.enableLuaLoader "vim.loader.enable()"} ''; defaultText = literalMD '' @@ -313,7 +273,7 @@ in { 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 = '' Verbatim lua code that will be inserted **before**