I am using a macbook with touchbar. As many others I would like to map a different key to the esc key, since the touchbar esc is a bit inconvenient. My problem is that I have some weird behaviour of the §-key which I would like to use as alternative. I had to remove the
map § <esc>
since the §-key doesn't work in the first place. I assume this has something to do with how I configured vim. I use vim inside zsh and have almost the same vimrc as this one https://github.com/amix/vimrc. I also have installed tabnine-vim which might interferes in some way.
In normal mode the §-key does nothing. Expect my mac beeps shortly. In Insert mode the §-key goes on character left but then remains there if I press it again. The Insert mode is not left.
The key works normal in the zsh. Also the key works if I write for example :§
. By accident I also noted that whenever I type some ° characters, those get replaced by <80>kl
when I hit the §-key on them in Insert mode. As far as I know this means left, and so far this replacement only appeared on ° characters.
How can I debug this? I have searched the vimrc if a remapping of the §-key already exists but could not find anything so far. I am rather new to vim. I still can't see how one best debuggs problems like this.
map § <esc>
only maps this in normal mode (and visual and select modes actually). You typically want to hit<esc>
to exit insert mode, so you probably want something likeinoremap § <esc>
primarily instead? You can see whether the key will produce the correct code in insert mode by pressingCtrl+V
followed by that key, to see the exact sequence it produces. (I'd expect a literal §.) Have you tried any of the ways to map a key to<esc>
globally on your macbook? In your keyboard preferences, you should be able to map Caps Lock to it... There's also Karabiner Elements.:set fenc?
returns:'fileencoding=
while:set enc?
does showutf-8