# Tchou Kanaky

**URL:** <https://discuss.kakoune.com/t/tchou-kanaky/779>\
**Category:** Recipes & Guides\
**Created:** [November 5, 2019, 6:24pm UTC](https://discuss.kakoune.com/t/tchou-kanaky/779 "2019-11-05T18:24:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Delapouite](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/delapouite/32/10_2.png) [@Delapouite](https://discuss.kakoune.com/u/Delapouite)\
**Post date:** [November 5, 2019, 6:24pm UTC](https://discuss.kakoune.com/t/tchou-kanaky/779/1 "2019-11-05T18:24:19Z")

</div>

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:

> <https://github.com/mawww/kakoune/blob/master/src/string_utils.cc#L418-L421>

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

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [November 5, 2019, 7:58pm UTC](https://discuss.kakoune.com/t/tchou-kanaky/779/2 "2019-11-05T19:58:34Z")

</div>

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`).

---

<div class="post-metadata">

**Author:** ![andreyorst](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/andreyorst/32/29_2.png) [@andreyorst](https://discuss.kakoune.com/u/andreyorst)\
**Post date:** [November 6, 2019, 4:16am UTC](https://discuss.kakoune.com/t/tchou-kanaky/779/3 "2019-11-06T04:16:52Z")

</div>

> [@Delapouite](#):
>
> Did you know that `map g n g n` is a valid command? I didn’t.

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…”

---

<div class="post-metadata">

**Author:** ![alexherbo2](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/alexherbo2/32/1140_2.png) [@alexherbo2](https://discuss.kakoune.com/u/alexherbo2)\
**Post date:** [November 6, 2019, 7:59am UTC](https://discuss.kakoune.com/t/tchou-kanaky/779/4 "2019-11-06T07:59:19Z")

</div>

```auto
alias global m map
m g n g n

```

---

<div class="post-metadata">

**Author:** ![andreyorst](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/andreyorst/32/29_2.png) [@andreyorst](https://discuss.kakoune.com/u/andreyorst)\
**Post date:** [November 6, 2019, 12:01pm UTC](https://discuss.kakoune.com/t/tchou-kanaky/779/5 "2019-11-06T12:01:49Z")

</div>

Added this to my config:

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Delapouite](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/delapouite/32/10_2.png) [@Delapouite](https://discuss.kakoune.com/u/Delapouite)\
**Post date:** [November 7, 2019, 9:41am UTC](https://discuss.kakoune.com/t/tchou-kanaky/779/6 "2019-11-07T09:41:01Z")

</div>

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

> <https://github.com/mawww/kakoune/blob/master/src/command_manager.cc#L188-L208>

meaning we could type:

```auto
echo %o{aligntab}

```

instead of the muuuuch longer:

```auto
echo %opt{aligntab}

```
