From cc2053ee1beeb65c93dacb68a67e670adc445fa5 Mon Sep 17 00:00:00 2001 From: Andre Ramnitz Date: Tue, 13 Jan 2026 00:54:38 +0100 Subject: [PATCH] update config --- kakrc | 28 ++++++++++++++++++++-------- languagecmd.kak | 25 +++++++++++++++++++------ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/kakrc b/kakrc index 05d2256..f3f2a8a 100644 --- a/kakrc +++ b/kakrc @@ -50,8 +50,6 @@ hook global WinCreate [^*].* %{ evaluate-commands %sh{ kks init } define-command -override kks-connect -params 1.. -command-completion %{ %arg{1} sh -c %{ - export EDITOR='kks edit' - export VISUAL='kks edit' export KKS_SESSION=$1 export KKS_CLIENT=$2 shift 3 @@ -75,6 +73,7 @@ bundle kakoune-expand https://github.com/occivink/kakoune-expand bundle foot.kak https://github.com/kkga/foot.kak bundle kakoune-surround https://github.com/h-youhei/kakoune-surround bundle shadow.kak https://github.com/ftonneau/shadow.kak +bundle small.kak https://git.sr.ht/~nasmevka/small.kak bundle kakship https://github.com/eburghar/kakship %{ kakship-enable } @@ -133,6 +132,14 @@ source %sh{ echo ${kak_config}/languagecmd.kak # boilerplate from https://git.sr.ht/~nasmevka } +# Small.kak config +# ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── +define-command -hidden -docstring %{ + enter-spacemode: transform all tabulations as spaces and launch small-spacetab. +} enter-spacemode %{ + try %{ execute-keys 'Z%s\t@z' } + small-spacetab-kak +} # Shadow.kak config # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── @@ -145,9 +152,9 @@ border ^\h*``` default,rgb:c9afaf # kak shadow-set kak \ -comment ^# ^# nofirst nolast default +comment ^# \n\h* first last default,rgb:1d1c1d shadow-decorate kak \ -border ^# default,rgb:222222 +border ^\h# default,rgb:222222 # Look and Feel @@ -263,7 +270,7 @@ hook -always global PromptIdle '' update_hex_color_code_ranges2 # default normal mode kks mappings # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -map global normal -docstring 'terminal' ': kks-connect terminal' +map global normal -docstring 'terminal' ': kks-connect terminal' map global normal -docstring 'terminal' ': kks-connect terminal' map global normal -docstring 'files' ': kks-connect popup kks-files' map global normal -docstring 'files' ': kks-connect popup kks-files' @@ -305,9 +312,9 @@ map global normal -docstring 'help' ': map global user -docstring 'buffer mode' b ': enter-user-mode buffermode' map global user -docstring 'git mode' g ': enter-user-mode gitmode' map global user -docstring 'selection mode' s ': enter-user-mode selmode' -# map global user -docstring 'LSP mode' l ': enter-user-mode lsp' -map global user -docstring 'Table mode' t ': enter-user-mode table' -map global user -docstring 'Table mode (locked)' T ': enter-user-mode -lock table' +# map global user -docstring 'LSP mode' l ': enter-user-mode lsp' +map global user -docstring 'Table mode' t ': enter-user-mode table' +map global user -docstring 'Table mode (locked)' T ': enter-user-mode -lock table' map global user -docstring ':::::::::::::::::::::::::::::::: ::' : ': ' map global user -docstring 'Edit kakrc' E ': e ~/.config/kak/kakrc' map global user -docstring 'highlight hex color without leading #' p ': addhl global/hex_color_code2 ref hex_color_code2' @@ -329,6 +336,11 @@ map global user -docstring 'case insensitive extend search' '?' ?(? map global user -docstring 'case insensitive backward extend-search' '' (?i) +# ui overrides +# ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── +map global prompt +map global prompt + # kak-lsp keys # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── # map global insert ':try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks tab> }' -docstring 'Select next snippet placeholder' diff --git a/languagecmd.kak b/languagecmd.kak index ce15ee5..faf261b 100644 --- a/languagecmd.kak +++ b/languagecmd.kak @@ -1,10 +1,18 @@ ## Languages # ────────────────────────────────────────────────────────────────────────────── # stolen from git.sr.ht/~nasmevka/kak +### kak +hook -group languagecmd global WinSetOption filetype=kakrc %{ + set-option buffer tabstop 4 + set-option buffer indentwidth 4 + enter-spacemode + add-highlighter buffer/kakrc-whitespaces show-whitespaces -indent '¦' -spc ' ' -lf ' ' +} + ### golang hook -group languagecmd global WinSetOption filetype=go %{ set-option buffer formatcmd 'gofumpt' - set-option buffer lintcmd "golangci-lint run --out-format=line-number --uniq-by-line=true --allow-parallel-runners | grep %val{bufname} #" + set-option buffer lintcmd "golangci-lint run --out-format=line-number --uniq-by-line=true --allow-parallel-runners | grep %val{bufname} #" } ### json @@ -15,8 +23,12 @@ hook -group languagecmd global WinSetOption filetype=(json|jsonc) %{ ### python hook -group languagecmd global WinSetOption filetype=python %{ - set-option buffer formatcmd 'black --line-length 150 -' - set-option buffer lintcmd 'ruff check --format=text --line-length=150' + set-option buffer formatcmd 'ruff format --line-length 150 -' + set-option buffer lintcmd 'ruff check --output-format=concise --line-length=150' + set-option buffer tabstop 4 + set-option buffer indentwidth 4 + enter-spacemode + add-highlighter buffer/python-whitespaces show-whitespaces -indent '¦' -spc ' ' -lf ' ' } ### shell @@ -66,8 +78,8 @@ hook -group languagecmd global WinSetOption filetype=d %{ ### Hare hook -group languagecmd global WinSetOption filetype=hare %{ - set-option buffer tabstop 8 - set-option buffer indentwidth 8 + set-option buffer tabstop 8 + set-option buffer indentwidth 8 } ### CSS @@ -84,7 +96,8 @@ hook global WinSetOption filetype=yaml %{ yamllint -f parsable "$1" | sed 's/ \[\(.*\)\] / \1: /' } && run } set-option buffer formatcmd "npx prettier --parser yaml --stdin-filepath=%val{buffile}" - + set-option buffer tabstop 2 + set-option buffer indentwidth 2 } ### TODO: add corresponding linter -- 2.52.0