Ctrl-] is how one is supposed to move around interactively in Vim on "linkable" text, for instance in the help files. On US layouts, this is simply a two finger combo. Unfortunately the "]" character is a bit awkward to type on Norwegian keyboard layouts (AltGr+9), so I was simply wondering what other fellow Norwegians do to efficiently move about?

norwegian keyboard

  • I actually use <Ctrl><AltGr>9 myself, and find it ok. I guess it's much because I'm so used with it, though. – Karl Yngve Lervåg Dec 18 '16 at 21:58
  • After finding I was fighting too much with the usual shortcuts with a Norwegian layout, I gave up and started using a US layout by default, switching back and forth when I need special characters. But I might come back :) – oligofren Dec 18 '16 at 22:08
  • 2
    I think that the question could be edited to be more general: On french keyboard the key is accessed by the same type of mapping (<Ctrl><AltGr><°>) and I think this is also the case of other layouts... I don't really know how to rephrase it but I think the question would be useful to more people if it wasn't only 'norvegian' in the title. Now about the actual question I agree with @KarlYngveLervåg: <Ctrl><AltGr><°> became natural and it isn't a problem anymore. – statox Dec 19 '16 at 12:41
  • 1
    Tried editing the title a bit. – oligofren Dec 19 '16 at 20:33
  • I also switched to the US keyboard. I have a toggleProseDE function in my vimrc which does a couple of things (ex: enable spell checking for German). Inside the func, I define stuff like inoremap aa <C-k>a: which inserts ä when pressing a twice. I used it not so often so the additional waiting time is not a problem. See the table at the end of :digraphs for a list of chars. – Rolf Dec 23 '16 at 8:47

In the place where ANSI US has [ and ] Nordic keyboards have å and ¨, of which the latter is really not bindable, since it sends "half a character" and waits for the character to be accented. For example, pressing ¨a outputs ä.

One solution would be to "left-shift" the binding to CTRL-å (the key to the right of P).

I personally switch between US and Finnish/Nordic layouts quite often and write code almost exclusively in US layout.

  • Yeah, that's what I do too. But then using other people's computers is a mess, especially on OS X where you also need to enable Opt (Alt) as a Meta key to get readline support in the terminal, but then you cannot type any of the characters needing Alt ... That reminds me, that is my next question on some macOS forum :p – oligofren Dec 20 '16 at 16:36

I use a customized us layout and access ligatures by vim mappings and OS option key mappings instead of spending a whole key on them. For instance, I use aeo, which are adjacent on qgmlwb (jkl), to get æ.

noremap! aeo æ

By default you can also use <c-k>ae.

  • hmm ... that is doable, but doesn't really help outside of vim. good tip, though. – oligofren Dec 20 '16 at 16:37
  • @oligofren, yes, but outside vim you can use OS wide option/alt bindings, e.g. alt-a --> æ. (Surely you don't plan on writing anything long outside vim anyway.) – Toothrot Dec 20 '16 at 16:40
  • Nonono, of course I do all my Slacking in vim through some plugin. – oligofren Dec 20 '16 at 16:53
  • OMG, I just had to google that. "Of course" there is a vim-slack plugin (smacks forehead). – oligofren Dec 20 '16 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.