aboutsummaryrefslogtreecommitdiff
path: root/lua/user
diff options
context:
space:
mode:
Diffstat (limited to 'lua/user')
-rw-r--r--lua/user/keys.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/lua/user/keys.lua b/lua/user/keys.lua
index c957e05..f2ce98d 100644
--- a/lua/user/keys.lua
+++ b/lua/user/keys.lua
@@ -29,6 +29,16 @@ map("n", "<leader><CR>", "<cmd>luafile ~/.config/nvim/init.lua<CR> | :echom ('Nv
--------------- Extended Operations ---------------
+-- Use q to quit on floating windows otherwise still use it for macros
+map('n', 'q', function()
+ local config = vim.api.nvim_win_get_config(0)
+ if config.relative ~= "" then -- is_floating_window?
+ return ":close<CR>"
+ else
+ return "q"
+ end
+end, {expr = true, replace_keycodes = true})
+
-- Combine buffers list with buffer name
map("n", "<Leader>b", ":buffers<CR>:buffer<Space>")