add remaps for local quickfix list

This commit is contained in:
2022-02-13 23:07:40 +03:00
parent 706c0a45ee
commit 3eb215544b
2 changed files with 15 additions and 0 deletions

View File

@@ -176,6 +176,16 @@ lsp_installer.on_server_ready(function(server)
server:setup(opts)
end)
-- Populate local quickfix list with diagnostics from lsp
-- Thanks to ThePrimeagen
-- https://www.youtube.com/watch?v=IoyW8XYGqjM
vim.cmd([[
augroup PopulateLocalListWithLsp
autocmd!
autocmd! BufWritePre,BufEnter,InsertLeave * :lua vim.diagnostic.setloclist({ open = false })
augroup END
]])
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
update_in_insert = false,
signs = false,

View File

@@ -29,6 +29,11 @@ vmap("J", ":m '>+1<CR>gv=gv") -- Shift+j - same as above mapping but the other w
vmap("<", "<gv")
vmap(">", ">gv")
-- Quickfix and local lists
nmap("lo", ":lopen<CR>") -- lo - open local quickfix list
nmap("ln", ":lnext<CR>") -- ln - go to next local quickfix entry
nmap("lp", ":lprev<CR>") -- lp - go to previous local quickfix entry
-- Terminal
tmap("<ESC>", "<C-\\><C-n>") -- Escape - in terminal mode, quit to normal mode
nmap("Th", ":lua require('user.utils').open_terminal()<CR>") -- Shift+t - open terminal in horizontal split