mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-14 07:05:57 +01:00
29 lines
719 B
Nix
29 lines
719 B
Nix
|
{
|
||
|
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 {}
|
||
|
'';
|
||
|
};
|
||
|
}
|