0

I'd like to define a mapping that performs a "recursively" defined behavior (e.g. uses a <Plug> target) followed by a non-recursively defined behavior. For example, using the camelcase motion plugin, I want to move forward a camelcase word and then enter insert mode. Neither of these work:

nmap -w <Plug>CamelCaseMotion_wi
nnoremap -w <Plug>CamelCaseMotion_wi

Because the i needs to be done non-recursively and <Plug>CamelCaseMotion_w needs to be done recursively. What's the best way to achieve my goal?

4

You can do this by introducing your own nore map:

nnoremap <plug>(my-i) i
nmap -w <Plug>CamelCaseMotion_w<plug>(my-i)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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