0

I have the following mapping in my vimrc

inoremap < <><left>

but this statement conflicts with

iabbrev cout cout<<

and in insert mode I get cout<<>>

how to delete >> characters automatically

1

You should use :inoreab instead of :iab. nore avoids mappings/abbreviations from being triggered.

Another possibility is to have the mapping analyse the context. IIRC, in lh-cpp/lh-brackets I only expand < into <|> when I detect #include or template on the same line.

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.