mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
feat: apply new module format to lsp plugins
This commit is contained in:
parent
e09ccfd014
commit
067b523897
18 changed files with 175 additions and 31 deletions
28
modules/lsp/trouble/config.nix
Normal file
28
modules/lsp/trouble/config.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.trouble.enable) {
|
||||
vim.startPlugins = ["trouble"];
|
||||
|
||||
vim.nnoremap = {
|
||||
"<leader>xx" = "<cmd>TroubleToggle<CR>";
|
||||
"<leader>lwd" = "<cmd>TroubleToggle workspace_diagnostics<CR>";
|
||||
"<leader>ld" = "<cmd>TroubleToggle document_diagnostics<CR>";
|
||||
"<leader>lr" = "<cmd>TroubleToggle lsp_references<CR>";
|
||||
"<leader>xq" = "<cmd>TroubleToggle quickfix<CR>";
|
||||
"<leader>xl" = "<cmd>TroubleToggle loclist<CR>";
|
||||
};
|
||||
|
||||
vim.luaConfigRC.trouble = nvim.dag.entryAnywhere ''
|
||||
-- Enable trouble diagnostics viewer
|
||||
require("trouble").setup {}
|
||||
'';
|
||||
};
|
||||
}
|
6
modules/lsp/trouble/default.nix
Normal file
6
modules/lsp/trouble/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
_: {
|
||||
imports = [
|
||||
./trouble.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
16
modules/lsp/trouble/trouble.nix
Normal file
16
modules/lsp/trouble/trouble.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.lsp;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
trouble = {
|
||||
enable = mkEnableOption "trouble diagnostics viewer";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue