mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-12 02:52:19 +00:00
chore(nvim): trouble.nvim related tweaks
This commit is contained in:
@@ -104,4 +104,8 @@ autocmd({ 'BufRead', 'BufNewFile' }, {
|
|||||||
command = 'set filetype=sshconfig',
|
command = 'set filetype=sshconfig',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
autocmd('QuickFixCmdPost', {
|
||||||
|
callback = function() vim.cmd [[Trouble qflist open]] end,
|
||||||
|
})
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -50,6 +50,37 @@ return {
|
|||||||
auto_fold = true,
|
auto_fold = true,
|
||||||
auto_close = true,
|
auto_close = true,
|
||||||
use_lsp_diagnostic_signs = true,
|
use_lsp_diagnostic_signs = true,
|
||||||
|
keys = {
|
||||||
|
j = 'next',
|
||||||
|
k = 'prev',
|
||||||
|
},
|
||||||
|
modes = {
|
||||||
|
diagnostics = {
|
||||||
|
auto_open = true,
|
||||||
|
},
|
||||||
|
test = {
|
||||||
|
mode = 'diagnostics',
|
||||||
|
preview = {
|
||||||
|
type = 'split',
|
||||||
|
relative = 'win',
|
||||||
|
position = 'right',
|
||||||
|
size = 0.3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cascade = {
|
||||||
|
mode = 'diagnostics', -- inherit from diagnostics mode
|
||||||
|
filter = function(items)
|
||||||
|
local severity = vim.diagnostic.severity.HINT
|
||||||
|
for _, item in ipairs(items) do
|
||||||
|
severity = math.min(severity, item.severity)
|
||||||
|
end
|
||||||
|
return vim.tbl_filter(
|
||||||
|
function(item) return item.severity == severity end,
|
||||||
|
items
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ return {
|
|||||||
local t = require 'telescope'
|
local t = require 'telescope'
|
||||||
local a = require 'telescope.actions'
|
local a = require 'telescope.actions'
|
||||||
|
|
||||||
|
local open_with_trouble = require('trouble.sources.telescope').open
|
||||||
|
local add_to_trouble = require('trouble.sources.telescope').add
|
||||||
|
|
||||||
-- [[ Configure Telescope ]]
|
-- [[ Configure Telescope ]]
|
||||||
-- See `:help telescope` and `:help telescope.setup()`
|
-- See `:help telescope` and `:help telescope.setup()`
|
||||||
t.setup {
|
t.setup {
|
||||||
@@ -52,6 +55,12 @@ return {
|
|||||||
['<C-j>'] = a.move_selection_next,
|
['<C-j>'] = a.move_selection_next,
|
||||||
['<C-k>'] = a.move_selection_previous,
|
['<C-k>'] = a.move_selection_previous,
|
||||||
['<C-d>'] = a.move_selection_previous,
|
['<C-d>'] = a.move_selection_previous,
|
||||||
|
['<C-t>'] = open_with_trouble,
|
||||||
|
['<C-q>'] = add_to_trouble,
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
['<C-t>'] = open_with_trouble,
|
||||||
|
['<C-q>'] = add_to_trouble,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user