From 8d7b9f00c55cc6e005344af4a145adbbbc39bc1d Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 14 Nov 2025 20:15:04 +0530 Subject: Add toolsclient and highlighter changes --- autoload/+init.kak | 28 ++++++++++++++++++++++------ autoload/window.kak | 12 +++++++++++- colors/phenax.kak | 4 +++- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/autoload/+init.kak b/autoload/+init.kak index a34832b..94c5c44 100644 --- a/autoload/+init.kak +++ b/autoload/+init.kak @@ -24,24 +24,29 @@ set-option -add global path "**" set-option global startup_info_version 20250603 set-option global scrolloff 10,3 set-option -add global ui_options terminal_enable_mouse=false terminal_set_title=true + +# Modeline +# declare-option -hidden _lsp_modeline_diagnostics "%opt{lsp_diagnostic_error_count}" +# %opt{lsp_modeline_breadcrumbs} set-option global modelinefmt \ -'%opt{lsp_modeline_progress} {StatusLineDetails}{{context_info}} {{mode_info}} +'{StatusLineExtras}%opt{lsp_modeline_progress} +{StatusLineDetails}{{context_info}} {{mode_info}} %val{cursor_line}/%val{buf_line_count}:%val{cursor_char_column} {StatusLineBufname}%sh{echo "$kak_bufname" | awk -F/ "{if (NF >= 2) {print \$(NF-1) \"/\" \$NF} else {print \$NF}}"}' # Highlighters add-highlighter global/ number-lines -relative -hlcursor -min-digits 3 -separator ' ' -add-highlighter global/ column '%opt{autowrap_column}' WrapLine add-highlighter global/ column '%val{cursor_char_column}' ColumnLine add-highlighter global/ line '%val{cursor_line}' RowLine add-highlighter global/ regex \h+$ 0:Error # Highlight trailing whitespaces -add-highlighter global/ wrap -word -indent # Softwrap long lines add-highlighter global/ show-matching -previous add-highlighter global/ show-whitespaces -spc ' ' -tab '│' -lf '¬' -indent '│' hook global RegisterModified '/' %{ - # Highlight current searchterm + # @todo: Highlight current searchterm + # TODO: Highlight current searchterm add-highlighter -override global/search regex "%reg{/}" 0:search } +add-highlighter global/ regex \b(TODO|FIXME|@todo|@fixme)\b 0:default+rb # Misc keys map global user '' ': set-register slash ""' -docstring 'Clear search highlighting' @@ -63,6 +68,17 @@ map global system f ':set buffer filetype ' -docstring 'Set filetype' map global system m ':set buffer makecmd ""' -docstring 'Set compile command' map global system p ': info %val{buffile}' -docstring 'Print file path' +# Wrapping +set-option global autowrap_column 100 +hook global WinSetOption filetype=git-commit %{ + set window autowrap_column 72 + autowrap-enable +} +add-highlighter global/ column '%opt{autowrap_column}' WrapLine +add-highlighter global/ wrap -word -indent # Softwrap long lines +map global normal = '|fmt -w $kak_opt_autowrap_column' -docstring 'Wrap text with fmt' + + # Preserve count for user modes (look for alternatives) # TODO: Reset count on modechange? declare-option -hidden int user_mode_count 0 @@ -89,5 +105,5 @@ map global ai ! '!ai ""' -docstring 'Insert output' map global ai | '|ai ""' -docstring 'Replace output' # Editorconfig -hook global BufOpenFile .* %{ try %{ editorconfig-load } } -hook global BufNewFile .* %{ try %{ editorconfig-load } } +hook global WinCreate ^[^*]+$ %{editorconfig-load} + diff --git a/autoload/window.kak b/autoload/window.kak index acf9157..b3b9371 100644 --- a/autoload/window.kak +++ b/autoload/window.kak @@ -7,7 +7,17 @@ map global win s ': tmux-terminal-horizontal kak -c %val{session}' -docstri map global win v ': tmux-terminal-vertical kak -c %val{session}' -docstring 'Split horizontal' map global win z ': wq' -define-command terminal-singleton -params 2.. -docstring 'terminal-singleton [args...]' %{ +def toolsclient %{ + rename-client main + set global jumpclient main + + try %{ eval -client tools nop } catch %{ + tmux-terminal-vertical kak -c %val{session} -e 'rename-client tools' + set global toolsclient tools + } +} + +def terminal-singleton -params 2.. -docstring 'terminal-singleton [args...]' %{ eval %sh{ name="$1"; shift 1; diff --git a/colors/phenax.kak b/colors/phenax.kak index a523da0..0efdc46 100644 --- a/colors/phenax.kak +++ b/colors/phenax.kak @@ -57,7 +57,7 @@ evaluate-commands %sh{ face global bullet ${red} face global list ${red} face global inlineBold ${accent2}+b - face global inlineItalic +i + face global inlineItalic default face global inlineStrikethrough ${foreground3}+fs face global inlineUnderline ${foreground}+fu face global inlineCode ${foreground2},${mildhighlight2}+a @@ -87,6 +87,8 @@ evaluate-commands %sh{ face global RowLine default,rgb:101010 face global WrapLine default,rgb:101010 face global StatusLineBufname ${accent1},default+b + face global StatusLineDetails ${foreground2} + face global StatusLineExtras ${foreground4} face global WrapLine default,rgb:101010 " -- cgit v1.3.1