This should work just fine, as long as the original byte sequences are kept (so <80>
is a single character and not four <
8
0
>
) - your cat
output seems to confirm this. The only issue I can think of is that Vim might use a wrong encoding when reading the .vimrc
(but somehow detecting the right one when editing it). A scriptencoding utf-8
at the top might help then.
In any case, by using :help key-notation
, these issues can be avoided. You'd need to use double quotes to have then interpreted (and then write \<Esc>
instead of ^[
, \<BS>
instead of <80>kb
, and so on). While you're at it, why not define proper mappings (with :map
, or rather :nnoremap
), to free up the registers again.
Speaking of registers, there's always the chance of accidentally overriding them, they're limited in number, and hard to memorize; all things that mappings don't suffer from. If you really want to continue to reserve registers for these shortcuts (and don't have the problem of overriding them), you could just rely on the viminfo-file
to persist them; there actually is no need to explicitly initialize them in your ~/.vimrc
.