aboutsummaryrefslogtreecommitdiff
path: root/autoload/+init.kak
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-11-14 20:15:04 +0530
committerAkshay Nair <phenax5@gmail.com>2025-11-14 20:15:04 +0530
commit8d7b9f00c55cc6e005344af4a145adbbbc39bc1d (patch)
treeda832a5dc0364598755ba854ff8618bc423e706d /autoload/+init.kak
parent9fa923bf92e56f51079e10b4144fb9c8dd24b1d9 (diff)
downloadkakoune-config-8d7b9f00c55cc6e005344af4a145adbbbc39bc1d.tar.gz
kakoune-config-8d7b9f00c55cc6e005344af4a145adbbbc39bc1d.zip
Add toolsclient and highlighter changes
Diffstat (limited to 'autoload/+init.kak')
-rw-r--r--autoload/+init.kak28
1 files changed, 22 insertions, 6 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 '<esc>' ': set-register slash ""<ret>' -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 ""<left>' -docstring 'Set compile command'
map global system p ': info %val{buffile}<ret>' -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<ret>' -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 ""<left>' -docstring 'Insert output'
map global ai | '|ai ""<left>' -docstring 'Replace output'
# Editorconfig
-hook global BufOpenFile .* %{ try %{ editorconfig-load } }
-hook global BufNewFile .* %{ try %{ editorconfig-load } }
+hook global WinCreate ^[^*]+$ %{editorconfig-load}
+