mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-15 23:17:48 +00:00
Compare commits
3 commits
af26fb3c7d
...
e473a4ddb1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e473a4ddb1 |
||
|
|
a297acc368 |
||
|
93d375af64 |
7 changed files with 57 additions and 81 deletions
|
|
@ -2,11 +2,18 @@
|
|||
|
||||
## Breaking changes
|
||||
|
||||
[Lspsaga documentation]: https://nvimdev.github.io/lspsaga/
|
||||
|
||||
- `git-conflict` keybinds are now prefixed with `<leader>` to avoid conflicting
|
||||
with builtins.
|
||||
|
||||
- `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):
|
||||
|
||||
[typst-preview.nvim]: https://github.com/chomosuke/typst-preview.nvim
|
||||
|
|
@ -69,6 +76,8 @@
|
|||
- 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):
|
||||
|
||||
[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
|
||||
|
|
|
|||
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -38,11 +38,11 @@
|
|||
},
|
||||
"mnw": {
|
||||
"locked": {
|
||||
"lastModified": 1741647548,
|
||||
"narHash": "sha256-UqVAeOylufUGIx7BXSneFHD8eI6n0sVwEY2noFENnSE=",
|
||||
"lastModified": 1742255973,
|
||||
"narHash": "sha256-XfEGVKatTgEMMOVb4SNp1LYLQOSzzrFTDMVDTZFyMVE=",
|
||||
"owner": "Gerg-L",
|
||||
"repo": "mnw",
|
||||
"rev": "3fb89e600e26b91d1795cf8a1a34e11e084b4a04",
|
||||
"rev": "b982dbd5e6d55d4438832b3567c09bc2a129649d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -3,47 +3,24 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.modules) mkIf mkDefault;
|
||||
|
||||
cfg = config.vim.lsp;
|
||||
self = import ./lspsaga.nix {inherit config lib;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.lspsaga.mappings;
|
||||
mappings = addDescriptionsToMappings cfg.lspsaga.mappings mappingDefinitions;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lspsaga.enable) {
|
||||
vim = {
|
||||
startPlugins = ["lspsaga-nvim"];
|
||||
lazy.plugins.lspsaga-nvim = {
|
||||
package = "lspsaga-nvim";
|
||||
setupModule = "lspsaga";
|
||||
inherit (cfg.lspsaga) setupOpts;
|
||||
|
||||
pluginRC.lspsaga = entryAnywhere ''
|
||||
require('lspsaga').init_lsp_saga(${toLuaObject cfg.lspsaga.setupOpts})
|
||||
'';
|
||||
|
||||
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"))
|
||||
];
|
||||
event = ["LspAttach"];
|
||||
};
|
||||
|
||||
# Optional dependencies, pretty useful to enhance default functionality of
|
||||
# Lspsaga.
|
||||
treesitter.enable = mkDefault true;
|
||||
visuals.nvim-web-devicons.enable = mkDefault true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,21 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkRemovedOptionModule;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.nvim.types) borderType mkPluginSetupOption;
|
||||
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 = {
|
||||
enable = mkEnableOption "LSP Saga";
|
||||
|
||||
|
|
@ -17,26 +28,5 @@ in {
|
|||
description = "Border type, see {command}`:help nvim_open_win`";
|
||||
};
|
||||
};
|
||||
|
||||
mappings = {
|
||||
lspFinder = mkMappingOption "LSP Finder [LSPSaga]" "<leader>lf";
|
||||
renderHoveredDoc = mkMappingOption "Rendered hovered docs [LSPSaga]" "<leader>lh";
|
||||
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@
|
|||
cfg = config.vim.minimap.minimap-vim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
pkgs.code-minimap
|
||||
"minimap-vim"
|
||||
];
|
||||
vim = {
|
||||
startPlugins = ["minimap-vim"];
|
||||
extraPackages = [pkgs.code-minimap];
|
||||
|
||||
vim.binds.whichKey.register = pushDownDefault {
|
||||
"<leader>m" = "+Minimap";
|
||||
binds.whichKey.register = pushDownDefault {
|
||||
"<leader>m" = "+Minimap";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@
|
|||
...
|
||||
}: let
|
||||
inherit (pkgs) vimPlugins;
|
||||
inherit (lib.strings) isString;
|
||||
inherit (lib.lists) filter map;
|
||||
inherit (builtins) path;
|
||||
inherit (lib.trivial) flip;
|
||||
inherit (builtins) path filter isString;
|
||||
|
||||
getPin = name: ((pkgs.callPackages ../../../npins/sources.nix {}) // config.vim.pluginOverrides).${name};
|
||||
|
||||
|
|
@ -76,13 +75,6 @@
|
|||
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
|
||||
# generate a wrapped Neovim package.
|
||||
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
||||
|
|
@ -92,9 +84,17 @@
|
|||
extraBinPath = config.vim.extraPackages;
|
||||
initLua = config.vim.builtLuaConfigRC;
|
||||
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";
|
||||
|
||||
inherit (config.vim) viAlias vimAlias withRuby withNodeJs withPython3;
|
||||
inherit extraLuaPackages extraPython3Packages;
|
||||
extraLuaPackages = ps: map (flip builtins.getAttr ps) config.vim.luaPackages;
|
||||
};
|
||||
|
||||
dummyInit = pkgs.writeText "nvf-init.lua" config.vim.builtLuaConfigRC;
|
||||
|
|
|
|||
|
|
@ -717,13 +717,13 @@
|
|||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "tami5",
|
||||
"owner": "nvimdev",
|
||||
"repo": "lspsaga.nvim"
|
||||
},
|
||||
"branch": "main",
|
||||
"revision": "5faeec9f2508d2d49a66c0ac0d191096b4e3fa81",
|
||||
"url": "https://github.com/tami5/lspsaga.nvim/archive/5faeec9f2508d2d49a66c0ac0d191096b4e3fa81.tar.gz",
|
||||
"hash": "1bw71db69na2sriv9q167z9bgkir4nwny1bdfv9z606bmng4hhzc"
|
||||
"revision": "6063935cf68de9aa6dd79f8e1caf5df0a9385de3",
|
||||
"url": "https://github.com/nvimdev/lspsaga.nvim/archive/6063935cf68de9aa6dd79f8e1caf5df0a9385de3.tar.gz",
|
||||
"hash": "1pqasjg2f2yd3ci8hyxfqqs7xnkmwdc411dlm6qg1agiv1h8v205"
|
||||
},
|
||||
"lua-utils-nvim": {
|
||||
"type": "Git",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue