tpope / vim-unimpaired

unimpaired.vim: Pairs of handy bracket mappings
https://www.vim.org/scripts/script.php?script_id=1590
3.33k stars 203 forks source link

Add `[U` and `[U` mappings for unicode characters decoding and encoding #234

Closed ungnis closed 1 year ago

tpope commented 1 year ago

I don't understand what use case this is addressing. Where does text like U00F0 appear in the real world? The closest I can think of is \u00F0 in strings, but that's already covered by ]y. U+00F0 is a thing but you never see more than one at a time.

Even with a good use case, this would be hard to justify, as we're really short on letters.

ungnis commented 1 year ago

It is very useful in editing XKB keyboard layouts on Linux (/usr/share/X11/xkb/symbols), where nearly every not so common symbol needs to be specified in this way. I've searched for a plugin that handles this problem, but nothing really. I thought it would be a good addition to this plugin on a par with XML and URL encoding. But yeah, it is a very specific use case.

tpope commented 1 year ago

UnimpairedMapTransform is public so you can create a map just for yourself if you want. Just make sure it's a public function.