From ac9417c8f208182e92b8d628808e7516479dc48b Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Sat, 21 Dec 2024 23:56:24 +0100 Subject: [PATCH] add keymap to close buffer with q --- lua/telescope/_extensions/telescope_knot.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/telescope/_extensions/telescope_knot.lua b/lua/telescope/_extensions/telescope_knot.lua index 8164187..e61f133 100644 --- a/lua/telescope/_extensions/telescope_knot.lua +++ b/lua/telescope/_extensions/telescope_knot.lua @@ -69,8 +69,9 @@ telescope_knot.zones = function(opts) vim.api.nvim_buf_set_lines(buffer, 0, 0, false, record) local width = vim.api.nvim_win_get_width(0) local height = vim.api.nvim_win_get_height(0) - 10 - local win = vim.api.nvim_open_win(buffer, true, + vim.api.nvim_open_win(buffer, true, { relative = 'win', bufpos = { 0, 0 }, width = width, height = height, border = 'rounded' }) + vim.api.nvim_buf_set_keymap(buffer, "n", "q", "bd", {}) vim.api.nvim_buf_set_keymap(buffer, "c", "w", "lua vim.api.nvim_exec_autocmds('User', { pattern = 'KnotWrite' })", {}) vim.api.nvim_create_autocmd({ "User" }, {