Reputation:
I've created myself the following vim shortcut: map <Leader>c magg=G'a<CR>
When I use it, there's a pretty noticeable 2-second lag happening before my file is actually indented. If I manually type magg=G'a
, the problem doesn't happen. How can I fix it?
Upvotes: 2
Views: 398
Reputation: 172728
You probably have other mappings that start with <Leader>c
, so Vim has to wait to resolve the ambiguity; :verbose map <Leader>c
will tell you. Then, just choose different keys for one to get immediate response.
Also, you should use :noremap
; it makes the mapping immune to remapping and recursion.
Upvotes: 3