Closed XXiaoA closed 2 years ago
Yep! I agree. I think the keymaps could use a refactor to expose them in a convenient way in the config options. I have some ideas from another one of my plugins; I'll see about putting them in
Yeah, using keymaps is a convenient way. And the following is my keymap which can reach the expected effect. Hope it's helpful.
vim.keymap.set("n", "q", function()
local bf = vim.api.nvim_get_current_buf()
local filetype = vim.api.nvim_buf_get_option(bf, "filetype")
if filetype == "TelescopePrompt" then
vim.cmd("quit!")
end
end)
Support added! You would use:
require('dressing').setup({
-- If you want the mapping in vim.ui.input
input = {
mappings = {
-- n for normal mode
n = {
q = 'Close',
},
},
},
-- If you want the mapping in vim.ui.select
select = {
builtin = {
mappings = {
q = 'Close'
},
},
},
})
As the title say, I wanna press
q
to quit window liketelescope
in the following configuration