Skip to content

Commit 2102fc4

Browse files
authored
Merge branch 'mawww:master' into enricozb/scroll-bar
2 parents dc3fdfe + fc84aed commit 2102fc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1354
-121
lines changed

doc/pages/faces.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ attributes::
3535
Note: This takes precedence over underline if both are specified.
3636
*U*:::
3737
double underline
38-
Note: This takes precedence over underline and curly underline if also specified.
38+
Note: This takes precedence over underline and curly underline if
39+
also specified.
3940
*r*:::
4041
reverse
4142
*b*:::
@@ -61,7 +62,9 @@ attributes::
6162
Same as final, but only applies to a face's background color.
6263
*a*:::
6364
final attributes::::
64-
Same as final, but only applies to a face's attributes.
65+
Same as final, but only applies to a face's attributes
66+
Note: this will not clear to the f/g/a attributes of the base
67+
face, `+a` cannot be used to remove `+f` and/or `+g`.
6568

6669
base::
6770
The face onto which other faces apply. Its value can be any face name,

doc/pages/keymap.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
---
44
┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┲━━━━━━━━━━━━━━┓
5-
│ upper│ cmdout│convtab│ │selpipe│sel all│ │ align│pattern│ rotate│ rotate│ trim│ ┃ ⇤ ┃
5+
│ upper│ cmdout│convtab│ │selpipe│sel all│ │ align│pattern│ rotate│ rotate│ trim│dup sel┃ ⇤ ┃
66
├┄┄CASE┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┼┄┄┄┄┄┄┄┨ ┃
77
│ lower│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ ┃ ┃
88
┢━━━━━━━┷━━━┱───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┴───┬───┺━━━┳━━━━━━━━━━┫

rc/filetype/capnp.kak

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# https://capnproto.org/
2+
3+
hook global BufCreate .*[.](capnp) %{
4+
set-option buffer filetype capnp
5+
}
6+
7+
# Initialization
8+
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
9+
10+
hook global WinSetOption filetype=capnp %{
11+
require-module capnp
12+
13+
set-option window static_words %opt{capnp_static_words}
14+
15+
hook window ModeChange pop:insert:.* -group capnp-trim-indent capnp-trim-indent
16+
hook window InsertChar .* -group capnp-indent capnp-indent-on-char
17+
hook window InsertChar \n -group capnp-indent capnp-indent-on-new-line
18+
19+
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window capnp-.+ }
20+
}
21+
22+
hook -group capnp-highlight global WinSetOption filetype=capnp %{
23+
add-highlighter window/capnp ref capnp
24+
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/capnp }
25+
}
26+
27+
provide-module capnp %@
28+
29+
# Highlighters
30+
# ‾‾‾‾‾‾‾‾‾‾‾‾
31+
32+
add-highlighter shared/capnp regions
33+
add-highlighter shared/capnp/code default-region group
34+
35+
add-highlighter shared/capnp/line_comment region '#' '$' fill comment
36+
add-highlighter shared/capnp/string region '"' (?<!\\)(\\\\)*" fill string
37+
38+
add-highlighter shared/capnp/code/ regex '(?i)\b0b[01]+l?\b' 0:value
39+
add-highlighter shared/capnp/code/ regex '(?i)\b0x[\da-f]+l?\b' 0:value
40+
add-highlighter shared/capnp/code/ regex '(?i)\b0o?[0-7]+l?\b' 0:value
41+
add-highlighter shared/capnp/code/ regex '(?i)\b([1-9]\d*|0)l?\b' 0:value
42+
add-highlighter shared/capnp/code/ regex '\b\d+[eE][+-]?\d+\b' 0:value
43+
add-highlighter shared/capnp/code/ regex '(\b\d+)?\.\d+\b' 0:value
44+
add-highlighter shared/capnp/code/ regex '\b\d+\.' 0:value
45+
46+
evaluate-commands %sh{
47+
builtin_types="Void Bool Text Data List union group Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Float32 Float64"
48+
declarations="struct union enum interface const annotation"
49+
keywords="using extends import"
50+
values="true false inf"
51+
52+
join() { sep=$2; eval set -- $1; IFS="$sep"; echo "$*"; }
53+
54+
printf %s\\n "declare-option str-list capnp_static_words $(join "${builtin_types}" ' ') $(join "${declarations}" ' ') $(join "${keywords}" ' ') $(join "${values}" ' ')"
55+
56+
printf %s\\n "add-highlighter shared/capnp/code/ regex '\b($(join "${builtin_types}" '|'))\b' 0:type"
57+
printf %s\\n "add-highlighter shared/capnp/code/ regex '\b($(join "${declarations}" '|'))\b' 0:keyword"
58+
printf %s\\n "add-highlighter shared/capnp/code/ regex '\b($(join "${keywords}" '|'))\b' 0:keyword"
59+
printf %s\\n "add-highlighter shared/capnp/code/ regex '\b($(join "${values}" '|'))\b' 0:value"
60+
}
61+
62+
# Commands
63+
# ‾‾‾‾‾‾‾‾
64+
65+
define-command -hidden capnp-trim-indent %{
66+
# remove trailing white spaces
67+
try %{ execute-keys -draft -itersel x s \h+$ <ret> d }
68+
}
69+
70+
define-command -hidden capnp-indent-on-char %<
71+
evaluate-commands -draft -itersel %<
72+
# align closer token to its opener when alone on a line
73+
try %< execute-keys -draft <a-h> <a-k> ^\h+[\]}]$ <ret> m <a-S> 1<a-&> >
74+
>
75+
>
76+
77+
define-command -hidden capnp-indent-on-new-line %<
78+
evaluate-commands -draft -itersel %<
79+
# preserve previous line indent
80+
try %{ execute-keys -draft <semicolon> K <a-&> }
81+
# filter previous line
82+
try %{ execute-keys -draft k : capnp-trim-indent <ret> }
83+
# indent after lines ending with opener token
84+
try %< execute-keys -draft k x <a-k> [[{]\h*$ <ret> j <a-gt> >
85+
# deindent closer token(s) when after cursor
86+
try %< execute-keys -draft x <a-k> ^\h*[}\]] <ret> gh / [}\]] <ret> m <a-S> 1<a-&> >
87+
>
88+
>
89+
90+
@

rc/filetype/hjson.kak

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# http://hjson.github.io
2+
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
3+
4+
# Detection
5+
# ‾‾‾‾‾‾‾‾‾
6+
7+
hook global BufCreate .*[.](hjson) %{
8+
set-option buffer filetype hjson
9+
}
10+
11+
# Initialization
12+
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
13+
14+
hook global WinSetOption filetype=hjson %{
15+
require-module hjson
16+
17+
hook window ModeChange pop:insert:.* -group hjson-trim-indent hjson-trim-indent
18+
hook window InsertChar .* -group hjson-indent hjson-indent-on-char
19+
hook window InsertChar \n -group hjson-indent hjson-indent-on-new-line
20+
21+
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window hjson-.+ }
22+
}
23+
24+
hook -group hjson-highlight global WinSetOption filetype=hjson %{
25+
add-highlighter window/hjson ref hjson
26+
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/hjson }
27+
}
28+
29+
30+
provide-module hjson %(
31+
32+
# Highlighters
33+
# ‾‾‾‾‾‾‾‾‾‾‾‾
34+
35+
add-highlighter shared/hjson regions
36+
add-highlighter shared/hjson/code default-region group
37+
add-highlighter shared/hjson/string region '"' (?<!\\)(\\\\)*" fill string
38+
add-highlighter shared/hjson/string2 region "'" (?<!\\)(\\\\)*' fill string
39+
add-highlighter shared/hjson/triple_string region -match-capture ("""|''') (?<!\\)(?:\\\\)*("""|''') fill string
40+
add-highlighter shared/hjson/comment1 region '#' '$' fill comment
41+
add-highlighter shared/hjson/comment2 region '//' '$' fill comment
42+
add-highlighter shared/hjson/multiline_comment region /\* \*/ fill comment
43+
44+
add-highlighter shared/hjson/code/ regex ^(\s*[^,:\[\]\{\}\s]+): 1:variable
45+
add-highlighter shared/hjson/code/ regex ,(\s*[^,:\[\]\{\}\s]+): 1:variable
46+
add-highlighter shared/hjson/code/ regex \{(\s*[^,:\[\]\{\}\s]+): 1:variable
47+
48+
add-highlighter shared/hjson/code/ regex ^(\s*[^,:\[\]\{\}\s]+):\s+([^\{\}\[\]:,][^\r\n]*)? 2:string
49+
add-highlighter shared/hjson/code/ regex \{(\s*[^,:\[\]\{\}\s]+):\s+([^\{\}\[\]:,][^\r\n]*)? 2:string
50+
51+
add-highlighter shared/hjson/code/ regex \b(true|false|null|\d+(?:\.\d+)?(?:[eE][+-]?\d*)?)\b 0:value
52+
53+
# Commands
54+
# ‾‾‾‾‾‾‾‾
55+
56+
define-command -hidden hjson-trim-indent %{
57+
# remove trailing white spaces
58+
try %{ execute-keys -draft -itersel x s \h+$ <ret> d }
59+
}
60+
61+
define-command -hidden hjson-indent-on-char %<
62+
evaluate-commands -draft -itersel %<
63+
# align closer token to its opener when alone on a line
64+
try %< execute-keys -draft <a-h> <a-k> ^\h+[\]}]$ <ret> m <a-S> 1<a-&> >
65+
>
66+
>
67+
68+
define-command -hidden hjson-indent-on-new-line %{
69+
evaluate-commands -itersel -draft %{
70+
execute-keys <semicolon>
71+
try %{
72+
evaluate-commands -draft -save-regs '/"' %{
73+
# copy the commenting prefix
74+
execute-keys -save-regs '' k x1s^(\h*(//|#)+\h*)<ret> y
75+
try %{
76+
# if the previous comment isn't empty, create a new one
77+
execute-keys x<a-K>^\h*(//|#)+\h*$<ret> jxs^\h*<ret>P
78+
} catch %{
79+
# if there is no text in the previous comment, remove it completely
80+
execute-keys d
81+
}
82+
}
83+
84+
# trim trailing whitespace on the previous line
85+
try %{ execute-keys -draft k x s\h+$<ret> d }
86+
}
87+
88+
try %{
89+
# if the previous line isn't within a comment scope, break
90+
execute-keys -draft kx <a-k>^(\h*/\*|\h+\*(?!/))<ret>
91+
92+
# find comment opening, validate it was not closed, and check its using star prefixes
93+
execute-keys -draft <a-?>/\*<ret><a-H> <a-K>\*/<ret> <a-k>\A\h*/\*([^\n]*\n\h*\*)*[^\n]*\n\h*.\z<ret>
94+
95+
try %{
96+
# if the previous line is opening the comment, insert star preceeded by space
97+
execute-keys -draft kx<a-k>^\h*/\*<ret>
98+
execute-keys -draft i*<space><esc>
99+
} catch %{
100+
try %{
101+
# if the next line is a comment line insert a star
102+
execute-keys -draft jx<a-k>^\h+\*<ret>
103+
execute-keys -draft i*<space><esc>
104+
} catch %{
105+
try %{
106+
# if the previous line is an empty comment line, close the comment scope
107+
execute-keys -draft kx<a-k>^\h+\*\h+$<ret> x1s\*(\h*)<ret>c/<esc>
108+
} catch %{
109+
# if the previous line is a non-empty comment line, add a star
110+
execute-keys -draft i*<space><esc>
111+
}
112+
}
113+
}
114+
115+
# trim trailing whitespace on the previous line
116+
try %{ execute-keys -draft k x s\h+$<ret> d }
117+
# align the new star with the previous one
118+
execute-keys Kx1s^[^*]*(\*)<ret>&
119+
}
120+
}
121+
}
122+
123+
)
124+

rc/filetype/hyprlang.kak

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# https://hypr.land
2+
3+
hook global BufCreate .*/hypr/.*[.]conf %{
4+
set-option buffer filetype hyprlang
5+
}
6+
7+
# Initialization
8+
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾
9+
10+
hook global WinSetOption filetype=hyprlang %{
11+
require-module hyprlang
12+
13+
hook window ModeChange pop:insert:.* -group hyprlang-trim-indent hyprlang-trim-indent
14+
hook window InsertChar .* -group hyprlang-indent hyprlang-indent-on-char
15+
hook window InsertChar \n -group hyprlang-indent hyprlang-indent-on-new-line
16+
17+
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window hyprlang-.+ }
18+
}
19+
20+
hook -group hyprlang-highlight global WinSetOption filetype=hyprlang %{
21+
add-highlighter window/hyprlang ref hyprlang
22+
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/hyprlang }
23+
}
24+
25+
provide-module hyprlang %@
26+
27+
# Highlighters
28+
# ‾‾‾‾‾‾‾‾‾‾‾‾
29+
30+
add-highlighter shared/hyprlang regions
31+
add-highlighter shared/hyprlang/code default-region group
32+
33+
add-highlighter shared/hyprlang/string region '"' (?<!\\)(\\\\)*" fill string
34+
35+
add-highlighter shared/hyprlang/line_comment region '#' $ fill comment
36+
37+
add-highlighter shared/hyprlang/code/variable regex ((?<![-:])\b\w+)\s*= 1:variable
38+
add-highlighter shared/hyprlang/code/dollarvar regex (\$\w+)\b 1:value
39+
40+
add-highlighter shared/hyprlang/code/builtin regex \b(true|false)\b 0:value
41+
add-highlighter shared/hyprlang/code/binary regex \b(0b[01_]+)\b 0:value
42+
add-highlighter shared/hyprlang/code/octal regex \b(0o[0-7_]+)\b 0:value
43+
add-highlighter shared/hyprlang/code/hex regex \b(0x[a-fA-F0-9_]+)\b 0:value
44+
add-highlighter shared/hyprlang/code/decimal regex \b([0-9-+][0-9_]*)\b 0:value
45+
add-highlighter shared/hyprlang/code/float regex \b([0-9-+][0-9_]*\.[0-9_]+)\b 0:value
46+
add-highlighter shared/hyprlang/code/float_exp regex \b([0-9-+][0-9_]*(\.[0-9_]+)?[eE][-+]?[0-9_]+)\b 0:value
47+
48+
# Commands
49+
# ‾‾‾‾‾‾‾‾
50+
51+
define-command -hidden hyprlang-trim-indent %{
52+
# remove trailing white spaces
53+
try %{ execute-keys -draft -itersel x s \h+$ <ret> d }
54+
}
55+
56+
define-command -hidden hyprlang-indent-on-char %<
57+
evaluate-commands -draft -itersel %<
58+
# align closer token to its opener when alone on a line
59+
try %< execute-keys -draft <a-h> <a-k> ^\h+[\]}]$ <ret> m <a-S> 1<a-&> >
60+
>
61+
>
62+
63+
define-command -hidden hyprlang-indent-on-new-line %<
64+
evaluate-commands -draft -itersel %<
65+
# preserve previous line indent
66+
try %{ execute-keys -draft <semicolon> K <a-&> }
67+
# filter previous line
68+
try %{ execute-keys -draft k : hyprlang-trim-indent <ret> }
69+
# indent after lines ending with opener token
70+
try %< execute-keys -draft k x <a-k> [[{]\h*$ <ret> j <a-gt> >
71+
# deindent closer token(s) when after cursor
72+
try %< execute-keys -draft x <a-k> ^\h*[}\]] <ret> gh / [}\]] <ret> m <a-S> 1<a-&> >
73+
>
74+
>
75+
76+
@

0 commit comments

Comments
 (0)