Compare commits

..

No commits in common. "654fc2ee7b70028f3223540fbce41fe905828342" and "a8745a54ecef1dec8bacea7b4ddb1d07232c8c20" have entirely different histories.

71
kakrc
View File

@ -1,7 +1,7 @@
# Load plug.kak
source "%val{config}/plugins/plug.kak/rc/plug.kak"
plug "alexherbo2/auto-pairs.kak"
plug "andreyorst/plug.kak" noload
# plug kak-lsp
plug "kak-lsp/kak-lsp" do %{
cargo build --release --locked
cargo install --force --path .
@ -22,10 +22,9 @@ plug "kak-lsp/kak-lsp" do %{
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 'restart lsp server' %{ lsp-stop; lsp-start }
hook global WinSetOption filetype=(c|cpp|sh|cc|rust|javascript|typescript|go|python) %{
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
map window insert <a-l> lsp-next-location
lsp-auto-hover-enable
echo -debug "Enabling LSP for filtetype %opt{filetype}"
lsp-enable-window
@ -43,29 +42,20 @@ plug "kak-lsp/kak-lsp" do %{
}
}
map global user l %{:enter-user-mode lsp<ret>} -docstring "LSP mode"
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 e '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method'
map global object k '<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'
hook global KakEnd .* lsp-exit
}
# Substitute c-n with tab
#hook global InsertCompletionShow .* %{
# try %{
# execute-keys -draft 'h<a-K>\h<ret>'
# map window insert <tab> <c-n>
# map window insert <s-tab> <c-p>
# hook -once -always window InsertCompletionHide .* %{
# map window insert <tab> <tab>
# map window insert <s-tab> <s-tab>
# }
# }
#}
hook global InsertCompletionShow .* %{
try %{
execute-keys -draft 'h<a-K>\h<ret>'
map window insert <tab> <c-n>
map window insert <s-tab> <c-p>
hook -once -always window InsertCompletionHide .* %{
map window insert <tab> <tab>
map window insert <s-tab> <s-tab>
}
}
}
# enable auto pair closing
enable-auto-pairs
# yaml linter
@ -95,15 +85,6 @@ set global tabstop 4
add-highlighter global/ number-lines
add-highlighter global/ wrap
plug "andreyorst/kaktree" config %{
hook global WinSetOption filetype=kaktree %{
remove-highlighter buffer/numbers
remove-highlighter buffer/matching
remove-highlighter buffer/wrap
remove-highlighter buffer/show-whitespaces
}
kaktree-enable
}
# system clipboard usermode
map global user y '<a-|>xclip -in -selection clipboard >&- 2>&-<ret>' \
-docstring 'Copy selected text to system clipboard'
@ -113,3 +94,29 @@ map global user p '<a-!>xclip -out -selection clipboard<ret>' \
-docstring 'Paste system clipboard after'
map global user R '|xclip -out -selection clipboard<ret>' \
-docstring 'Replace selection from system clipboard'
## TESTING: copy and paste from TMUX
#if [ -n "$DISPLAY" ]; then
## printf %s "$kak_main_reg_dquote" | xsel --input --clipboard
#elif [ -n "$TMUX" ]; then
# map global user y '<a-|>tmux set-buffer --<ret>'
#fi
## Enable different options depending if we are inside TMUX or not
#try %{
# evaluate-commands %sh{ [ $tmux ] || echo "fail" }
# try %{
# hook global registermodified '"' %{ nop %sh{
# tmux set-buffer -- "$kak_main_reg_dquote"
# }}
# map global user p '!tmux show-buffer<ret>'
# map global user p '<a-!>tmux show-buffer<ret>'
# map global user r '|tmux show-buffer<ret>'
# }
#} catch %{
# try %{
# map global user y '<a-|>xclip -in -selection clipboard >&- 2>&-<ret>'
# map global user p '!xclip -out -selection clipboard<ret>'
# map global user p '<a-!>xclip -out -selection clipboard<ret>'
# map global user r '|xclip -out -selection clipboard<ret>'
# }
#}