# ──────────────────────────────────────────────────────────────────────────────
hook global BufOpenFile .* %{
modeline-parse
- # editorconfig-load ## fucks up linters. disable for now
}
hook global BufCreate [^*].* %{
}
}
-hook global BufNewFile .* %{
- editorconfig-load
+hook global WinCreate ^[^*]+$ %{
+ editorconfig-load # needs editorconfig-core-c with use-flag "+cli" on Gentoo
}
# dynamic scrolloff
}
}
-
# session manager
# ──────────────────────────────────────────────────────────────────────────────
evaluate-commands %sh{
# Enable PLUGin manager
# ──────────────────────────────────────────────────────────────────────────────
source "%val{config}/bundle/kak-bundle/rc/kak-bundle.kak"
-bundle-noload kak-bundle https://codeberg.org/jdugan6249/kak-bundle
+bundle-noload kak-bundle https://codeberg.org/jdugan6240/kak-bundle
bundle kakoune-sudo-write https://github.com/occivink/kakoune-sudo-write
bundle kakoune-find https://github.com/occivink/kakoune-find
bundle kakoune-expand https://github.com/occivink/kakoune-expand
-bundle foot.kak https://github.com/kkga/foot.kak
+bundle foot.kak https://github.com/kkga/foot.kak
bundle kak-harpoon https://github.com/raiguard/kak-harpoon %{
hook global WinCreate .* harpoon-add-bindings
}
}
bundle-install-hook kakship %{
cargo install --force --path . --root ~/.local
- [ ! -e $kak_config/starship.toml ] && cp starship.toml $kak_config/
+ [ ! -e $kak_config/starship.toml ] && cp starship.toml $kak_config/
}
bundle-noload dabruin.kak https://git.sr.ht/~nasmevka/dabruin.kak
bundle-install-hook dabruin.kak %{
# Enable some linting and formatting
# ──────────────────────────────────────────────────────────────────────────────
- hook global WinSetOption filetype=js %{
- set window formatcmd 'npx prettier --stdin-filepath $kak_buffile<ret><space>;'
- }
- hook global WinSetOption filetype=css %{
- set-option window lintcmd "npx stylelint --formatter unix --stdin-filename='%val{buffile}'"
- }
- hook global WinSetOption filetype=scss %{
- set window formatcmd 'npx prettier --parser scss --stdin-filepath $kak_buffile<ret><space>;'
- }
- hook global WinSetOption filetype=less %{
- set window formatcmd 'npx prettier --parser less --stdin-filepath $kak_buffile<ret><space>;'
- }
- hook global WinSetOption filetype=html %{
- set window formatcmd 'npx prettier --parser html --stdin-filepath $kak_buffile<ret><space>;'
- }
- hook global WinSetOption filetype=(json|jsonc) %{
- set-option window lintcmd %{ run() { cat -- "$1" | jq 2>&1 | awk -v filename="$1" '/ at line [0-9]+, column [0-9]+$/ { line=$(NF - 2); column=$NF; sub(/ at line [0-9]+, column [0-9]+$/, ""); printf "%s:%d:%d: error: %s", filename, line, column, $0; }'; } && run }
- }
- hook global WinSetOption filetype=md %{
- set window formatcmd 'npx prettier --parser md --stdin-filepath $kak_buffile<ret><space>;'
+ hook global WinSetOption filetype=js %{
+ set window formatcmd 'npx prettier --stdin-filepath $kak_buffile<ret><space>;'
+ }
+ hook global WinSetOption filetype=css %{
+ set-option window lintcmd "npx stylelint --formatter unix --stdin-filename='%val{buffile}'"
+ }
+ hook global WinSetOption filetype=scss %{
+ set window formatcmd 'npx prettier --parser scss --stdin-filepath $kak_buffile<ret><space>;'
+ }
+ hook global WinSetOption filetype=less %{
+ set window formatcmd 'npx prettier --parser less --stdin-filepath $kak_buffile<ret><space>;'
+ }
+ hook global WinSetOption filetype=html %{
+ set window formatcmd 'npx prettier --parser html --stdin-filepath $kak_buffile<ret><space>;'
+ }
+ hook global WinSetOption filetype=(json|jsonc) %{
+ set-option window lintcmd %{ run() { cat -- "$1" | jq 2>&1 | awk -v filename="$1" '/ at line [0-9]+, column [0-9]+$/ { line=$(NF - 2); column=$NF; sub(/ at line [0-9]+, column [0-9]+$/, ""); printf "%s:%d:%d: error: %s", filename, line, column, $0; }'; } && run }
+ }
+ hook global WinSetOption filetype=md %{
+ set window formatcmd 'npx prettier --parser md --stdin-filepath $kak_buffile<ret><space>;'
}
hook global WinSetOption filetype=sh %{
# needs shfmt: $ go install mvdan.cc/sh/v3/cmd/shfmt@latest
set-option buffer formatcmd "shfmt"
set-option window lintcmd "shellcheck -fgcc -Cnever"
}
- hook global WinSetOption filetype=yaml %{
- set window formatcmd 'npx prettier --parser yaml --stdin-filepath $kak_buffile<ret><space>;'
+ hook global WinSetOption filetype=yaml %{
+ set window formatcmd 'npx prettier --parser yaml --stdin-filepath $kak_buffile<ret><space>;'
set-option window lintcmd %{
run() {
# change [message-type] to message-type:
yamllint -f parsable "$1" | sed 's/ \[\(.*\)\] / \1: /'
} && run }
- }
+ }
# Look and Feel
# Undo colour changes when we leave insert mode.
hook global ModeChange (push|pop):insert:.* %{
- unset-face window StatusLine
+ unset-face window StatusLine
}
# ──────────────────────────────────────────────────────────────────────────────
map global user -docstring '(b)uffer mode' b ': enter-user-mode buffermode<ret>'
map global user -docstring '(s)election mode' s ': enter-user-mode selmode<ret>'
-map global user -docstring ':::::::::::::::::::::::::::::::: ::' : ': buffer *scratch*<ret>'
-map global user -docstring '(S)cratch buffer goto' S ': buffer *scratch*<ret>'
-map global user -docstring '(D)ebug buffer goto' D ': buffer *debug*<ret>'
+map global user -docstring ':::::::::::::::::::::::::::::::: ::' : ': <esc>'
+map global user -docstring 'goto (S)cratch buffer' S ': buffer *scratch*<ret>'
+map global user -docstring 'goto (D)ebug buffer' D ': buffer *debug*<ret>'
map global user -docstring '(e)xpand selection' e ': expand<ret>'
map global user -docstring '(E)dit kakrc' E ': e ~/.config/kak/kakrc<ret>'
map global user -docstring '(r)elative line numbers enable' r ': addhl window/nl number-lines -min-digits 3 -relative -hlcursor<ret>'
# buffer user mode
# ──────────────────────────────────────────────────────────────────────────────
declare-user-mode buffermode
-map global buffermode -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert<ret>'
-map global buffermode -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
-map global buffermode -docstring 'clean tabs and trailing whitespaces' c ': clean-buffer<ret>'
-map global buffermode -docstring 'delete buffer' d ': delete-buffer<ret>'
-map global buffermode -docstring 'buffer picker' l ': kks-connect terminal-popup kks-buffers<ret>'
-map global buffermode -docstring 'Lint buffer' L ': buffer *lint-output*<ret>'
-map global buffermode -docstring 'Next buffer ' n ': buffer-next<ret>'
-map global buffermode -docstring 'Previous buffer' p ': buffer-previous<ret>'
-map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
-map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
+map global buffermode -docstring 'enable (a)utocomplete' a ': set-option -add buffer autocomplete insert<ret>'
+map global buffermode -docstring 'disable (A)utocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
+map global buffermode -docstring '(c)lean tabs and trailing whitespaces' c ': clean-buffer<ret>'
+map global buffermode -docstring '(d)elete buffer' d ': delete-buffer<ret>'
+map global buffermode -docstring '(l)ist buffers' l ': kks-connect terminal-popup kks-buffers<ret>'
+map global buffermode -docstring '(L)int buffer' L ': buffer *lint-output*<ret>'
+map global buffermode -docstring '(n)ext buffer' n ': buffer-next<ret>'
+map global buffermode -docstring '(p)revious buffer' p ': buffer-previous<ret>'
+map global buffermode -docstring '(w)rap enable' w ': add-highlighter buffer/bw wrap<ret>'
+map global buffermode -docstring '(W)rap disable' W ': remove-highlighter buffer/bw<ret>'
# selection user mode
# ──────────────────────────────────────────────────────────────────────────────
# ──────────────────────────────────────────────────────────────────────────────
set-option global foot_normal_cmd 'footclient'
set-option global foot_popup_cmd 'footclient'
-set-option global foot_normal_flags ''
-set-option global foot_popup_flags '-a kakpopup'
set-option global foot_panel_cmd 'footclient'
+set-option global foot_normal_flags ''
+set-option global foot_popup_flags '-a kakpopup' '-W 250x50'
+set-option global foot_panel_flags '-a kakpopup' '-W 400x1'
# language config
# ──────────────────────────────────────────────────────────────────────────────