aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/lua
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2024-10-17 19:40:13 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2024-10-17 19:40:13 -0400
commitae5cd50637f89945288c063f900cda437390cecb (patch)
treea4289e118d4f3732181d907aa7086d8319e68474 /nvim/lua
parent78ff89f682e7d7c1655931c621b7f24e6a8f2a47 (diff)
Change quickfix keybind to toggle instead of open
Diffstat (limited to 'nvim/lua')
-rw-r--r--nvim/lua/keymap.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/nvim/lua/keymap.lua b/nvim/lua/keymap.lua
index 017237a..a366613 100644
--- a/nvim/lua/keymap.lua
+++ b/nvim/lua/keymap.lua
@@ -20,7 +20,14 @@ local function send_to_qf(lines, line_nums)
end
vim.keymap.set('n', 'gf', function() cmd_pcall(':e <cfile>') end, { noremap = true })
-vim.keymap.set('n', "<Leader>q", function() vim.cmd('botright cope') end)
+vim.keymap.set('n', "<Leader>q", function()
+ if vim.o.ft == "qf" then
+ vim.cmd('ccl')
+ else
+ vim.cmd('botright cope')
+ end
+ end,
+ { noremap = true, desc = "Toggle bottom quickfix window" })
vim.keymap.set('n', "<Leader>l", function() cmd_pcall(':aboveleft lope') end)
vim.keymap.set('n', "<Leader>dk", function() vim.diagnostic.open_float() end)
vim.keymap.set('n', "[q", "<cmd>cprev<cr>", { noremap = true })
@@ -71,7 +78,7 @@ local function vert_shift_selection(amount)
-- shift lines
if amount < 0 then
- vim.cmd("'<,'>mo '<" .. amount-1)
+ vim.cmd("'<,'>mo '<" .. amount - 1)
elseif amount > 0 then
vim.cmd("'<,'>mo '>+" .. amount)
end