aboutsummaryrefslogtreecommitdiffstats
path: root/kak
diff options
context:
space:
mode:
Diffstat (limited to 'kak')
-rw-r--r--kak/.config/kak-lsp/kak-lsp.toml57
-rw-r--r--kak/.config/kak/kakrc62
m---------kak/.config/kak/plugins/kak-lsp0
m---------kak/.config/kak/plugins/plug.kak0
4 files changed, 119 insertions, 0 deletions
diff --git a/kak/.config/kak-lsp/kak-lsp.toml b/kak/.config/kak-lsp/kak-lsp.toml
new file mode 100644
index 0000000..8468450
--- /dev/null
+++ b/kak/.config/kak-lsp/kak-lsp.toml
@@ -0,0 +1,57 @@
+snippet_support = true
+verbosity = 2
+
+[semantic_scopes]
+# Map textmate scopes to kakoune faces for semantic highlighting
+# the underscores are translated to dots, and indicate nesting.
+# That is, if variable_other_field is omitted, it will try the face for
+# variable_other and then variable
+#
+# To see a list of available scopes in the debug buffer, run lsp-semantic-available-scopes
+variable = "variable"
+entity_name_function = "function"
+entity_name_type = "type"
+variable_other_enummember = "variable"
+entity_name_namespace = "module"
+
+# Semantic tokens support
+# See https://github.com/microsoft/vscode-languageserver-node/blob/8c8981eb4fb6adec27bf1bb5390a0f8f7df2899e/client/src/semanticTokens.proposed.ts#L288
+# for token/modifier types.
+
+[semantic_tokens]
+type = "type"
+variable = "variable"
+namespace = "module"
+function = "function"
+string = "string"
+keyword = "keyword"
+operator = "operator"
+comment = "comment"
+
+[semantic_token_modifiers]
+documentation = "documentation"
+readonly = "default+d"
+
+[server]
+# exit session if no requests were received during given period in seconds
+# works only in unix sockets mode (-s/--session)
+# set to 0 to disable
+timeout = 1800 # seconds = 30 minutes
+
+[language.bash]
+filetypes = ["sh"]
+roots = [".git", ".hg"]
+command = "bash-language-server"
+args = ["start"]
+
+#[language.deno]
+#filetypes = ["typescript", "javascript"]
+#roots = [".git"]
+#command = "deno"
+#args = ["lsp"]
+
+[language.typescript]
+filetypes = ["typescript"]
+roots = ["tsconfig.json"]
+command = "typescript-language-server"
+args = ["--stdio"]
diff --git a/kak/.config/kak/kakrc b/kak/.config/kak/kakrc
new file mode 100644
index 0000000..80b9252
--- /dev/null
+++ b/kak/.config/kak/kakrc
@@ -0,0 +1,62 @@
+colorscheme gruvbox
+
+set-option global tabstop 4
+set-option global indentwidth 4
+
+set-option global scrolloff 1,3
+
+#set-option global ui_options ncurses_status_on_top=true
+
+add-highlighter global/ number-lines -hlcursor -relative
+
+add-highlighter global/ regex \h+$ 0:Error
+
+add-highlighter global/ wrap -word -indent
+
+#set-option global autoinfo normal
+
+
+# setup plug.kak
+source "%val{config}/plugins/plug.kak/rc/plug.kak"
+
+plug "kak-lsp/kak-lsp" do %{
+ cargo install --locked --force --path .
+} config %{
+ # uncomment to enable debugging
+ # eval %sh{echo ${kak_opt_lsp_cmd} >> /tmp/kak-lsp.log}
+ # set global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log"
+ # this is not necessary; the `lsp-enable-window` will take care of it
+ # eval %sh{${kak_opt_lsp_cmd} --kakoune -s $kak_session}
+ set global lsp_diagnostic_line_error_sign '║'
+ set global lsp_diagnostic_line_warning_sign '┊'
+ define-command ne -docstring 'go to next error/warning from lsp' %{ lsp-find-error --include-warnings }
+ define-command pe -docstring 'go to previous error/warning from lsp' %{ lsp-find-error --previous --include-warnings }
+ define-command ee -docstring 'go to current error/warning from lsp' %{ lsp-find-error --include-warnings; lsp-find-error --previous --include-warnings }
+
+ define-command lsp-restart -docstring 'restar lsp server' %{ lsp-stop; lsp-start }
+ hook global WinSetOption filetype=(c|cpp|cc|rust|javascript|typescript) %{
+ set-option window lsp_auto_highlight_references true
+ set-option window lsp_hover_anchor false
+ lsp-auto-hover-enable
+ echo -debug "Enabling LSP for filetype %opt{filetype}"
+ lsp-enable-window
+ }
+
+ hook global WinSetOption filetype=(rust) %{
+ set window lsp_server_configuration rust.clippy_preference="on"
+ }
+
+ hook global WinSetOption filetype=rust %{
+ hook window BufWritePre .* %{
+ evaluate-commands %sh{
+ test -f rustfmt.toml %% printf lsp-formatting-sync
+ }
+ }
+ }
+
+ hook global KakEnd .* lsp-exit
+}
+
+# enable lsp
+#eval %sh{kak-lsp --kakoune -s $kak_session}
+#lsp-enable
diff --git a/kak/.config/kak/plugins/kak-lsp b/kak/.config/kak/plugins/kak-lsp
new file mode 160000
+Subproject 188e87f7f86537070ad0e1b56f81ca753135f68
diff --git a/kak/.config/kak/plugins/plug.kak b/kak/.config/kak/plugins/plug.kak
new file mode 160000
+Subproject cf02b00f3764cbd03ce9ab6eec2f4eed035c073