How to match angle brackets in windows gVim?

I am coding a lot of HTML, and I would like to map CTRL+>to &gt;and CTRL+<with &lt;respectively to make it easier to enter text with these characters.

After checking the Vim manual, I tried to use it imap <C->> &gt;, imap <C-\>> &gt;and even imap <C-S-.> &gt;, but so far I have not been successful. Any ideas?

+3
source share
2 answers

All type combinations <C-X>for "Ctrl + X", you need:

:imap < &lt;
:imap > &gt;

Alternatively, you may also consider using :ab:

:iab < &lt;
:iab > &gt;

Then you enter < SPACEand you will receive &lt;. This allows you to enter:

<a href

and get:

<a href

or enter:

X < Y

and get:

X &lt; Y

, , :

:help :imap
:help :abbreviations
+4

, , imap <M-.> &gt; imap <M-,> &lt;, ALT+. &gt; ALT+, &lt; . , CTRL + < > .

+1

Source: https://habr.com/ru/post/1730988/


All Articles