[Resolved] Changing cursor style depending on mode

Is there a way? In vim I was used to that extra bit of feedback as to which mode I was in based on if I had a block cursor (normal) or vertical line (insert). Perhaps related would be the ability to turn on blinking of the cursor, although I don’t mind it remaining solid as much as I thought I might have.

On the other hand, I’m not sure how much control kak has over how the cursor is drawn if running inside tmux…

Vertical line cursor in Kakoune would be misleading as Kakoune always operate on selection, and “just cursor” is a selection of the current character, and there is no 0-width selection in Kakoune.

One of the options (which I use) is to change cursor color in insert mode, like this:

hook global ModeChange insert:.* %{
    set-face global PrimaryCursor      rgb:ffffff,rgb:000000+F
}

hook global ModeChange .*:insert %{
    set-face global PrimaryCursor      rgb:ffffff,rgb:008800+F
}
3 Likes

This is exactly the sort of answer I was hoping for! I can accept the selection logic, and color will serve my purposes.

The answer is out of date as 2021.09.03.

I had to change these modifications to make it work:

hook global ModeChange (push|pop):insert:.* %{
    set-face global PrimaryCursor      rgb:ffffff,rgb:008800+F
}

hook global ModeChange (push|pop):.*:insert %{
    set-face global PrimaryCursor      rgb:ffffff,rgb:880000+F
}
4 Likes