Updated kak config

This commit is contained in:
James Dugan 2025-04-26 14:26:50 -06:00
parent a4833bc635
commit c047fe2d55
21 changed files with 766 additions and 62 deletions

View file

@ -1,8 +1,8 @@
map global normal <F2> :toggle-whitespace<ret>
map global normal <F4> :buffer-switcher<ret>
map global normal <F5> :xplr<ret>
map global normal <F6> :lazygit<ret>
map global user 'p' '<a-!>pbpaste<ret>' -docstring 'Paste from clipboard'
map global user 'P' '!pbpaste<ret>' -docstring 'Paste from clipboard'
map global user 'y' '<a-|>pbcopy<ret>' -docstring 'Yank to clipboard'
map global user 'b' ':fzf-buflist<ret>' -docstring 'Select buffer from list'
map global user 'f' ':xplr<ret>' -docstring 'File finder'
map global user 'g' ':lazygit<ret>' -docstring 'Open lazygit'
map global user 'l' ':fzf-lines<ret>' -docstring 'Jump to line'
map global user 'p' ':paste-sys-after<ret>' -docstring 'Paste from clipboard after selection'
map global user 'P' ':paste-sys-before<ret>' -docstring 'Paste from clipboard before selection'
map global user 'w' ':toggle-whitespace<ret>' -docstring 'Toggle whitespace highlighter'
map global user 'y' ':yank-sys<ret>' -docstring 'Yank to clipboard'

View file

@ -1,17 +1,20 @@
colorscheme everforest-dark-soft
set-option global ui_options terminal_set_title=no terminal_assistant=cat # The cat is critically important.
set-option global ui_options terminal_set_title=no
set-option global tabstop 4
set-option global indentwidth 4
add-highlighter global/ show-matching
declare-option str windowing_placement horizontal
#declare-option str windowing_placement horizontal
# With the way that Kakoune's windowing detection is currently set up, the wezterm module will never be loaded.
# So, we need to fix the order in which windowing modules are declared.
# TODO: submit a PR to Kakoune fixing this.
declare-option str-list windowing_modules 'tmux' 'screen' 'zellij' 'kitty' 'wezterm' 'iterm' 'appleterminal' 'sway' 'wayland' 'x11'
set-option global windowing_placement horizontal
hook global WinCreate .* %{
add-highlighter window/number-lines number-lines -hlcursor
}

View file

@ -1,5 +1,5 @@
source "%val{config}/bundle/kak-bundle/rc/kak-bundle.kak"
bundle-noload kak-bundle "ln -sf ~/workspace/kak-bundle/"
bundle-noload kak-bundle "https://codeberg.org/jdugan6240/kak-bundle"
bundle kakoune-lsp "https://github.com/kakoune-lsp/kakoune-lsp" %{
set-option global lsp_diagnostic_line_error_sign 
@ -7,6 +7,8 @@ bundle kakoune-lsp "https://github.com/kakoune-lsp/kakoune-lsp" %{
set-option global lsp_diagnostic_line_info_sign
set-option global lsp_diagnostic_line_warning_sign 
set-option global lsp_hover_anchor true
# kakoune-lsp doesn't have a command to enable auto-hover per buffer,
# only supporting enabling auto-hover globally,
# which causes issues in filetypes that don't have lsp set up.
@ -35,40 +37,43 @@ bundle kakoune-lsp "https://github.com/kakoune-lsp/kakoune-lsp" %{
# We want to be explicit about lsp server settings per filetype
# So, we are disabling the default lsp server hooks
remove-hooks global lsp-filetype-.*
set global lsp_debug true
}
bundle-install-hook kakoune-lsp %{
CARGO_PROFILE_RELEASE_LTO=false cargo install --locked --force --path .
}
bundle-noload everforest.kak "ln -sf ~/workspace/everforest.kak/"
bundle-install-hook everforest.kak %{
mkdir -p "${kak_config}/colors"
ln -sf "${kak_opt_bundle_path}/everforest.kak" "${kak_config}/colors/"
}
bundle-cleaner everforest.kak %{
rm "${kak_config}/colors/everforest.kak"
}
bundle-theme everforest.kak "https://codeberg.org/jdugan6240/everforest.kak"
bundle luar "https://github.com/gustavo-hms/luar" %@
require-module luar
# Luar's highlighters are very subtly broken so we need to replace them
# TODO: submit a PR to luar with these fixes.
# Luar's highlighters are very subtly broken so we need to replace them.
# These aren't perfect either, as they assume the "lua" or "fennel" command invocation is the first thing in the line,
# but whatever - when both "lua" and "fennel" can appear in many contexts, it's hard to be robust without a true parser.
remove-highlighter shared/kakrc/code/lua
remove-highlighter shared/kakrc/lua1
remove-highlighter shared/kakrc/lua2
remove-highlighter shared/kakrc/lua3
remove-highlighter shared/kakrc/lua4
add-highlighter shared/kakrc/lua1 region -recurse '\{' '(^|\h)lua\s(([\s{}\w%/$-|''"])* )?%\{\K' '\}' ref lua
add-highlighter shared/kakrc/lua2 region -recurse '\(' '(^|\h)lua\s(([\s{}\w%/$-|''"])* )?%\(\K' '\)' ref lua
add-highlighter shared/kakrc/lua3 region -recurse '\[' '(^|\h)lua\s(([\s{}\w%/$-|''"])* )?%\[\K' '\]' ref lua
add-highlighter shared/kakrc/lua4 region -recurse '<' '(^|\h)lua\s(([\s{}\w%/$-|''"])* )?%<\K' '>' ref lua
remove-highlighter shared/kakrc/code/fennel
remove-highlighter shared/kakrc/fennel1
remove-highlighter shared/kakrc/fennel2
remove-highlighter shared/kakrc/fennel3
remove-highlighter shared/kakrc/fennel4
add-highlighter shared/kakrc/code/lua regex (^\s*)lua(?:(?=\s)|\z) 0:keyword
add-highlighter shared/kakrc/lua1 region -recurse '\{' '^\s*lua\s(([\s{}\w%/$-|''"])* )?%\{\K' '\}' ref lua
add-highlighter shared/kakrc/lua2 region -recurse '\(' '^\s*lua\s(([\s{}\w%/$-|''"])* )?%\(\K' '\)' ref lua
add-highlighter shared/kakrc/lua3 region -recurse '\[' '^\s*lua\s(([\s{}\w%/$-|''"])* )?%\[\K' '\]' ref lua
add-highlighter shared/kakrc/lua4 region -recurse '<' '^\s*lua\s(([\s{}\w%/$-|''"])* )?%<\K' '>' ref lua
add-highlighter shared/kakrc/code/fennel regex (^\s*)fennel(?:(?=\s)|\z) 0:keyword
add-highlighter shared/kakrc/fennel1 region -recurse '\{' '^\s*fennel\s(([\s{}\w%/$-|''"])* )?%\{\K' '\}' ref fennel
add-highlighter shared/kakrc/fennel2 region -recurse '\(' '^\s*fennel\s(([\s{}\w%/$-|''"])* )?%\(\K' '\)' ref fennel
add-highlighter shared/kakrc/fennel3 region -recurse '\[' '^\s*fennel\s(([\s{}\w%/$-|''"])* )?%\[\K' '\]' ref fennel
add-highlighter shared/kakrc/fennel4 region -recurse '<' '^\s*fennel\s(([\s{}\w%/$-|''"])* )?%<\K' '>' ref fennel
@
bundle kakoune-buffer-switcher "https://github.com/occivink/kakoune-buffer-switcher" %{
# Make the current buffer more visible
set-face global BufferSwitcherCurrent value
}
bundle kakoune-focus "https://github.com/caksoylar/kakoune-focus" %{
map global user <space> ':focus-toggle<ret>' -docstring "toggle selections focus"
}
@ -78,45 +83,83 @@ bundle kakship https://github.com/eburghar/kakship %{
}
bundle-install-hook kakship %{
cargo install --force --path . --root ~/.local
[ ! -e $kak_config/starship.toml ] && cp starship.toml $kak_config/
if [ ! -e $kak_config/starship.toml ]; then
cp starship.toml $kak_config/
fi
}
bundle-cleaner kakship %{
rm ~/.local/bin/kakship
}
bundle popup.kak https://github.com/enricozb/popup.kak
bundle-install-hook popup.kak %{
cargo install --force --path .
}
bundle-cleaner popup.kak %{
cargo uninstall kak-popup
}
bundle-customload kak-tree-sitter https://git.sr.ht/~hadronized/kak-tree-sitter %{
evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session }
evaluate-commands %sh{ kak-tree-sitter -dks --init $kak_session --with-highlighting -vvvvv }
# kak-tree-sitter sometimes gets out of sync during editing, especially with large files
# so, whenever we get back to normal mode, force an update
hook global ModeChange .*:normal %{
tree-sitter-buffer-update
}
}
bundle-install-hook kak-tree-sitter %{
cargo install --force --path ./kak-tree-sitter
cargo install --force --path ./ktsctl
cargo install --force --path kak-tree-sitter
cargo install --force --path ktsctl
}
bundle-cleaner kak-tree-sitter %{
cargo uninstall kak-tree-sitter
cargo uninstall ktsctl
}
bundle-noload kakeidoscope "git clone --recurse-submodules https://git.sr.ht/~orchid/kakeidoscope"
bundle kakeidoscope https://git.sr.ht/~orchid/kakeidoscope %{
#hook global WinCreate .* kakeidoscope-enable-window
}
bundle-install-hook kakeidoscope %{
cd src
make
mv kakeidoscope ~/.local/bin/
cargo install --force --path .
}
bundle-cleaner kakeidoscope %{
rm ~/.local/bin/kakeidoscope
}
bundle-updater kakeidoscope %{
git pull --recurse-submodules
cargo uninstall kakeidoscope
}
bundle peneira https://github.com/gustavo-hms/peneira %{
require-module peneira
bundle-noload kak-rainbower %{
# This is the last commit of kak-rainbower that worked
git clone https://github.com/crizan/kak-rainbower
cd kak-rainbower
git reset --hard 692c196650edd97da9ed6c275bb9b261630d063d
}%{
set-option global rainbow_mode 0
hook global WinCreate .* %{
rainbow-enable-window
}
}
bundle-install-hook kak-rainbower %{
c++ rc/rainbower.cpp -o rc/rainbower
}
bundle-updater kak-rainbower %{
# This is the last commit of kak-rainbower that worked
#git reset --hard 692c196650edd97da9ed6c275bb9b261630d063d
git reset --hard frederick-the-great
}
bundle kak-rainbow https://github.com/Bodhizafa/kak-rainbow %{
hook global WinCreate .* %{
rainbow-enable-window
}
}
bundle pairs.kak https://github.com/42xel/pairs.kak %{
pairs_enable
}
bundle parinfer-rust https://github.com/eraserhd/parinfer-rust %{
hook global WinSetOption filetype=(clojure|fennel|lisp|picolisp|racket|scheme) %{
parinfer-enable-window -smart
}
}
bundle-install-hook parinfer-rust %{
cargo install --force --path .
}
bundle-cleaner parinfer-rust %{
cargo uninstall parinfer-rust
}
# Automatically clean any unregistered plugins
bundle-clean