Compare commits

..

No commits in common. "e7d656d06bf0607e7243f40ff2201448915330e2" and "1d7c27abd97f4532acd9710dd2d7db439ddfe69a" have entirely different histories.

15 changed files with 111 additions and 178 deletions

View file

@ -67,7 +67,7 @@ of individual sections of configuration as needed. nvf provides helper functions
in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may in the extended library, usually under `inputs.nvf.lib.nvim.dag` that you may
use. use.
Please refer to the [DAG section](#ch-dag-entries) in the nvf manual Please refer to the [DAG section](/index.xhtml#ch-dag-entries) in the nvf manual
to find out more about the DAG system. to find out more about the DAG system.
::: :::

View file

@ -2,25 +2,17 @@
## Breaking changes ## Breaking changes
[Lspsaga documentation]: https://nvimdev.github.io/lspsaga/
- `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting - `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting
with builtins. with builtins.
- `alpha` is now configured with nix, default config removed. - `alpha` is now configured with nix, default config removed.
- Lspsaga module no longer ships default keybindings. The keybind format has
been changed by upstream, and old keybindings do not have equivalents under
the new API they provide. Please manually set your keybinds according to
[Lspsaga documentation] following the new API.
[NotAShelf](https://github.com/notashelf): [NotAShelf](https://github.com/notashelf):
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim [typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
[render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim [render-markdown.nvim]: https://github.com/MeanderingProgrammer/render-markdown.nvim
[yanky.nvim]: https://github.com/gbprod/yanky.nvim [yanky.nvim]: https://github.com/gbprod/yanky.nvim
[yazi.nvim]: https://github.com/mikavilpas/yazi.nvim [yazi.nvim]: https://github.com/mikavilpas/yazi.nvim
[snacks.nvim]: https://github.com/folke/snacks.nvim
- Add [typst-preview.nvim] under - Add [typst-preview.nvim] under
`languages.typst.extensions.typst-preview-nvim`. `languages.typst.extensions.typst-preview-nvim`.
@ -70,14 +62,6 @@
- Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager. - Add [yazi.nvim] as a companion plugin for Yazi, the terminal file manager.
- Add [snacks.nvim] under `vim.utility.snacks-nvim` as a general-purpose utility
plugin.
- Move LSPSaga to `setupOpts` format, allowing freeform configuration in
`vim.lsp.lspsaga.setupOpts`.
- Lazyload Lspsaga and remove default keybindings for it.
[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

6
flake.lock generated
View file

@ -38,11 +38,11 @@
}, },
"mnw": { "mnw": {
"locked": { "locked": {
"lastModified": 1742255973, "lastModified": 1741647548,
"narHash": "sha256-XfEGVKatTgEMMOVb4SNp1LYLQOSzzrFTDMVDTZFyMVE=", "narHash": "sha256-UqVAeOylufUGIx7BXSneFHD8eI6n0sVwEY2noFENnSE=",
"owner": "Gerg-L", "owner": "Gerg-L",
"repo": "mnw", "repo": "mnw",
"rev": "b982dbd5e6d55d4438832b3567c09bc2a129649d", "rev": "3fb89e600e26b91d1795cf8a1a34e11e084b4a04",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,6 +1,6 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkEnableOption mkOption literalMD; inherit (lib.options) mkEnableOption mkOption literalMD;
inherit (lib.types) bool listOf str either attrsOf submodule enum anything int nullOr; inherit (lib.types) listOf str either attrsOf submodule enum anything int nullOr;
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.types) mkPluginSetupOption luaInline pluginType; inherit (lib.nvim.types) mkPluginSetupOption luaInline pluginType;
inherit (lib.nvim.binds) mkMappingOption; inherit (lib.nvim.binds) mkMappingOption;
@ -64,12 +64,6 @@ in {
default = []; default = [];
description = "List of sources to enable for cmdline. Null means use default source list."; description = "List of sources to enable for cmdline. Null means use default source list.";
}; };
keymap = mkOption {
type = keymapType;
default = {};
description = "blink.cmp cmdline keymap";
};
}; };
completion = { completion = {
@ -81,16 +75,6 @@ in {
description = "Delay before auto show triggers"; description = "Delay before auto show triggers";
}; };
}; };
menu.auto_show = mkOption {
type = bool;
default = true;
description = ''
Manages the appearance of the completion menu. You may prevent the menu
from automatically showing by this option to `false` and manually showing
it with the show keymap command.
'';
};
}; };
keymap = mkOption { keymap = mkOption {
@ -120,25 +104,7 @@ in {
fuzzy = { fuzzy = {
prebuilt_binaries = { prebuilt_binaries = {
download = mkBool false '' download = mkBool false ''
Auto-downloads prebuilt binaries. Auto-downloads prebuilt binaries. Do not enable, it doesn't work on nix
::: .{warning}
Do not enable this option, as it does **not work** on Nix!
:::
'';
};
implementation = mkOption {
type = enum ["lua" "prefer_rust" "rust" "prefer_rust_with_warning"];
default = "prefer_rust";
description = ''
fuzzy matcher implementation for Blink.
* `"lua"`: slower, Lua native fuzzy matcher implementation
* `"rust": use the SIMD fuzzy matcher, 'frizbee'
* `"prefer_rust"`: use the rust implementation, but fall back to lua
* `"prefer_rust_with_warning"`: use the rust implementation, and fall back to lua
if it is not available after emitting a warning.
''; '';
}; };
}; };
@ -157,14 +123,12 @@ in {
sourcePlugins = let sourcePlugins = let
sourcePluginType = submodule { sourcePluginType = submodule {
options = { options = {
enable = mkEnableOption "this source";
package = mkOption { package = mkOption {
type = pluginType; type = pluginType;
description = '' description = ''
`blink-cmp` source plugin package. `blink-cmp` source plugin package.
''; '';
}; };
module = mkOption { module = mkOption {
type = str; type = str;
description = '' description = ''
@ -173,6 +137,7 @@ in {
Should be present in the source's documentation. Should be present in the source's documentation.
''; '';
}; };
enable = mkEnableOption "this source";
}; };
}; };
in in

View file

@ -13,7 +13,7 @@ in {
vim = { vim = {
startPlugins = ["nvim-lint"]; startPlugins = ["nvim-lint"];
pluginRC.nvim-lint = entryAnywhere '' pluginRC.nvim-lint = entryAnywhere ''
require("lint").linters_by_ft(${toLuaObject cfg.linters_by_ft}) require("lint").setup(${toLuaObject cfg.setupOpts})
''; '';
}; };
}; };

View file

@ -1,11 +1,11 @@
{lib, ...}: let {lib, ...}: let
inherit (lib.options) mkOption mkEnableOption; inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf listOf str; inherit (lib.types) attrsOf listOf str;
inherit (lib.nvim.types) mkPluginSetupOption;
in { in {
options.vim.diagnostics.nvim-lint = { options.vim.diagnostics.nvim-lint = {
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]"; enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
setupOpts = mkPluginSetupOption "nvim-lint" {
# nvim-lint does not have a setup table.
linters_by_ft = mkOption { linters_by_ft = mkOption {
type = attrsOf (listOf str); type = attrsOf (listOf str);
default = {}; default = {};
@ -13,13 +13,15 @@ in {
text = ["vale"]; text = ["vale"];
markdown = ["vale"]; markdown = ["vale"];
}; };
description = '' description = ''
Map of filetype to formatters. This option takes a set of `key = value` Map of filetype to formatters. This option takes a set of
format where the `value` will be converted to its Lua equivalent `key = value` format where the `value` will be converted
through `toLuaObject. You are responsible for passing the correct Nix to its Lua equivalent. You are responsible for passing the
data types to generate a correct Lua value that conform is able to correct Nix data types to generate a correct Lua value that
accept. conform is able to accept.
''; '';
}; };
}; };
};
} }

View file

@ -3,24 +3,51 @@
lib, lib,
... ...
}: let }: let
inherit (lib.modules) mkIf mkDefault; inherit (lib.modules) mkIf mkMerge;
inherit (lib.strings) optionalString;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
cfg = config.vim.lsp; cfg = config.vim.lsp;
self = import ./lspsaga.nix {inherit lib;};
mappingDefinitions = self.options.vim.lsp.lspsaga.mappings;
mappings = addDescriptionsToMappings cfg.lspsaga.mappings mappingDefinitions;
in { in {
config = mkIf (cfg.enable && cfg.lspsaga.enable) { config = mkIf (cfg.enable && cfg.lspsaga.enable) {
vim = { vim = {
lazy.plugins.lspsaga-nvim = { startPlugins = ["lspsaga-nvim"];
package = "lspsaga-nvim";
setupModule = "lspsaga";
inherit (cfg.lspsaga) setupOpts;
event = ["LspAttach"]; maps = {
visual = mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').range_code_action";
normal = mkMerge [
(mkSetLuaBinding mappings.lspFinder "require('lspsaga.provider').lsp_finder")
(mkSetLuaBinding mappings.renderHoveredDoc "require('lspsaga.hover').render_hover_doc")
(mkSetLuaBinding mappings.smartScrollUp "function() require('lspsaga.action').smart_scroll_with_saga(-1) end")
(mkSetLuaBinding mappings.smartScrollDown "function() require('lspsaga.action').smart_scroll_with_saga(1) end")
(mkSetLuaBinding mappings.rename "require('lspsaga.rename').rename")
(mkSetLuaBinding mappings.previewDefinition "require('lspsaga.provider').preview_definition")
(mkSetLuaBinding mappings.showLineDiagnostics "require('lspsaga.diagnostic').show_line_diagnostics")
(mkSetLuaBinding mappings.showCursorDiagnostics "require('lspsaga.diagnostic').show_cursor_diagnostics")
(mkSetLuaBinding mappings.nextDiagnostic "require('lspsaga.diagnostic').navigate('next')")
(mkSetLuaBinding mappings.previousDiagnostic "require('lspsaga.diagnostic').navigate('prev')")
(mkSetLuaBinding mappings.codeAction "require('lspsaga.codeaction').code_action")
(mkIf (!cfg.lspSignature.enable) (mkSetLuaBinding mappings.signatureHelp "require('lspsaga.signaturehelp').signature_help"))
];
}; };
# Optional dependencies, pretty useful to enhance default functionality of pluginRC.lspsaga = entryAnywhere ''
# Lspsaga. require('lspsaga').init_lsp_saga({
treesitter.enable = mkDefault true; ${optionalString config.vim.ui.borders.plugins.lspsaga.enable ''
visuals.nvim-web-devicons.enable = mkDefault true; border_style = '${config.vim.ui.borders.plugins.lspsaga.style}',
''}
})
'';
}; };
}; };
} }

View file

@ -1,32 +1,29 @@
{ {lib, ...}: let
config, inherit (lib.options) mkEnableOption;
lib, inherit (lib.nvim.binds) mkMappingOption;
...
}: let
inherit (lib.modules) mkRemovedOptionModule;
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.nvim.types) borderType mkPluginSetupOption;
in { in {
imports = [
(mkRemovedOptionModule ["vim" "lsp" "lspsaga" "mappings"] ''
Lspsaga mappings have been removed from nvf, as the original author has made
very drastic changes to the API after taking back ownership, and the fork we
used is now archived. Please refer to Lspsaga documentation to add keybinds
for functionality you have used.
<https://nvimdev.github.io/lspsaga>
'')
];
options.vim.lsp.lspsaga = { options.vim.lsp.lspsaga = {
enable = mkEnableOption "LSP Saga"; enable = mkEnableOption "LSP Saga";
setupOpts = mkPluginSetupOption "lspsaga" { mappings = {
border_style = mkOption { lspFinder = mkMappingOption "LSP Finder [LSPSaga]" "<leader>lf";
type = borderType; renderHoveredDoc = mkMappingOption "Rendered hovered docs [LSPSaga]" "<leader>lh";
default = config.vim.ui.borders.globalStyle;
description = "Border type, see {command}`:help nvim_open_win`"; smartScrollUp = mkMappingOption "Smart scroll up [LSPSaga]" "<C-f>";
}; smartScrollDown = mkMappingOption "Smart scroll up [LSPSaga]" "<C-b>";
rename = mkMappingOption "Rename [LSPSaga]" "<leader>lr";
previewDefinition = mkMappingOption "Preview definition [LSPSaga]" "<leader>ld";
showLineDiagnostics = mkMappingOption "Show line diagnostics [LSPSaga]" "<leader>ll";
showCursorDiagnostics = mkMappingOption "Show cursor diagnostics [LSPSaga]" "<leader>lc";
nextDiagnostic = mkMappingOption "Next diagnostic [LSPSaga]" "<leader>ln";
previousDiagnostic = mkMappingOption "Previous diagnostic [LSPSaga]" "<leader>lp";
codeAction = mkMappingOption "Code action [LSPSaga]" "<leader>ca";
signatureHelp = mkMappingOption "Signature help [LSPSaga]" "<leader>ls";
}; };
}; };
} }

View file

@ -10,13 +10,13 @@
cfg = config.vim.minimap.minimap-vim; cfg = config.vim.minimap.minimap-vim;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
vim = { vim.startPlugins = [
startPlugins = ["minimap-vim"]; pkgs.code-minimap
extraPackages = [pkgs.code-minimap]; "minimap-vim"
];
binds.whichKey.register = pushDownDefault { vim.binds.whichKey.register = pushDownDefault {
"<leader>m" = "+Minimap"; "<leader>m" = "+Minimap";
}; };
}; };
};
} }

View file

@ -17,7 +17,6 @@
./nix-develop ./nix-develop
./outline ./outline
./preview ./preview
./snacks-nvim
./surround ./surround
./telescope ./telescope
./wakatime ./wakatime

View file

@ -1,20 +0,0 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.dag) entryAnywhere;
cfg = config.vim.utility.snacks-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = ["snacks-nvim"];
pluginRC.snacks-nvim = entryAnywhere ''
require("snacks").setup(${toLuaObject cfg.setupOpts});
'';
};
};
}

View file

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

View file

@ -1,12 +0,0 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.utility.snacks-nvim = {
enable = mkEnableOption ''
collection of QoL plugins for Neovim [snacks-nvim]
'';
setupOpts = mkPluginSetupOption "snacks-nvim" {};
};
}

View file

@ -6,8 +6,9 @@
... ...
}: let }: let
inherit (pkgs) vimPlugins; inherit (pkgs) vimPlugins;
inherit (lib.trivial) flip; inherit (lib.strings) isString;
inherit (builtins) path filter isString; inherit (lib.lists) filter map;
inherit (builtins) path;
getPin = name: ((pkgs.callPackages ../../../npins/sources.nix {}) // config.vim.pluginOverrides).${name}; getPin = name: ((pkgs.callPackages ../../../npins/sources.nix {}) // config.vim.pluginOverrides).${name};
@ -75,6 +76,13 @@
buildConfigPlugins config.vim.optPlugins buildConfigPlugins config.vim.optPlugins
); );
# additional Lua and Python3 packages, mapped to their respective functions
# to conform to the format mnw expects. end user should
# only ever need to pass a list of packages, which are modified
# here
extraLuaPackages = ps: map (x: ps.${x}) config.vim.luaPackages;
extraPython3Packages = ps: map (x: ps.${x}) config.vim.python3Packages;
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to # Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
# generate a wrapped Neovim package. # generate a wrapped Neovim package.
neovim-wrapped = inputs.mnw.lib.wrap pkgs { neovim-wrapped = inputs.mnw.lib.wrap pkgs {
@ -84,17 +92,9 @@
extraBinPath = config.vim.extraPackages; extraBinPath = config.vim.extraPackages;
initLua = config.vim.builtLuaConfigRC; initLua = config.vim.builtLuaConfigRC;
luaFiles = config.vim.extraLuaFiles; luaFiles = config.vim.extraLuaFiles;
providers = {
python3 = {
enable = config.vim.withPython3;
extraPackages = ps: map (flip builtins.getAttr ps) config.vim.python3Packages;
};
ruby.enable = config.vim.withRuby;
nodeJs.enable = config.vim.withNodeJs;
};
aliases = lib.optional config.vim.viAlias "vi" ++ lib.optional config.vim.vimAlias "vim";
extraLuaPackages = ps: map (flip builtins.getAttr ps) config.vim.luaPackages; inherit (config.vim) viAlias vimAlias withRuby withNodeJs withPython3;
inherit extraLuaPackages extraPython3Packages;
}; };
dummyInit = pkgs.writeText "nvf-init.lua" config.vim.builtLuaConfigRC; dummyInit = pkgs.writeText "nvf-init.lua" config.vim.builtLuaConfigRC;

View file

@ -717,13 +717,13 @@
"type": "Git", "type": "Git",
"repository": { "repository": {
"type": "GitHub", "type": "GitHub",
"owner": "nvimdev", "owner": "tami5",
"repo": "lspsaga.nvim" "repo": "lspsaga.nvim"
}, },
"branch": "main", "branch": "main",
"revision": "6063935cf68de9aa6dd79f8e1caf5df0a9385de3", "revision": "5faeec9f2508d2d49a66c0ac0d191096b4e3fa81",
"url": "https://github.com/nvimdev/lspsaga.nvim/archive/6063935cf68de9aa6dd79f8e1caf5df0a9385de3.tar.gz", "url": "https://github.com/tami5/lspsaga.nvim/archive/5faeec9f2508d2d49a66c0ac0d191096b4e3fa81.tar.gz",
"hash": "1pqasjg2f2yd3ci8hyxfqqs7xnkmwdc411dlm6qg1agiv1h8v205" "hash": "1bw71db69na2sriv9q167z9bgkir4nwny1bdfv9z606bmng4hhzc"
}, },
"lua-utils-nvim": { "lua-utils-nvim": {
"type": "Git", "type": "Git",
@ -1989,19 +1989,16 @@
"hash": "0k1xnyvblshn4fhbxgl0i34j22n55xlwr09sdmb23l57br5rb07q" "hash": "0k1xnyvblshn4fhbxgl0i34j22n55xlwr09sdmb23l57br5rb07q"
}, },
"snacks-nvim": { "snacks-nvim": {
"type": "GitRelease", "type": "Git",
"repository": { "repository": {
"type": "GitHub", "type": "GitHub",
"owner": "folke", "owner": "folke",
"repo": "snacks.nvim" "repo": "snacks.nvim"
}, },
"pre_releases": false, "branch": "main",
"version_upper_bound": null, "revision": "bc0630e43be5699bb94dadc302c0d21615421d93",
"release_prefix": null, "url": "https://github.com/folke/snacks.nvim/archive/bc0630e43be5699bb94dadc302c0d21615421d93.tar.gz",
"version": "v2.22.0", "hash": "0a5nw7xa33shag1h12gf930g3vcixbwk8dxv0ji4980ycskh238v"
"revision": "5eac729fa290248acfe10916d92a5ed5e5c0f9ed",
"url": "https://api.github.com/repos/folke/snacks.nvim/tarball/v2.22.0",
"hash": "1hbm4fnw51qdp0nz83fcxbvnxjq2k57a37w6dp0wz6wkcx7cwxw9"
}, },
"sqls-nvim": { "sqls-nvim": {
"type": "Git", "type": "Git",