76 lines
2.4 KiB
Text
76 lines
2.4 KiB
Text
|
# some usable colorscheme
|
||
|
colorscheme gruvbox-dark
|
||
|
|
||
|
# line numbers
|
||
|
add-highlighter global/ number-lines -hlcursor -relative -separator " " -cursor-separator " |"
|
||
|
|
||
|
# show matching parens
|
||
|
add-highlighter global/ show-matching
|
||
|
|
||
|
set-option global tabstop 4
|
||
|
set-option global indentwidth 4
|
||
|
|
||
|
|
||
|
# show trailing whitespace
|
||
|
add-highlighter global/ regex \h+$ 0:Error
|
||
|
|
||
|
# softwrap long lines
|
||
|
add-highlighter global/ wrap -word -indent
|
||
|
|
||
|
# no terminal assistant
|
||
|
set global ui_options terminal_assistant=none terminal_enable_mouse=false
|
||
|
|
||
|
# tab completions
|
||
|
hook global InsertCompletionShow .* %{
|
||
|
try %{
|
||
|
# this command temporarily removes cursors preceded by whitespace;
|
||
|
# if there are no cursors left, it raises an error, does not
|
||
|
# continue to execute the mapping commands, and the error is eaten
|
||
|
# by the `try` command so no warning appears.
|
||
|
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 .* %{
|
||
|
unmap window insert <tab> <c-n>
|
||
|
unmap window insert <s-tab> <c-p>
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
# lsp
|
||
|
eval %sh{kak-lsp}
|
||
|
lsp-enable
|
||
|
|
||
|
lsp-auto-signature-help-enable
|
||
|
lsp-auto-hover-enable
|
||
|
lsp-auto-hover-insert-mode-enable
|
||
|
|
||
|
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 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'
|
||
|
|
||
|
|
||
|
# copy to device clipboard
|
||
|
hook global RegisterModified '"' %{ nop %sh{
|
||
|
wl-copy -- "$kak_main_reg_dquote" 2> /dev/null;
|
||
|
}}
|
||
|
|
||
|
# plugins
|
||
|
source "%val{config}/plugins/plug.kak/rc/plug.kak"
|
||
|
plug "andreyorst/plug.kak" noload
|
||
|
|
||
|
plug "andreyorst/fzf.kak"
|
||
|
|
||
|
map global user f ': fzf-mode<ret>' -docstring 'fzf mode'
|
||
|
|
||
|
# # custom plugins
|
||
|
# source ~/.config/kak/tv/tv.kak
|
||
|
|