# Useful user-modes

**URL:** <https://discuss.kakoune.com/t/useful-user-modes/730>\
**Category:** Recipes & Guides\
**Created:** [September 26, 2019, 3:47am UTC](https://discuss.kakoune.com/t/useful-user-modes/730 "2019-09-26T03:47:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jssee](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/jssee/32/108_2.png) [@jssee](https://discuss.kakoune.com/u/jssee)\
**Post date:** [September 26, 2019, 3:47am UTC](https://discuss.kakoune.com/t/useful-user-modes/730/1 "2019-09-26T03:47:27Z")

</div>

Hey all,

I’m starting to get more comfortable with using Kakoune, and with that comes more configuration! I wanted to use this thread as a place to share some useful user-modes. feel free to post yours.

---

<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:** [September 26, 2019, 4:52am UTC](https://discuss.kakoune.com/t/useful-user-modes/730/2 "2019-09-26T04:52:17Z")

</div>

Hello. I’ve started to gather a few user-modes here : [https://github.com/Delapouite/kakoune-user-modes/blob/master/user-modes.kak](https://github.com/Delapouite/kakoune-user-modes/blob/master/user-modes.kak)

Another interesting one that let you shrink, grow selections symmetrically: [https://github.com/Delapouite/kakoune-mirror](https://github.com/Delapouite/kakoune-mirror)

---

<div class="post-metadata">

**Author:** ![elasticdog](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/elasticdog/32/98_2.png) [@elasticdog](https://discuss.kakoune.com/u/elasticdog)\
**Post date:** [September 26, 2019, 8:03pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/3 "2019-09-26T20:03:10Z")

</div>

I declare a user mode for dealing with Git workflows…some commands which act as shortcuts for the built-in Git support, and others that shell out to `tig` for more complex functionality:

```auto
map global user -docstring "Enable Git keymap mode for next key" g ": enter-user-mode<space>git<ret>"

declare-user-mode git
map global git -docstring "blame - Show what revision and author last modified each line of the current file" b ': repl tig blame -C "+%val{cursor_line}" -- "%val{buffile}"<ret>'
map global git -docstring "commit - Record changes to the repository" c ": git commit<ret>"
map global git -docstring "diff - Show changes between HEAD and working tree" d ": git diff<ret>"
map global git -docstring "git - Explore the repository history" g ": repl tig<ret>"
map global git -docstring "github - Copy canonical GitHub URL to system clipboard" h ": github-url<ret>"
map global git -docstring "log - Show commit logs for the current file" l ': repl tig log -- "%val{buffile}"<ret>'
map global git -docstring "prompt - Run a free-form Git command prompt" p ":repl tig "
map global git -docstring "status - Show the working tree status" s ": repl tig status<ret>"
map global git -docstring "staged - Show staged changes" t ": git diff --staged<ret>"
map global git -docstring "write - Write and stage the current file" w ": write<ret>: git add<ret>: git update-diff<ret>"

```

…and the source for the `github-url` function can be found here: [https://github.com/elasticdog/dotfiles/blob/ddba2788c9d79912ccf352c3f5ada908e196ba87/kakoune/.config/kak/kakrc#L194-L223](https://github.com/elasticdog/dotfiles/blob/ddba2788c9d79912ccf352c3f5ada908e196ba87/kakoune/.config/kak/kakrc#L194-L223)

I’m excited to poke through other people’s user modes as well…great idea for a thread!

---

<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:** [October 2, 2019, 1:43pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/4 "2019-10-02T13:43:21Z")

</div>

@TeddyDD has a nice [spell user-mode](https://github.com/TeddyDD/kakoune-dotfiles/blob/master/mappings.kak):

```auto
declare-user-mode spell
map global spell p ': spell pl<ret>' -docstring 'PL'
map global spell e ': spell en<ret>' -docstring 'ENG'
map global spell f ': spell-next<ret>_: enter-user-mode spell<ret>' -docstring 'next'
map global spell s ': spell-replace<ret><ret> : enter-user-mode spell<ret>' -docstring 'lucky fix'
map global spell a ': spell-replace<ret>' -docstring 'manual fix'
map global spell c ': spell-clear<ret>' -docstring 'clear'

```

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [October 2, 2019, 5:40pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/5 "2019-10-02T17:40:58Z")

</div>

Damnit @Delapouite… what key to I bind this to! I got g for git and s for search… and now we have spell, I think I am going to maybe use g and G for search and Git. s for spell.

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [October 2, 2019, 6:05pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/6 "2019-10-02T18:05:04Z")

</div>

@elasticdog I love the copy/paste to system stuff you had, I actually made that a user mode too (found it to support your github-url)

---

<div class="post-metadata">

**Author:** ![elasticdog](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/elasticdog/32/98_2.png) [@elasticdog](https://discuss.kakoune.com/u/elasticdog)\
**Post date:** [October 2, 2019, 6:46pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/7 "2019-10-02T18:46:07Z")

</div>

Glad you found it useful! I forgot that my github-url setup relied on that clipboard handling. It was mostly stolen directly from @mawww’s dotfiles: [https://github.com/mawww/config/blob/8fe6034c524a3d75a648e361abe7095a444c7a2f/kakrc#L61-L74](https://github.com/mawww/config/blob/8fe6034c524a3d75a648e361abe7095a444c7a2f/kakrc#L61-L74)

---

<div class="post-metadata">

**Author:** ![elasticdog](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/elasticdog/32/98_2.png) [@elasticdog](https://discuss.kakoune.com/u/elasticdog)\
**Post date:** [October 2, 2019, 6:47pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/8 "2019-10-02T18:47:10Z")

</div>

Oh nice! I’ve been meaning to implement something like your lucky fix for spellcheck corrections. Thanks for posting this.

---

<div class="post-metadata">

**Author:** ![robertmeta](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/robertmeta/32/833_2.png) [@robertmeta](https://discuss.kakoune.com/u/robertmeta)\
**Post date:** [October 3, 2019, 10:44am UTC](https://discuss.kakoune.com/t/useful-user-modes/730/9 "2019-10-03T10:44:36Z")

</div>



---

<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:** [October 14, 2019, 2:54am UTC](https://discuss.kakoune.com/t/useful-user-modes/730/10 "2019-10-14T02:54:10Z")

</div>

[Recipes](https://launchlet.dev) can be a nice alternative to explore for a crowded user mode. I think I prefer them for non-editing features like Git and spelling.

---

<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:** [October 17, 2019, 2:20pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/11 "2019-10-17T14:20:31Z")

</div>

To use with [https://github.com/ul/kak-tree](https://github.com/ul/kak-tree)

```auto
  declare-user-mode tree
  map global tree h ': tree-select-previous-node<ret>' -docstring 'select previous'
  map global tree l ': tree-select-next-node<ret>' -docstring 'select next'
  map global tree k ': tree-select-parent-node<ret>' -docstring 'select parent'
  map global tree j ': tree-select-children<ret>' -docstring 'select children'
  map global tree f ': tree-select-first-child<ret>' -docstring 'select first child'
  map global tree s ': tree-node-sexp<ret>' -docstring 'show info'

```

This user-mode is especially great while locked.

---

<div class="post-metadata">

**Author:** ![mso](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@mso](https://discuss.kakoune.com/u/mso)\
**Post date:** [May 27, 2026, 2:26am UTC](https://discuss.kakoune.com/t/useful-user-modes/730/12 "2026-05-27T02:26:37Z")

</div>

What was this recipes approach? The link seems dead.

---

<div class="post-metadata">

**Author:** ![mso](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@mso](https://discuss.kakoune.com/u/mso)\
**Post date:** [May 28, 2026, 2:33pm UTC](https://discuss.kakoune.com/t/useful-user-modes/730/13 "2026-05-28T14:33:25Z")

</div>

Replying to myself, internet archive helped. [Launchlet](https://web.archive.org/web/20191221224607/https://launchlet.dev/)
