Remapping jump list navigation in goto mode

Hi all,

New to Kakoune, absolutely love it! It takes Vim to the next level.

I’m trying to map the normal mode jump commands <c-i> (jump forward) and <c-o> (jump backward) to something in the goto space: gn (goto next jump) and gp (goto previous jump). I thought something like this would work (the <esc> is there to get out of goto mode into normal mode, where <c-i> and <c-o> live):

map global goto n <esc><c-i>
map global goto p <esc><c-o>

Now gp works as expected, but gn does nothing. Any ideas?

(I’m on Kakoune v2019.01.20.)

Hi! Try map global goto n <esc><tab>

Thanks! Works like a charm :slight_smile:

But why does <c-i> not work when it is an alias for <tab>?

Not exactly an alias. It just so happens that those two share the same code, like <c-m> and <return>. But I don’t know why this isn’t working though, that might be a bug.

On a side note Ctrl+i, and Ctrl+o is easier to press than gn. i and o are near each other, so it is just a matter of holding Ctrl with left hand and cycling with two fingers on your left Ctrl+o+i+o+i+i+o. Your mappings involve sequential input of two keys like gngngn are you sure that this would be more efficient?

Yeah, you’re right it is not the fastest way, but I like the consistency.

Thanks for the help!

1 Like

Kakoune’s key-name syntax allows both <c-i> and <tab> as separate keys, but the terminal sends the same byte for both, so when Kakoune receives a 0x09 byte, it has to decide whether to turn it into a <c-i> key or a <tab> key.

Currently, it always turns it into <tab>, and so the jump forward command is only bound to <tab>.

In Kakoune today, map global <c-i> whatever will never be triggered, and map global whatever <c-i> won’t do anything. Someday somebody might make a Kakoune GUI that treats them as fully separate keys, but for now…

ASCII table and history Or, why does Ctrl+i insert a Tab in my terminal?