source %sh{echo ${kak_config}/$1.kak}
}
+
# Clipboard (wayland) integration
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hook global NormalKey y %{ nop %sh{
# run on file open
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-hook global BufOpenFile .* %{
- modeline-parse
-}
-
hook global BufCreate [^*].* %{
nop %sh{
mru=~/.cache/kak-mru
editorconfig-load # needs editorconfig-core-c with use-flag "+cli" on Gentoo
}
+hook global BufOpenFile .* %{
+ modeline-parse
+}
+
# dynamic scrolloff
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hook global WinCreate [^*].* %{
set-option buffer formatcmd "prettier --stdin-filepath=%val{buffile}"
}
hook global WinSetOption filetype=scss %{
- set window formatcmd 'npx prettier --parser scss --stdin-filepath $kak_buffile<ret><space>;'
+ set-option buffer formatcmd 'npx prettier --parser scss --stdin-filepath=%val{buffile}'
}
hook global WinSetOption filetype=less %{
- set window formatcmd 'npx prettier --parser less --stdin-filepath $kak_buffile<ret><space>;'
+ set-option buffer formatcmd 'npx prettier --parser less --stdin-filepath=%val{buffile}'
}
hook global WinSetOption filetype=html %{
- set window formatcmd 'npx prettier --parser html --stdin-filepath $kak_buffile<ret><space>;'
+ set-option buffer formatcmd 'npx prettier --parser html --stdin-filepath=%val{buffile}'
}
hook global WinSetOption filetype=md %{
- set window formatcmd 'npx prettier --parser md --stdin-filepath $kak_buffile<ret><space>;'
+ set-option buffer formatcmd 'npx prettier --parser md --stdin-filepath=%val{buffile}'
}
hook global WinSetOption filetype=sh %{
# needs shfmt: $ go install mvdan.cc/sh/v3/cmd/shfmt@latest
set-option buffer formatcmd "shfmt -i 4 -ci -sr -"
}
hook global WinSetOption filetype=yaml %{
- set window formatcmd 'npx prettier --parser yaml --stdin-filepath $kak_buffile<ret><space>;'
+ set-option buffer formatcmd "npx prettier --parser yaml --stdin-filepath=%val{buffile}"
}
hook global WinSetOption filetype=(json|jsonc) %{
- set-option window formatcmd "jq --indent %opt{tabstop} ."
+ set-option buffer formatcmd "jq --indent %opt{tabstop} ."
}
# Enable some code linters
# Different Cursor color in insert mode
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-# Shades of green/yellow for insert mode.
+# Recolor the status line on insert mode.
hook global ModeChange (push|pop):.*:insert %{
set-face window StatusLine black,yellow
set-face window StatusLineInfo blue,black