Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 1
    Your mapping 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 like inoremap § <esc> primarily instead? You can see whether the key will produce the correct code in insert mode by pressing Ctrl+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. Commented Apr 15, 2020 at 11:34
  • Thank you for your answer. I just tested the inoremap. Changed nothing. Ctrl+V followed by the key does show me the actual key. I would rather not change the esc key globally on my macbook since I sometimes use the key (but rarely to be honest). Is this the expected behaviour of the §-key? I mean what happens when you press this button? I assume my remapping should work once I am able to type a § without doing ctrl+V first. Commented Apr 15, 2020 at 11:41
  • Hm weird. It's a Swiss keyboard. The key should actually act as a normal key (no dead key). Disabling vimrc should have been an obvious test, sorry for that. Tested it right now. Now it works... so there has to be an error in my virmc Commented Apr 15, 2020 at 11:52
  • :set fenc? returns:'fileencoding= while :set enc? does show utf-8 Commented Apr 15, 2020 at 12:03
  • See vi.stackexchange.com/q/2003/18609 and vi.stackexchange.com/q/7722/18609 for potentially useful troubleshooting advice. Commented Apr 15, 2020 at 12:03