First commit

This commit is contained in:
James Dugan 2025-02-04 21:06:01 -07:00
commit 847c9e64c0
51 changed files with 4058 additions and 0 deletions

View file

@ -0,0 +1,22 @@
hook global WinSetOption filetype=go %{
set-option buffer lsp_servers %{
[gopls]
root_globs = ["go.mod", ".git", ".hg"]
command = "gopls"
[gopls.settings.gopls]
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
# "build.buildFlags" = []
gofumpt = true
hints.assignVariableTypes = true
hints.compositeLiteralFields = true
hints.compositeLiteralTypes = true
hints.constantValues = true
hints.functionTypeParameters = true
hints.parameterNames = true
hints.rangeVariableTypes = true
usePlaceholders = true
semanticTokens = true
}
lsp-enable-buffer
lsp-semantic-tokens-enable
}

View file

@ -0,0 +1,13 @@
hook global WinSetOption filetype=kak %{
softtab-enable
}
hook global ModuleLoaded kak %@
# toml highlighting for lsp_servers
require-module toml
try %~
add-highlighter shared/kakrc/lsp_servers region -recurse '\{' '\blsp_servers\s+%\{' '\}' ref toml
~ catch %$
echo -debug "Error: kakrc: can't declare additional kakrc highlighters: %val{error}"
$
@

View file

@ -0,0 +1,10 @@
hook global WinSetOption filetype=lua %{
set-option buffer lsp_servers %{
[lua-language-server]
root_globs = [".luarc.json", ".git", ".hg"]
command = "lua-language-server"
}
lsp-semantic-tokens-enable
softtab-enable
lsp-enable-buffer
}

View file

@ -0,0 +1,22 @@
hook global WinSetOption filetype=python %{
set-option buffer lsp_servers %{
[basedpyright] # pretty much a strict upgrade over vanilla pyright
root_globs = ["requirements.txt", "setup.py", "pyrightconfig.json", ".git", ".hg"]
command = "basedpyright-langserver"
args = ["--stdio"]
[ruff]
root_globs = ["requirements.txt", "setup.py", "pyrightconfig.json", ".git", ".hg"]
command = "ruff"
args = ["server", "--preview"]
}
lsp-enable-buffer
lsp-semantic-tokens-enable
softtab-enable
}
hook global ModuleLoaded python %{
# By default, Kakoune highlights the "import" and "from" keywords in the "meta" face.
# This is incorrect - they should be highlighted as keywords.
# So, we override the builtin highlighter with our own.
add-highlighter shared/python/code/ regex '\b(import|from)\b' 0:keyword
}

View file

@ -0,0 +1,3 @@
hook global BufSetOption tree_sitter_lang=sh %{
set-option buffer tree_sitter_lang bash
}

View file

@ -0,0 +1,5 @@
hook global WinSetOption filetype=yaml %{
set-option global tabstop 2
set-option global indentwidth 2
softtab
}