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 Vim-users with non-English layouts do to efficiently move about?
2 Answers
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 Commented Dec 20, 2016 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. Commented Dec 20, 2016 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.)– ToothrotCommented Dec 20, 2016 at 16:40
-
Nonono, of course I do all my Slacking in vim through some plugin. Commented Dec 20, 2016 at 16:53
-
OMG, I just had to google that. "Of course" there is a vim-slack plugin (smacks forehead). Commented Dec 20, 2016 at 16:53
<Ctrl><AltGr>9
myself, and find it ok. I guess it's much because I'm so used with it, though.<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.toggleProseDE
function in my vimrc which does a couple of things (ex: enable spell checking for German). Inside the func, I define stuff likeinoremap aa <C-k>a:
which insertsä
when pressinga
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.