# Avoiding Insert/Normal mode confusion

**URL:** <https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558>\
**Category:** Uncategorized\
**Created:** [October 24, 2024, 5:06pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558 "2024-10-24T17:06:11Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 24, 2024, 5:06pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/1 "2024-10-24T17:06:11Z")

</div>

The most obvious downside to modal editing is confusion among modes – not remembering whether one is in Normal or Insert mode.

A possible solution is to signal the current mode with background color:

> [@Change colorscheme depending on mode](https://discuss.kakoune.com/t/change-colorscheme-depending-on-mode/1994):
>
> Hello! I am very new to kakoune, but I love it so far. I’m having some trouble remembering in which mode I am (because I’m also new to modal editing). I wonder, as a feature request, to be able to use some colorscheme for normal mode, and another for insert mode. If it is already available, please show me how, because I cannot find thru documentation.

In my case, however, I found that the only way to prevent mode confusion was to change the color of the **cursor** (where attention is focused).

To understand why, here is a short video that you may find entertaining:

[![](https://img.youtube.com/vi/IGQmdoK_ZfY/hqdefault.jpg "The Monkey Business Illusion") ](https://www.youtube.com/watch?v=IGQmdoK_ZfY)

---

<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 24, 2024, 8:51pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/2 "2024-10-24T20:51:47Z")

</div>

I already knew about the gorilla so I’m biased 😂

---

<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 24, 2024, 9:01pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/3 "2024-10-24T21:01:51Z")

</div>

Having some infos to the left of the status line help me honestly but @mawww keeps refusing it in core. I wouldn’t rely to the color of the cursor only—I know it’s on the right but it’s a long reach—to have the mode information for disabled people. Something similar to Helix with color modes would be neat.

---

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 25, 2024, 11:48am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/4 "2024-10-25T11:48:27Z")

</div>

I knew about the gorilla too, which I why I missed the curtain and player trick.

---

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 25, 2024, 11:52am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/5 "2024-10-25T11:52:40Z")

</div>

I meant that in my case, I managed to miss mode changes even with something as drastic as white/dark background changes (analogous to the curtain trick in the video). As I said, the only effective alert about mode changes was changes in the appearance of the cursor (the focus of attention).

Aligning mode info on the left of the modeline would help, too.

---

<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 27, 2024, 11:33am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/6 "2024-10-27T11:33:10Z")

</div>

How about changing the shape of the cursor?

---

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 27, 2024, 11:09pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/7 "2024-10-27T23:09:31Z")

</div>

Yes, that would make it too. I assume you would use underlining vs. a colored block.

---

<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 28, 2024, 11:48am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/8 "2024-10-28T11:48:05Z")

</div>

Helix changes the cursor shape of the main cursor, which is neat, but it’s not possible in Kakoune.

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [October 28, 2024, 1:29pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/9 "2024-10-28T13:29:26Z")

</div>

yeah a cursor shape for insert mode will be easy to add

---

<div class="post-metadata">

**Author:** ![lobre](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/lobre/32/1245_2.png) [@lobre](https://discuss.kakoune.com/u/lobre)\
**Post date:** [October 28, 2024, 3:25pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/10 "2024-10-28T15:25:00Z")

</div>

I know this has been discussed in the past, but the situation was still with ncurses.

Maybe changing the cursor shape would now be possible.

Issues related to the discussion:

> <https://github.com/mawww/kakoune/issues/4241>
>
> \<!--
> Please make sure that no request has already been made for your feature
> b…y checking the issue tracker (tag: \`feature request\`). If it was to be the
> case, feel free to post a reply in the already existing issue, indicating
> that you're interested (and possibly the use you would make for the feature,
> if not already mentioned).
> \--\>
> 
> \### Feature 
> I would like to be able to change the cursor style.
> When it is in \`Normal\` mode, I would like to have a block cursor.
> When it is in \`Insert\` mode, I would like a pipe cursor.
> 
> \### Usecase 
> I, for now, don't have anything for the feature, but I would like to be able to change the cursor.
> 
> \### Why?
> It would be very helpful, as I accidentally type, thinking it is in insert mode. So, if there is an option to do so, it would be very helpful.
> 
> Thanks in advance.

> <https://github.com/mawww/kakoune/issues/2798>
>
> How about changing the cursor color in insert mode?
> 
> I just tested \[λiquid\] a …few minutes and noticed they change the cursor color from blue in navigation mode to green in insert mode. The feeling is quite great.
> 
> \[λiquid\]: https://github.com/mogenslund/liquid

> <https://github.com/mawww/kakoune/issues/1385>
>
> Neovim has an option \`guicursor\` which handles cursor shapes without any pain. I…s there anyway to set different cursor shapes in insert and normal mode for kakoune?

---

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [October 29, 2024, 2:51am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/11 "2024-10-29T02:51:17Z")

</div>

While Kakoune doesn’t use ncurses anymore, it’s still true that the terminal only supports one cursor (while Kakoune supports multiple) and Kakoune’s editing model defines the cursor to be at least 1 character cell wide, not 0, so the “vertical line” cursor often used to indicate insert mode would be inaccurate.

It would be possible to “blink” the character cell under the cursor so that most of the time it displayed the actual character, but some of the time switched to displaying something like U+258F LEFT ONE EIGHTH BLOCK “▏” but that would be clunky in its own way.

If I ever decide to write my own text editor for some reason, I’ll experiment with an editing model that supports zero-width selections, but I expect it’s a bit late to change that in Kakoune.

---

<div class="post-metadata">

**Author:** ![gregk](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/g/958977/32.png) [@gregk](https://discuss.kakoune.com/u/gregk)\
**Post date:** [October 30, 2024, 7:52am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/12 "2024-10-30T07:52:32Z")

</div>

Mode confusion is an issue for me as well. I’d like to try changing the colour of the cursor, could you please share your recipe?

this is similar to [Blinking statusline when selections are out of current view](https://discuss.kakoune.com/t/blinking-statusline-when-selections-are-out-of-current-view/2376)

I would also be interested in trying sound feedback, perhaps having a click/beep sound in insert mode. I’m not sure if I could tolerate this but would be interested in experimenting. Any sound recipes welcomed.

---

<div class="post-metadata">

**Author:** ![krobelus](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/krobelus/32/616_2.png) [@krobelus](https://discuss.kakoune.com/u/krobelus)\
**Post date:** [October 30, 2024, 10:29am UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/13 "2024-10-30T10:29:50Z")

</div>

We can still ask the terminal to make the main cursor a vertical line while in insert mode.  
It won’t be as configurable in terms of faces but I don’t think that’s a big deal

---

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 30, 2024, 2:26pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/14 "2024-10-30T14:26:23Z")

</div>

To change cursor color, you can try something like this:

```
hook -group tell_mode global ModeChange push:.*:insert %{
    set-face window PrimaryCursor black,bright-red+b
    set-face window PrimaryCursorEol black,bright-red+b
    set-face window SecondaryCursor bright-magenta,magenta+b
    set-face window SecondaryCursorEol bright-magenta,magenta+b
}

hook -group tell_mode global ModeChange pop:insert:.* %{
    set-face window PrimaryCursor black,bright-green+b
    set-face window PrimaryCursorEol black,bright-green+b
    set-face window SecondaryCursor black,bright-white+b
    set-face window SecondaryCursorEol black,bright-white+b
}

```

Of course, the choice of colors is yours.

Please note that Kakoune starts in Normal mode, so the colors you choose for these hooks must be consistent with the colors when Kakoune starts (which depend on your colorscheme).

---

<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, 2024, 1:30pm UTC](https://discuss.kakoune.com/t/avoiding-insert-normal-mode-confusion/2558/15 "2024-11-06T13:30:16Z")

</div>

pepper looks to support zero-width selections, with an active selection mode, e.g., in normal mode, you can try `d` and it will do nothing.

[https://git.sr.ht/~lessa/pepper](https://git.sr.ht/~lessa/pepper)
