neovim: add remaps for quickfix and location lists
This commit is contained in:
@@ -4,7 +4,10 @@ local git = require("daniil.git")
|
|||||||
|
|
||||||
-- General keymaps
|
-- General keymaps
|
||||||
vim.keymap.set("n", "<C-c>", ":nohl<CR>")
|
vim.keymap.set("n", "<C-c>", ":nohl<CR>")
|
||||||
vim.keymap.set("n", "<C-q>", "<C-W>q")
|
|
||||||
|
-- Quickfix and location list remaps
|
||||||
|
vim.keymap.set("n", "<C-q>", u.toggle_qflist)
|
||||||
|
vim.keymap.set("n", "<leader>q", u.toggle_locationlist)
|
||||||
|
|
||||||
-- Disable PageUp and PageDown keys
|
-- Disable PageUp and PageDown keys
|
||||||
vim.keymap.set({ "n", "i", "v" }, "<PageDown>", "<nop>")
|
vim.keymap.set({ "n", "i", "v" }, "<PageDown>", "<nop>")
|
||||||
|
|||||||
@@ -109,4 +109,20 @@ function M.open_unsaved_buffers()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.toggle_qflist()
|
||||||
|
if vim.bo.ft == "qf" then
|
||||||
|
vim.cmd(":cclose")
|
||||||
|
else
|
||||||
|
vim.cmd(":copen")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.toggle_locationlist()
|
||||||
|
if vim.bo.ft == "qf" then
|
||||||
|
vim.cmd(":lclose")
|
||||||
|
else
|
||||||
|
vim.cmd(":lopen")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
Reference in New Issue
Block a user