vim-unicode-homoglyphs : Highlight and normalize unicode homoglyphs in Vim.
| script karma
Downloaded by 118
Comments, bugs, improvements
script versions (upload new version)
|Every once in a while one pastes a (markup) code or prose from the internet
into Vim and is at loss why it does not compile or render as meant to; this
plug-in offers a hint and a solution by providing
- highlighting of Unicode Homoglyphs, characters (among them many white
spaces) that only appear like ASCII characters but are not, and
- the normal mode mapping cu to toggle it,
- an operator mapping gy in normal mode, for example gwip operates on a
- a mapping gyy (and gygy) in normal mode that operates on a single line,
- a mapping gy that operates on the visual selection, and
- a command NormalizeHomoglyphs that operates on given range (equal to the
whole buffer if unspecified)
that normalize Unicode Homoglyphs.
For example, hitting gyip on
turns it into
To disable highlighting of Unicode Homoglyphs by default, add to your vimrc the
let g:is_homoglyph_on = 0
To change mappings, for example, to use zy instead of gy and zu instead of cu,
add the lines
nmap zy <plug>(NormalizeHomoglyphs)
xmap zy <plug>(NormalizeHomoglyphs)
nmap zu <plug>(HighlightHomoglyphs)
to your vimrc.
For more convenient version control of prose, see the Vim plug-in
vim-sentence-chopper that puts each sentence onto a single line.
vim-unicode-homoglyphs is developed at https://github.com/Konfekt/vim-unicode-homoglyphs where issues can be filed.
|Unzip vim-unicode-homoglyphs.zip into ~/.vim on Linux or %USERPROFILE%\vimfiles on Windows.|
Click on the package to download.
ip used for rating: 126.96.36.199