This commit is contained in:
Michael Chalupiak
2025-11-14 00:14:06 -05:00
parent 792c4d50ce
commit 2b86bb9142
7 changed files with 451 additions and 127 deletions

View File

@@ -49,10 +49,11 @@ plug "https://git.sr.ht/~hadronized/kakoune-tree-sitter-themes" theme
set-option global luar_interpreter luajit
## Treesitter ##
# eval %sh{ kak-tree-sitter -dksvvv --with-highlighting --with-text-objects --init $kak_session }
eval %sh{ kak-tree-sitter -dksvvv --with-highlighting --with-text-objects --init $kak_session }
#eval %sh{ kak-tree-sitter -dks --with-text-objects --session $kak_session }
#eval %sh{ kak-tree-sitter -dks --with-highlighting --session $kak_session }
eval %sh{ kak-tree-sitter -dksvvv --init $kak_session }
#eval %sh{ kak-tree-sitter -dksvvv --init $kak_session }
#
# evaluate-commands %sh{
# echo "colorscheme base16-$BASE16_THEME"
# }
@@ -63,12 +64,14 @@ evaluate-commands %sh{kak-popup init}
## Highlighting ##
hook global WinCreate .* %{ add-highlighter window/number-lines number-lines -relative -hlcursor}
add-highlighter global/ show-matching
add-highlighter global/ column 80 MenuForeground
add-highlighter global/ show-whitespaces
add-highlighter global/ column 80 MenuBackground
add-highlighter global/ show-whitespaces -spc " " -nbsp ""
#add-highlighter global/ show-whitespaces -nbsp "" -lf "" -indent "|"
## Wrapping ##
add-highlighter global/ wrap -word -indent
## Formatting ##
# define-command enable-autofmt -docstring 'enable autoformatting of buffer' %{
#
@@ -108,7 +111,6 @@ add-highlighter global/ wrap -word -indent
# format
# }
# }
#
# hook global -group autofmt BufSetOption filetype=(javascript) %{
# set-option buffer formatcmd 'prettier --tab-width 4 --parser typescript'
#
@@ -151,6 +153,26 @@ hook global BufCreate .* %{
autoconfigtab
}
define-command set-spell -docstring 'Enable spellcheck' %{
# hook -group spellcheck global BufOpenFile .* %{
hook -group spellcheck buffer InsertChar .* %{
evaluate-commands %{
spell
}
}
hook -group spellcheck buffer InsertDelete .* %{
evaluate-commands %{
spell
}
}
# }
}
define-command set-nospell -docstring 'Disable spellcheck' %{
remove-hooks buffer spellcheck
}
define-command sleuth -docstring 'Heuristically set buffer options' %{
try %{
evaluate-commands -draft %{
@@ -201,29 +223,16 @@ define-command sleuth-disable -docstring 'Disable sleuth' %{
}
## LSP ##
# lsp-enable
# lsp-inlay-diagnostics-enable global
hook global WinSetOption filetype=(c|zig|python|ruby|lua|java|html|css|swift) %{
# set-option window lsp_auto_highlight_references true
set-option window lsp_hover_anchor true
lsp-auto-hover-enable
#lsp-auto-hover-insert-mode-enable
lsp-auto-signature-help-enable
lsp-inlay-hints-enable global
lsp-enable-window
}
lsp-enable
lsp-inlay-diagnostics-enable global
set-option global lsp_auto_highlight_references true
set-option global lsp_hover_anchor true
lsp-auto-signature-help-enable
lsp-inlay-hints-enable global
hook global WinSetOption filetype=(rust) %{
set-option window lsp_auto_highlight_references true
set-option window lsp_hover_anchor true
lsp-auto-hover-enable
#lsp-auto-hover-insert-mode-enable
lsp-auto-signature-help-enable
lsp-inlay-hints-enable global
lsp-enable-window
}
map global user k ':lsp-hover'
hook global WinSetOption filetype=(c|zig|rust|python|ruby|lua|java|html|css) %{
hook global WinSetOption filetype=(c|cpp|zig|rust|python|ruby|lua|java|html|css) %{
hook window -group semantic-tokens BufReload .* lsp-semantic-tokens
hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens
hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens
@@ -253,6 +262,19 @@ hook -group lsp-filetype-swift global BufSetOption filetype=swift %{
}
}
hook -group lsp-filetype-typst global BufSetOption filetype=typst %{
set-option buffer lsp_servers %{
[tinymist]
root_globs = [".git", ".hg"]
args = ["lsp"]
settings_section = "_"
[tinymist.settings._]
# See https://myriad-dreamin.github.io/tinymist/configurations.html
exportPdf = "onType"
# formatterMode = "typstyle"
# previewFeature = "disable"
}
}
set-option global lsp_config %{
}
@@ -493,4 +515,4 @@ map -docstring 'next spell check' global spell n ':spell-next<ret>'
map -docstring 'spell check replacements' global spell r ':spell-replace<ret>'
map -docstring 'quit kakoune' global user q ':q!<ret>'
colorscheme base16-rose-pine
colorscheme carbonfox