Add trouble keymap

This commit is contained in:
Jan Eitzinger 2023-02-24 09:19:42 +01:00
parent e115f6e8d6
commit 91aa6f9c8a

View File

@ -65,7 +65,7 @@ require('nvim-surround').setup()
require('Comment').setup() require('Comment').setup()
require('dapui').setup() require('dapui').setup()
require('gitsigns').setup() require('gitsigns').setup()
require("trouble").setup() require("trouble").setup {}
require('nvim-autopairs').setup({ require('nvim-autopairs').setup({
fast_wrap = {}, fast_wrap = {},
}) })
@ -244,29 +244,35 @@ map('n','n', 'nzzzv')
map('n', 'N', 'Nzzzv') map('n', 'N', 'Nzzzv')
-- Same when jumping around -- Same when jumping around
map('n','g;', 'g;zz', { silent = true }) map('n', 'g;', 'g;zz')
-- replace ex mode map and use it for repeating 'q' macro -- replace ex mode map and use it for repeating 'q' macro
map('n','Q', '@q', { silent = true }) map('n', 'Q', '@q')
map('v','Q', '<cmd>norm @q<CR>', { silent = true }) map('v', 'Q', '<cmd>norm @q<CR>')
-- Shortcut to close quickfix windows -- Shortcut to close quickfix windows
map('n','<leader>a', '<cmd>windo lcl|ccl<CR>', { silent = true }) map('n', '<leader>a', '<cmd>windo lcl|ccl<CR>')
-- <Leader>q Closes the current buffer -- <Leader>q Closes the current buffer
map('n','<leader>q', '<cmd>bdelete<CR>', { silent = true }) map('n', '<leader>q', '<cmd>bdelete<CR>')
-- Easier in-file navigation with Tab and S-Tab -- Easier in-file navigation with Tab and S-Tab
map('n', '<S-Tab>', '<C-U>') map('n', '<S-Tab>', '<C-U>')
map('n', '<Tab>', '<C-D>') map('n', '<Tab>', '<C-D>')
-- Easy buffer navigation -- Easy buffer navigation
map('n','<C-h>', '<C-w>h', { silent = true }) map('n', '<C-h>', '<C-w>h')
map('n','<C-j>', '<C-w>j', { silent = true }) map('n', '<C-j>', '<C-w>j')
map('n','<C-k>', '<C-w>k', { silent = true }) map('n', '<C-k>', '<C-w>k')
map('n','<C-l>', '<C-w>l', { silent = true }) map('n', '<C-l>', '<C-w>l')
map('n','<up>', '<cmd>resize -2<CR>', { silent = true }) map('n', '<up>', '<cmd>resize -2<CR>')
map('n','<down>', '<cmd>resize +2<CR>', { silent = true }) map('n', '<down>', '<cmd>resize +2<CR>')
map('n','<left>', '<cmd>vertical resize -2<CR>', { silent = true }) map('n', '<left>', '<cmd>vertical resize -2<CR>')
map('n','<right>', '<cmd>vertical resize +2<CR>', { silent = true }) map('n', '<right>', '<cmd>vertical resize +2<CR>')
-- Trouble keymap
map('n', '<leader>xx', '<cmd>TroubleToggle<cr>', { noremap = true, silent = true })
map('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>', { noremap = true, silent = true })
map('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>', { noremap = true, silent = true })
map('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', { noremap = true, silent = true })