Tchou Kanaky

Hello

Did you know that map g n g n is a valid command? I didn’t.

During all these years I’ve always typed it entirely, with the useful help of the auto-completer: map global normal g n.

It turns out that scope and mode params can be expressed in short forms, as long as their are no ambiguity, thanks to the prefix_match() function described here:

Discovering this behavior won’t likely improve my workflow, but it’s funny how Kakoune always have nice surprises hidden in plain sight.

1 Like

I did know but I forgot. If I recall well, I was asking shortcuts from Vim, that it is able to recognize all subparts of a command from its shortest form, for example :edit file.txt (:e file.txt, :ed file.txt, :edi file.txt, :edit file.txt).

thanks, I had a nice time this morning trying to understand what is going on here. When I got this I was like “what?”, and then: “damn, not only aliases like def and eval will be used everywhere now but also this…”

alias global m map
m g n g n
1 Like

Added this to my config:

alias g a alias
a g u unalias
a g m map
m g n g n
u g m
u g a
u g u

By being extreme the prefix_match() function could be used here :

meaning we could type:

echo %o{aligntab}

instead of the muuuuch longer:

echo %opt{aligntab}