vim: add plugin 'folke/trouble.nvim'

This commit is contained in:
Fernando Schauenburg 2023-08-06 02:48:14 +02:00
parent 3c738d7230
commit 9948e26145
2 changed files with 24 additions and 0 deletions

View file

@ -17,6 +17,11 @@ local config = function()
['<c-k>'] = actions.cycle_history_prev, ['<c-k>'] = actions.cycle_history_prev,
} }
local has_trouble, trouble = pcall(require, 'trouble.providers.telescope')
if has_trouble then
mappings['<c-b>'] = trouble.open_with_trouble
end
telescope.setup { telescope.setup {
defaults = { defaults = {
-- ╭────────╮ -- ╭────────╮

View file

@ -0,0 +1,19 @@
return {
'folke/trouble.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local trouble = require('trouble')
trouble.setup {
padding = false, -- don't add an extra new line of top of the list
auto_preview = false, -- don't preview automatically
}
vim.keymap.set('n', '<leader>xx', function() trouble.open() end)
vim.keymap.set('n', '<leader>xw', function() trouble.open('workspace_diagnostics') end)
vim.keymap.set('n', '<leader>xd', function() trouble.open('document_diagnostics') end)
end
}