From f763d7b9946f95fe2308711e722072b71d0a645d Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Fri, 29 Oct 2021 14:59:39 -0700 Subject: [PATCH] add trouble --- .vim/nvim.lua | 26 ++++++++++++++++++++++++++ .vimrc | 3 +++ 2 files changed, 29 insertions(+) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index a248bb5..d1cdacb 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -147,6 +147,32 @@ require('lspkind').init({ }, }) +require('trouble').setup { + mode = "lsp_document_diagnostics", + auto_close = true, + action_keys = { -- key mappings for actions in the trouble list + -- map to {} to remove a mapping, for example: + -- close = {}, + --close = "q", -- close the list + --cancel = "", -- cancel the preview and get back to your last window / buffer / cursor + --refresh = "r", -- manually refresh + jump = {"o", ""}, -- jump to the diagnostic or open / close folds + --open_split = { "" }, -- open buffer in new split + --open_vsplit = { "" }, -- open buffer in new vsplit + open_tab = { }, -- open buffer in new tab + jump_close = {""}, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location + close_folds = {"zM", "zm"}, -- close all folds + open_folds = {"zR", "zr"}, -- open all folds + toggle_fold = {"zA", "za"}, -- toggle fold of current file + previous = "k", -- previous item + next = "j" -- next item + }, +} + require('telescope').setup { defaults = { mappings = { diff --git a/.vimrc b/.vimrc index ba939b2..06d1989 100644 --- a/.vimrc +++ b/.vimrc @@ -214,6 +214,7 @@ Plug 'ray-x/lsp_signature.nvim' Plug 'RishabhRD/popfix' Plug 'RishabhRD/nvim-lsputils' +Plug 'folke/trouble.nvim' " Plugins that do specific things "Plug 'Shougo/vimproc.vim' @@ -304,6 +305,8 @@ nnoremap ga lua require('telescope.builtin').lsp_code_actions({i vnoremap ga :lua require('telescope.builtin').lsp_range_code_actions({initial_mode = "normal"}) nnoremap ge lua vim.lsp.diagnostic.show_line_diagnostics({show_header = false, focusable = false}) +nnoremap xx TroubleToggle + " Set updatetime for CursorHold " 300ms of no cursor movement to trigger CursorHold set updatetime=500