Skip to content

Commit

Permalink
Keymap: Add Actions for Trouble.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
MonaMayrhofer committed May 11, 2023
1 parent 413d61e commit c4b260b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions modules/lsp/trouble.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ 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>";
nvim-flake.keymapActions = with nvim.keymap; {
trouble = {
toggle = mkVimAction "<cmd>TroubleToggle<CR>";
workspaceDiagnostics = mkVimAction "<cmd>TroubleToggle workspace_diagnostics<CR>";
documentDiagnostics = mkVimAction "<cmd>TroubleToggle document_diagnostics<CR>";
lspReferences = mkVimAction "<cmd>TroubleToggle lsp_references<CR>";
quickfix = mkVimAction "<cmd>TroubleToggle quickfix<CR>";
loclist = mkVimAction "<cmd>TroubleToggle loclist<CR>";
};
};

vim.startPlugins = ["trouble"];

vim.luaConfigRC.trouble = nvim.dag.entryAnywhere ''
-- Enable trouble diagnostics viewer
require("trouble").setup {}
Expand Down

0 comments on commit c4b260b

Please sign in to comment.