mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-15 00:58:37 +00:00
pins: point lspsaga to new source
Stop using the fork, the author is back.
This commit is contained in:
parent
12b47f9f08
commit
65a6ab23aa
3 changed files with 32 additions and 56 deletions
|
@ -2,11 +2,18 @@
|
||||||
|
|
||||||
## 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
|
||||||
|
@ -69,6 +76,8 @@
|
||||||
- Move LSPSaga to `setupOpts` format, allowing freeform configuration in
|
- Move LSPSaga to `setupOpts` format, allowing freeform configuration in
|
||||||
`vim.lsp.lspsaga.setupOpts`.
|
`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
|
||||||
|
|
|
@ -3,47 +3,24 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
|
||||||
|
|
||||||
cfg = config.vim.lsp;
|
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 {
|
in {
|
||||||
config = mkIf (cfg.enable && cfg.lspsaga.enable) {
|
config = mkIf (cfg.enable && cfg.lspsaga.enable) {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["lspsaga-nvim"];
|
lazy.plugins.lspsaga-nvim = {
|
||||||
|
package = "lspsaga-nvim";
|
||||||
|
setupModule = "lspsaga";
|
||||||
|
inherit (cfg.lspsaga) setupOpts;
|
||||||
|
|
||||||
pluginRC.lspsaga = entryAnywhere ''
|
event = ["LspAttach"];
|
||||||
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"))
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# 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,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
inherit (lib.modules) mkRemovedOptionModule;
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
|
||||||
inherit (lib.nvim.types) borderType mkPluginSetupOption;
|
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";
|
||||||
|
|
||||||
|
@ -17,26 +28,5 @@ in {
|
||||||
description = "Border type, see {command}`:help nvim_open_win`";
|
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";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue