tpope / vim-unimpaired

unimpaired.vim: Pairs of handy bracket mappings

Home Page:https://www.vim.org/scripts/script.php?script_id=1590

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hex / bases decode

elig0n opened this issue · comments

Would love to see [h & ]h (or similar) for hex encode & decode and even other bases.

The limitation here is we're running low on maps. ]h isn't great because the linewise map would be ]hh, which is ambiguous with "decode one character to the left".

It's pretty clunky, but I ended up using numbers, like ]2, ]6 and ]8 for base 2, 16 and 8 conversions. Also set up ]4 for base64. Are these maps acceptable?

If so I'm happy to open a PR for them. Used some external commands for the conversions, so I'm not sure about portability but I think I stuck to generally available commands.