VI/VIM editor: Using a map sequence to wrap a word with HTML tags -


I'm trying to define a vi 'map' order sequence, which wraps the current word inside an HTML tag It is, e.g. The B (bold) tag map is defined as such:

 : map K ebi & lt; B & gt; & Lt; Esc & gt; EA & lt; / B & gt; & Lt; Esc & gt;  

The map starts with "eb" which leads to the beginning of the selected word, assuming that the cursor position will most likely be in the beginning or in the middle of the problem. , It does not work if the cursor is on the last letter of the word - then the following words will be wrapped.

Is this map a trick to work reliably for a cursor position? Another way of doing this: Delete internal words (diu), insert tags, find the last

, Enter extinction

/ div>

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -