1

I put this:

noremap [ {
noremap ] }

in my .vimrc. However, since there are other keybindings starting with [ and ], vim waits for the next keybinding before executing my desired command.

After reviewing this article, I attempted to apply the solution for [ and ], but failed. The code was written for the g prefix, and I was unsuccessful in modifying it for [ and ].

How can I remove all keybindings starting with [ and ] in vim so I can avoid the delay when using my own bindings for [ and ]?

1 Answer 1

1

One simple way to achieve this is to make a buffer-local nowait mapping.

autocmd FileType * nnoremap <nowait><buffer> [ {
autocmd FileType * nnoremap <nowait><buffer> ] }

Another option is to use langmap:

set langmap=[{,]}

You can use the associated option langremap to adjust whether [ and ] inside mappings will have the usual or new actions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.