Reputation: 41
I code a lot of HTML and I'd like to map CTRL+>
to >
and CTRL+<
to <
respectively, to make it easier when typing out lots of text featuring those symbols.
After checking the Vim manual, I tried using imap <C->> >
, imap <C-\>> >
and even imap <C-S-.> >
but so far I've had no success. Any ideas?
Upvotes: 3
Views: 2239
Reputation: 72696
All the <C-X>
type combinations are for "Ctrl+X", you need:
:imap < <
:imap > >
As an alternative, you could also consider using :ab
:
:iab < <
:iab > >
Then you type <SPACE and you'll get <
. This allows you to type:
<a href
and get:
<a href
or type:
X < Y
and get:
X < Y
Hope that helps, for more information, see:
:help :imap
:help :abbreviations
Upvotes: 4
Reputation: 41
As a compromise, I've found I can do imap <M-.> >
and imap <M-,> <
, which allows me to use ALT+.
to type >
and ALT+,
to type <
respectively. I suspect that not all CTRL+<key> combinations are supported.
Upvotes: 1