htmlmap : macros to help type HTML entities
| script karma
Downloaded by 2036
Comments, bugs, improvements
script versions (upload new version)
|This script defines a number of macros, all for insert mode in HTML files. Once installed, it will automatically "translate" characters into their &...; strings: so for instance if you type "ä" the characters " & a u m l ; " will be inserted (without the intervening spaces). A mechanism similar to Vim's "digraphs" is also supported but with another key (F12, but you can replace it with something else if it doesn't suit you), so that e.g. "<F12>oe" inserts the numeric code for the oe ligature (above 255, some browsers know the numeric codes but not the symbolic entities such as œ).
The script contains a lot of comments to make it largely self-explanatory.
|Add the line
(where <path> is the directory where you downloaded this script) to the file ~/.vim/ftplugin/after/html.vim (for Unix) or ~/vimfiles/ftplugin/after/html.vim (for Windows). Create the file and the directories if they don't yet exist.
imap <F12> <C-K>
to your vimrc if you want to use the same key as a digraph prefix for entities in HTML and for characters in other files.
Note that if your vim does not support autocommands you can still make this script work by sourcing it manually in the buffer(s) where you need it.
Click on the package to download.
ip used for rating: 22.214.171.124