source %sh{echo ${kak_config}/$1.kak}
}
-
# Clipboard (wayland) integration
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hook global NormalKey y %{ nop %sh{
# 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
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# normal mode kks mappings
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
map global normal -docstring 'terminal' <c-t> ': kks-connect terminal<ret>'
-map global normal -docstring 'files' <c-f> ': kks-connect terminal-popup kks-files<ret>'
-map global normal -docstring 'buffers' <c-b> ': kks-connect terminal-popup kks-buffers<ret>'
-map global normal -docstring 'live grep' <c-g> ': kks-connect terminal-popup kks-grep<ret>'
-map global normal -docstring 'lines in buffer' <c-l> ': kks-connect terminal-popup kks-lines<ret>'
-map global normal -docstring 'recent files' <c-r> ': kks-connect terminal-popup kks-mru<ret>'
-map global normal -docstring 'vcs client' <c-v> ': kks-connect terminal-popup lazygit<ret>'
-map global normal -docstring 'file browser' <c-h> ': kks-connect terminal-panel kks-lf<ret>'
+map global normal -docstring 'files' <c-f> ': kks-connect popup kks-files<ret>'
+map global normal -docstring 'buffers' <c-b> ': kks-connect popup kks-buffers<ret>'
+map global normal -docstring 'live grep' <c-g> ': kks-connect popup kks-grep<ret>'
+map global normal -docstring 'lines in buffer' <c-l> ': kks-connect popup kks-lines<ret>'
+map global normal -docstring 'recent files' <c-r> ': kks-connect popup kks-mru<ret>'
+map global normal -docstring 'vcs client' <c-v> ': kks-connect popup lazygit<ret>'
+map global normal -docstring 'file browser' <c-h> ': kks-connect popup kks-lf<ret>'
# normal mode additional mappings
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
map global user -docstring 'relative line numbers disable' R ': rmhl window/nl<ret>'
map global user -docstring 'help command mode enable' h ': set -add global autoinfo normal<ret>'
map global user -docstring 'help command mode disable' H ': set -remove global autoinfo normal<ret>'
+map global user l ':enter-user-mode lsp<ret>' -docstring 'LSP mode'
+
+# kak-lsp keys
+# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder'
+map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
+map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol'
+map global object f '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
+map global object t '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct'
+map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings'
+map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors'
# buffer user mode
# ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
map global selmode -docstring 'sort words Horizontally in selection' h '| xargs -n1 | sort -u | xargs <ret>'
map global selmode -docstring 'sort words Vertically in selection ' v '| sort -n <ret>'
map global selmode -docstring 'surround' s ':surround<ret>'
-map global selmode -docstring 'change surround' c ':change-surround<ret>'
-map global selmode -docstring 'delete surround' d ':delete-surround<ret>'
-map global selmode -docstring 'select tag' t ':select-surrounding-tag<ret>'
+map global selmode -docstring 'change surround' c ':change-surround<ret>'
+map global selmode -docstring 'delete surround' d ':delete-surround<ret>'
+map global selmode -docstring 'select tag' t ':select-surrounding-tag<ret>'
# 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'