aboutsummaryrefslogtreecommitdiff
path: root/autoload/cursor.kak
blob: d3abd3b4306cb57d023d2c451f6fd6cf1c0a29c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# declare-option -hidden regex curword

# Highlight word under cursor
# add-highlighter global/ dynregex '%opt{curword}' 0:CurWord
# hook global NormalIdle .* %{
#   eval -draft %{try %{
#     exec <space><a-i>w <a-k>\A\w+\z<ret>
#     set-option buffer curword "\b\Q%val{selection}\E\b"
#   } catch %{
#     set-option buffer curword ''
#   }}
# }

# Change cursor face based on mode
hook global ModeChange .*:.*:insert %{
  set-face window PrimaryCursor InsertCursor
  set-face window PrimaryCursorEol InsertCursor
}
hook global ModeChange .*:insert:.* %{ try %{
  unset-face window PrimaryCursor
  unset-face window PrimaryCursorEol
} }