-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstyle.kak
67 lines (54 loc) · 1.93 KB
/
style.kak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Colors
# ──────
set-face global PrimarySelection default,bright-green
set-face global SecondarySelection default,bright-blue
set-face global PrimaryCursor default,rgb:FF8080
set-face global SecondaryCursor default,rgb:80F090
set-face global Whitespace bright-black,default
# add-highlighter global/ show-whitespaces -spc '_' -only-trailing
add-highlighter global/ show-whitespaces -tab '•' -tabpad ' ' -lf '¬' -spc ' ' -nbsp '⍽'
add-highlighter global/ dynregex '%reg{/}' 0:+u
add-highlighter global/ regex \b(?:FIXME|TODO|XXX)\b 0:default+rb
add-highlighter global/ column 80 default,bright-black
add-highlighter global/ column 120 default,bright-white
# Number line column
# ──────────────────
add-highlighter global/ number-lines -hlcursor
add-highlighter global/ wrap -word -indent -marker ↳
# Highlight the word under the cursor
# ───────────────────────────────────
declare-option -hidden regex curword
set-face global CurWord default,bright-black
define-command -hidden custom-highlight-word-cursor %{
eval -draft %{
try %{
exec ,<a-i>w<ret>
set-option buffer curword "\b\Q%val{selection}\E\b"
} catch %{
}
}
}
define-command -hidden custom-highlight-word %{ %sh{
if [ "${kak_selections_length}" = "1" ]; then
echo "custom-highlight-word-cursor"
else
echo "nop"
fi
}}
hook global RawKey .* %{
set-option buffer curword ''
custom-highlight-word
}
add-highlighter global/ dynregex '%opt{curword}' 0:CurWord
# Line wrap
# ──────────
declare-option -hidden int kak_opt_autowrap_column
set-option global kak_opt_autowrap_column 80
set-face global LineNumbersWrapped white,default
set-option global ui_options terminal_set_title=false
# Filetype
# ──────────
# ctest -> cmake
hook global BufCreate .*\.ctest %{
set-option buffer filetype cmake
}