Closed echaya closed 2 months ago
well that should work like any normal mapping if you escape it properly
reopen if it doesn't
May be it is just me lacking knowledge about lua but how to do that please? This is waht i tried but not working
t = {
j = {
k = "<C-\\><C-n>",
},
[[\]] = {
[[\]] = function()
vim.cmd("q")
end
},
},
I think it should be
["\\"] = ...
I think it should be
["\\"] = ...
Thanks, ["\\"]
works! Now I see:
E5108: Error executing lua: vim/_editor.lua:431: nvim_exec2(): Vim(quit):E565: Not allowed to change text or change window
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua:431: in function 'cmd'
D:/Dropbox/neovim/config/nvim_config.lua:692: in function 'mapping'
...imfiles\plugged\better-escape.nvim/lua/better_escape.lua:141: in function <...imfiles\plugged\better-escape.nvim/lua/better_escape.lua:110>
"D:/dropbox/neovim/config/nvim_config.lua" 707L, 21023B
that's a limitations with the mappings
you can put the vim.cmd.q()
inside a vim.schedule(function() ... end)
that's a limitations with the mappings you can put the
vim.cmd.q()
inside avim.schedule(function() ... end)
Thanks much - really appreciate it!
I have
tnoremap \\ <cmd>q<cr>
in my config to quit from terminal mode without closing it (am usingtoggleterm
). Is there a way to map it within better-escape please? Suggestion is welcome! Thanks in advance!