From: Andre Ramnitz Date: Wed, 27 Nov 2024 23:00:49 +0000 (+0100) Subject: kak: add kak-lsp, also fix kkga/kks X-Git-Tag: v0.3~43 X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=06179bace6b8c6d8de60be364de016b820e0c548;p=dotfiles.git kak: add kak-lsp, also fix kkga/kks --- diff --git a/dot-config/kak/kakrc b/dot-config/kak/kakrc index 759dc100..0875b5ac 100644 --- a/dot-config/kak/kakrc +++ b/dot-config/kak/kakrc @@ -11,7 +11,6 @@ def import -override -params 1 %{ source %sh{echo ${kak_config}/$1.kak} } - # Clipboard (wayland) integration # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── hook global NormalKey y %{ nop %sh{ @@ -50,9 +49,24 @@ hook global WinCreate [^*].* %{ # session manager integration (kkga/kks) # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -evaluate-commands %sh{ - kks init -} +evaluate-commands %sh{ kks init } +# define-command -override kks-connect -params 1.. -command-completion %{ +# %arg{1} sh -c %{ +# export EDITOR='kks edit' +# export KKS_SESSION=$1 +# export KKS_CLIENT=$2 +# shift 3 + +# [ $# = 0 ] && set "$SHELL" + +# "$@" +# } -- %val{session} %val{client} %arg{@} +# } + +# kak-lsp integration +# ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── +evaluate-commands %sh{ kak-lsp } +lsp-enable # Enable PLUGin manager # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── @@ -263,13 +277,13 @@ hook -always global PromptIdle '' update_hex_color_code_ranges2 # normal mode kks mappings # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── map global normal -docstring 'terminal' ': kks-connect terminal' -map global normal -docstring 'files' ': kks-connect terminal-popup kks-files' -map global normal -docstring 'buffers' ': kks-connect terminal-popup kks-buffers' -map global normal -docstring 'live grep' ': kks-connect terminal-popup kks-grep' -map global normal -docstring 'lines in buffer' ': kks-connect terminal-popup kks-lines' -map global normal -docstring 'recent files' ': kks-connect terminal-popup kks-mru' -map global normal -docstring 'vcs client' ': kks-connect terminal-popup lazygit' -map global normal -docstring 'file browser' ': kks-connect terminal-panel kks-lf' +map global normal -docstring 'files' ': kks-connect popup kks-files' +map global normal -docstring 'buffers' ': kks-connect popup kks-buffers' +map global normal -docstring 'live grep' ': kks-connect popup kks-grep' +map global normal -docstring 'lines in buffer' ': kks-connect popup kks-lines' +map global normal -docstring 'recent files' ': kks-connect popup kks-mru' +map global normal -docstring 'vcs client' ': kks-connect popup lazygit' +map global normal -docstring 'file browser' ': kks-connect popup kks-lf' # normal mode additional mappings # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── @@ -303,6 +317,17 @@ map global user -docstring 'relative line numbers enable' r ': a map global user -docstring 'relative line numbers disable' R ': rmhl window/nl' map global user -docstring 'help command mode enable' h ': set -add global autoinfo normal' map global user -docstring 'help command mode disable' H ': set -remove global autoinfo normal' +map global user l ':enter-user-mode lsp' -docstring 'LSP mode' + +# kak-lsp keys +# ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── +map global insert ':try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks tab> }' -docstring 'Select next snippet placeholder' +map global object a 'lsp-object' -docstring 'LSP any symbol' +map global object 'lsp-object' -docstring 'LSP any symbol' +map global object f 'lsp-object Function Method' -docstring 'LSP function or method' +map global object t 'lsp-object Class Interface Struct' -docstring 'LSP class interface or struct' +map global object d 'lsp-diagnostic-object --include-warnings' -docstring 'LSP errors and warnings' +map global object D 'lsp-diagnostic-object' -docstring 'LSP errors' # buffer user mode # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── @@ -326,16 +351,17 @@ map global selmode -docstring 'clean tabs and trailing whitespaces' C ': c map global selmode -docstring 'sort words Horizontally in selection' h '| xargs -n1 | sort -u | xargs ' map global selmode -docstring 'sort words Vertically in selection ' v '| sort -n ' map global selmode -docstring 'surround' s ':surround' -map global selmode -docstring 'change surround' c ':change-surround' -map global selmode -docstring 'delete surround' d ':delete-surround' -map global selmode -docstring 'select tag' t ':select-surrounding-tag' +map global selmode -docstring 'change surround' c ':change-surround' +map global selmode -docstring 'delete surround' d ':delete-surround' +map global selmode -docstring 'select tag' t ':select-surrounding-tag' # terminal config (via foot.kak) # ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── -set-option global foot_normal_cmd 'footclient' -set-option global foot_popup_cmd 'footclient' -set-option global foot_panel_cmd 'footclient' +set-option global foot_normal_cmd 'foot' +set-option global foot_popup_cmd 'foot' +set-option global foot_panel_cmd 'foot' set-option global foot_normal_flags '' -set-option global foot_popup_flags '-a kakpopup' '-W 250x50' -set-option global foot_panel_flags '-a kakpopup' '-W 400x1' +set-option global foot_popup_flags '--app-id=kakpopup' '--window-size-chars=240x40' +# set-option global foot_popup_flags '--app-id=kakpopup' +set-option global foot_panel_flags '--app-id=kakpopup'