Example – Disable hooks and mappings:
3\i(hello)<esc>
\ is not a command, but a parameter, currently you can do 3\o and that opens 3 lines in insert mode with hooks disabled.
We could probably use the count when we press \ and make it mandatory to do \3o to get the previous behavour, but I am not sure I see a good use case for this feature. In scripting we can already do that with -with-maps and -with-hooks on execute-keys, so I imagine this is for interactive usage, could you describe a case where you really needed that feature ?
I need this feature to temporarily disable [auto-pairs.kak].
Maybe we could simply change \ to also disable mappings ?
The repeat changes command has also very weird behavior with mappings. I recently changed the implementation from hooks to maps and cannot commit repetitive changes now.
Maybe we could simply change
\to also disable mappings ?
I sometimes use \ followed by the key I mapped to :write so this would be a bit unexpected to me.
Maybe it is still the best solution though. Other options that come to mind are <a-\> (\<a-\> to disable both hooks and mappings) or \\.
Alt + \ is a bit hard for me to reach. When keys are on the edge, and require another key (the command to be unhooked/unmapped), I tend to prefer typing 2 keys (with the count (left hand) and \ (right hand)) rather than holding a modifier, release and press the command to be escaped.
Most helpful comment
I sometimes use
\followed by the key I mapped to:writeso this would be a bit unexpected to me.Maybe it is still the best solution though. Other options that come to mind are
<a-\>(\<a-\>to disable both hooks and mappings) or\\.