From d8a56fc5f59fce2c470c059d9810ddeb107528ec Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 20 Mar 2025 14:39:53 +0300 Subject: [PATCH 001/150] meta: update CODEOWNERS with new maintainers --- .github/CODEOWNERS | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index de6ff5ef..2fb071ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1,5 @@ -* @NotAShelf +# Codeowners should be used to distinguish the maintainers of the project +# and not contributors of specific modules to nvf. While adding a new module +# please consider adding yourself to 'meta.maintainers' in the module instead +# of CODEOWNERS here. +* @NotAShelf @horriblename @Soliprem From ac59df1bc91b6e1f7f5c7847de73b2e4a8731557 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Mar 2025 08:43:04 +0300 Subject: [PATCH 002/150] treewide: remove `nmd` dependency --- docs/default.nix | 2 -- flake.lock | 17 ----------------- flake.nix | 6 ------ modules/plugins/statusline/lualine/lualine.nix | 2 -- 4 files changed, 27 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index 48cff563..98b29db0 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -95,8 +95,6 @@ inherit (nvimModuleDocs) optionsJSON; }; in { - inherit (inputs) nmd; - # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream # `nixosOptionsDoc` is more customizable. options.json = diff --git a/flake.lock b/flake.lock index 3ced812a..603d0f50 100644 --- a/flake.lock +++ b/flake.lock @@ -106,22 +106,6 @@ "type": "github" } }, - "nmd": { - "flake": false, - "locked": { - "lastModified": 1705050560, - "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", - "owner": "~rycee", - "repo": "nmd", - "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", - "type": "sourcehut" - }, - "original": { - "owner": "~rycee", - "repo": "nmd", - "type": "sourcehut" - } - }, "root": { "inputs": { "flake-parts": "flake-parts", @@ -129,7 +113,6 @@ "mnw": "mnw", "nil": "nil", "nixpkgs": "nixpkgs", - "nmd": "nmd", "systems": "systems_2" } }, diff --git a/flake.nix b/flake.nix index 30b71f80..6e716581 100644 --- a/flake.nix +++ b/flake.nix @@ -86,12 +86,6 @@ # Alternate neovim-wrapper mnw.url = "github:Gerg-L/mnw"; - # For generating documentation website - nmd = { - url = "sourcehut:~rycee/nmd"; - flake = false; - }; - # Language servers (use master instead of nixpkgs) nil = { url = "github:oxalica/nil"; diff --git a/modules/plugins/statusline/lualine/lualine.nix b/modules/plugins/statusline/lualine/lualine.nix index 9943f78e..bf070db7 100644 --- a/modules/plugins/statusline/lualine/lualine.nix +++ b/modules/plugins/statusline/lualine/lualine.nix @@ -124,8 +124,6 @@ in { mkOption { type = enum themesConcatted; default = "auto"; - # TODO: xml generation error if the closing '' is on a new line. - # issue: https://gitlab.com/rycee/nmd/-/issues/10 defaultText = ''`config.vim.theme.name` if theme supports lualine else "auto"''; description = "Theme for lualine"; }; From df1b3f796831d942b6e405355bdc5a3637429c0a Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Mar 2025 11:57:38 +0300 Subject: [PATCH 003/150] blink: v0.13.1 -> v0.14.1 --- flake/legacyPackages/blink-cmp.nix | 24 +++++------------------- npins/sources.json | 8 ++++---- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/flake/legacyPackages/blink-cmp.nix b/flake/legacyPackages/blink-cmp.nix index ba1d7424..477616aa 100644 --- a/flake/legacyPackages/blink-cmp.nix +++ b/flake/legacyPackages/blink-cmp.nix @@ -1,11 +1,11 @@ { + stdenv, rustPlatform, hostPlatform, vimUtils, git, src, version, - fetchpatch, }: let blink-fuzzy-lib = rustPlatform.buildRustPackage { pname = "blink-fuzzy-lib"; @@ -19,11 +19,6 @@ nativeBuildInputs = [git]; }; - - libExt = - if hostPlatform.isDarwin - then "dylib" - else "so"; in vimUtils.buildVimPlugin { pname = "blink-cmp"; @@ -31,22 +26,13 @@ in # blink references a repro.lua which is placed outside the lua/ directory doCheck = false; - preInstall = '' + preInstall = let + ext = stdenv.hostPlatform.extensions.sharedLibrary; + in '' mkdir -p target/release - ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt} - echo -n "nix" > target/release/version + ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext} ''; - # Borrowed from nixpkgs - # TODO: Remove this patch when updating to next version - patches = [ - (fetchpatch { - name = "blink-add-bypass-for-nix.patch"; - url = "https://github.com/Saghen/blink.cmp/commit/6c83ef1ae34abd7ef9a32bfcd9595ac77b61037c.diff?full_index=1"; - hash = "sha256-304F1gDDKVI1nXRvvQ0T1xBN+kHr3jdmwMMp8CNl+GU="; - }) - ]; - # Module for reproducing issues nvimSkipModule = ["repro"]; } diff --git a/npins/sources.json b/npins/sources.json index 91c3f68e..53cb810e 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -46,10 +46,10 @@ "pre_releases": false, "version_upper_bound": null, "release_prefix": null, - "version": "v0.13.1", - "revision": "29861baf37bbb16f5dbf524a6edac5daaad6f4fc", - "url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v0.13.1", - "hash": "1y5p7i6g884r65mhfsazx28g0qs37hc57jm37i7kch9kcf8m7sbq" + "version": "v0.14.1", + "revision": "7a91dc584f41f5aa2373a917faf8100b2e54d6c9", + "url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v0.14.1", + "hash": "0zm6s3v9liimx28vs1g5yi7bcfrl691q81bvzmdpavcwrzcdb0c8" }, "blink-cmp-spell": { "type": "Git", From 9074c734b7d515b23d80dee32105e332e3055d09 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 24 Mar 2025 21:09:47 +0300 Subject: [PATCH 004/150] docs: update co-maintainers section --- .github/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/README.md b/.github/README.md index 7c0974c3..a6ef7a44 100644 --- a/.github/README.md +++ b/.github/README.md @@ -246,14 +246,15 @@ Neovim's behaviour with Nix. ### Co-Maintainers -Alongside myself, nvf is developed by those talented folk: +Alongside [myself](https://github.com/notashelf), nvf is developed by those +talented folk. nvf would not be what it is today without their invaluable +contributions. - [**@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. +- [**@Soliprem**](https://github.com/soliprem) - For rigorously implementing + missing features and excellent work on new language modules. Please do remember to extend your thanks (financially or otherwise) if this project has been helpful to you. @@ -270,14 +271,14 @@ heart-felt thanks to - [**@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. + possible, great ideas and module additions. - [**@Yavko**](https://github.com/Yavko) - For the amazing **nvf** logo - [**@FrothyMarrow**](https://github.com/FrothyMarrow) - For seeing mistakes - that I could not. + that I could not and contributing good ideas & code. - [**@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. + [mnw], and occasional improvements to the codebase. +- [**@Diniamo**](https://github.com/Diniamo) - For actively submitting pull + requests, issues and assistance with co-maintenance of nvf. and everyone who has submitted issues or pull requests! @@ -301,7 +302,6 @@ including: I am grateful for their previous work and inspiration, and I wholeheartedly recommend checking their work out. -
## License From 9f8b7edbf6d2c842c361c863aba633f1d7a17d72 Mon Sep 17 00:00:00 2001 From: Marlon Rosenberg Date: Mon, 24 Mar 2025 22:25:01 +0100 Subject: [PATCH 005/150] languages/fsharp: init --- docs/manual/configuring/languages.md | 1 + docs/release-notes/rl-0.8.md | 4 + modules/plugins/languages/default.nix | 1 + modules/plugins/languages/fsharp.nix | 108 ++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 modules/plugins/languages/fsharp.nix diff --git a/docs/manual/configuring/languages.md b/docs/manual/configuring/languages.md index 74714365..252163fb 100644 --- a/docs/manual/configuring/languages.md +++ b/docs/manual/configuring/languages.md @@ -19,6 +19,7 @@ formatting to diagnostics. The following languages have sections under the - Go: [vim.languages.go.enable](#opt-vim.languages.go.enable) - Lua: [vim.languages.lua.enable](#opt-vim.languages.lua.enable) - PHP: [vim.languages.php.enable](#opt-vim.languages.php.enable) +- F#: [vim.languages.fsharp.enable](#opt-vim.languages.fsharp.enable) Adding support for more languages, and improving support for existing ones are great places where you can contribute with a PR. diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 5e09bb35..afb5ccd3 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -276,3 +276,7 @@ [rice-cracker-dev](https://github.com/rice-cracker-dev): - `eslint_d` now checks for configuration files to load. + +[Sc3l3t0n](https://github.com/Sc3l3t0n) + +- Add F# support under `vim.languages.fsharp`. diff --git a/modules/plugins/languages/default.nix b/modules/plugins/languages/default.nix index 20acfb6c..c3312135 100644 --- a/modules/plugins/languages/default.nix +++ b/modules/plugins/languages/default.nix @@ -10,6 +10,7 @@ in { ./clang.nix ./css.nix ./elixir.nix + ./fsharp.nix ./gleam.nix ./go.nix ./hcl.nix diff --git a/modules/plugins/languages/fsharp.nix b/modules/plugins/languages/fsharp.nix new file mode 100644 index 00000000..2b80bf11 --- /dev/null +++ b/modules/plugins/languages/fsharp.nix @@ -0,0 +1,108 @@ +{ + lib, + pkgs, + config, + ... +}: let + inherit (builtins) attrNames; + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.types) either listOf package str enum; + inherit (lib.modules) mkIf mkMerge; + inherit (lib.lists) isList; + inherit (lib.nvim.types) mkGrammarOption; + inherit (lib.nvim.lua) expToLua; + + defaultServer = "fsautocomplete"; + servers = { + fsautocomplete = { + package = pkgs.fsautocomplete; + internalFormatter = false; + lspConfig = '' + lspconfig.fsautocomplete.setup { + capabilities = capabilities; + on_attach = default_on_attach; + cmd = ${ + if isList cfg.lsp.package + then expToLua cfg.lsp.package + else "{'${cfg.lsp.package}/bin/fsautocomplete'}" + }, + } + ''; + }; + }; + + defaultFormat = "fantomas"; + formats = { + fantomas = { + package = pkgs.fantomas; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.fantomas.with({ + command = "${cfg.format.package}/bin/fantomas", + }) + ) + ''; + }; + }; + + cfg = config.vim.languages.fsharp; +in { + options = { + vim.languages.fsharp = { + enable = mkEnableOption "F# language support"; + + treesitter = { + enable = mkEnableOption "F# treesitter" // {default = config.vim.languages.enableTreesitter;}; + package = mkGrammarOption pkgs "fsharp"; + }; + + lsp = { + enable = mkEnableOption "F# LSP support" // {default = config.vim.languages.enableLSP;}; + server = mkOption { + description = "F# LSP server to use"; + type = enum (attrNames servers); + default = defaultServer; + }; + + package = mkOption { + description = "F# LSP server package, or the command to run as a list of strings"; + type = either package (listOf str); + default = servers.${cfg.lsp.server}.package; + }; + }; + format = { + enable = mkEnableOption "F# formatting" // {default = config.vim.languages.enableFormat;}; + + type = mkOption { + description = "F# formatter to use"; + type = enum (attrNames formats); + default = defaultFormat; + }; + + package = mkOption { + description = "F# formatter package"; + type = package; + default = formats.${cfg.format.type}.package; + }; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; + }) + + (mkIf cfg.lsp.enable { + vim.lsp.lspconfig.enable = true; + vim.lsp.lspconfig.sources.fsharp-lsp = servers.${cfg.lsp.server}.lspConfig; + }) + + (mkIf cfg.format.enable { + vim.lsp.null-ls.enable = true; + vim.lsp.null-ls.sources.fsharp-format = formats.${cfg.format.type}.nullConfig; + }) + ]); +} From 7835cbdc1da7785dca4cb1b2123157b7712109c8 Mon Sep 17 00:00:00 2001 From: Al Duncanson Date: Mon, 24 Mar 2025 19:04:23 -0400 Subject: [PATCH 006/150] docs: fix typo Add missing word in sentence: `let`. --- docs/manual/options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/manual/options.md b/docs/manual/options.md index 61282dfa..beab4f16 100644 --- a/docs/manual/options.md +++ b/docs/manual/options.md @@ -5,8 +5,8 @@ options will include useful comments, warnings or setup tips on how a module option is meant to be used as well as examples in complex cases. An offline version of this page is bundled with nvf as a part of the manpages -which you can access with `man 5 nvf`. Please us know if you believe any of the -options below are missing useful examples. +which you can access with `man 5 nvf`. Please let us know if you believe any of +the options below are missing useful examples.