149 lines
5.3 KiB
Text
149 lines
5.3 KiB
Text
colorscheme warm-pastel
|
|
set-option global scrolloff 5,5
|
|
set-option global incsearch true
|
|
set-option global aligntab true
|
|
set-option global ui_options ncurses_assistant=dilbert
|
|
set-option -add global ui_options ncurses_change_colors=true
|
|
set-option global grepcmd 'rg --column'
|
|
set-option global tabstop 2
|
|
set-option global indentwidth 2
|
|
|
|
# plug.kak plugin manager
|
|
source "%val{config}/plugins/plug.kak/rc/plug.kak"
|
|
|
|
|
|
plug "andreyorst/plug.kak" noload
|
|
|
|
plug "lenormf/kakoune-extra" load %{
|
|
autodownload.kak
|
|
}
|
|
plug "andreyorst/fzf.kak" config %{
|
|
map global normal <c-p> ': fzf-mode<ret>'
|
|
}
|
|
|
|
###############################################
|
|
# lsp support (https://github.com/ul/kak-lsp) #
|
|
# ...but it's not working yet #
|
|
###############################################
|
|
|
|
eval %sh{kak-lsp --kakoune -s $kak_session}
|
|
set-option global lsp_completion_trigger "execute-keys 'h<a-h><a-k>\S[^\h\n,=;*(){}\[\]]\z<ret>'"
|
|
set-option global lsp_diagnostic_line_error_sign '║'
|
|
set-option 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 }
|
|
|
|
hook global WinSetOption filetype=(c|cpp|rust|go|javascript|typescript) %{
|
|
# map window user "l" ": enter-user-mode lsp<ret>" -docstring "LSP mode"
|
|
map window user l %{: enter-user-mode lsp<ret>} -docstring "LSP mode"
|
|
set-option window lsp_auto_highlight_references true
|
|
set-option window lsp_hover_anchor true
|
|
set-face window DiagnosticError default+u
|
|
set-face window DiagnosticWarning default+u
|
|
lsp-enable-window
|
|
lsp-auto-hover-enable
|
|
lsp-auto-hover-insert-mode-disable
|
|
}
|
|
hook global WinSetOption filetype=rust %{
|
|
set-option window lsp_server_configuration rust.clippy_preference="on"
|
|
}
|
|
hook global KakEnd .* lsp-exit
|
|
|
|
|
|
#eval %sh{kak-lsp --kakoune -s $kak_session}
|
|
#hook global WinSetOption filetype=(rust|python|go|javascript|typescript|c|cpp) %{
|
|
# lsp-enable-window
|
|
#}
|
|
|
|
###########################################################
|
|
# kakoune-buffers #
|
|
# sets former b (word-back) to q and makes b a global key #
|
|
# for the new buffers command. I don't use macros anyway. #
|
|
###########################################################
|
|
plug 'delapouite/kakoune-buffers' config %{
|
|
map global normal ^ q
|
|
map global normal <a-^> Q
|
|
map global normal q b
|
|
map global normal Q B
|
|
map global normal <a-q> <a-b>
|
|
map global normal <a-Q> <a-B>
|
|
map global normal b ': enter-buffers-mode<ret>' -docstring 'buffers'
|
|
map global normal B ': enter-user-mode -lock buffers<ret>' -docstring 'buffers (lock)'
|
|
hook·global·WinDisplay·.*·info-buffers
|
|
}
|
|
|
|
plug "ABuffSeagull/kakoune-vue"
|
|
plug "ABuffSeagull/kakoune-wiki"
|
|
|
|
############################################################
|
|
# replace mode #
|
|
# that is one thing I missed in Kakoune: writing over text #
|
|
############################################################
|
|
plug "alexherbo2/replace.kak" noload config %{
|
|
## currently not working well
|
|
# map global user r -docstring 'Replace' ': replace<ret>'
|
|
}
|
|
|
|
###########################################################
|
|
# explore files (https://github.com/alexherbo2/explore.kak)
|
|
# use fd instead of find
|
|
###########################################################
|
|
plug "alexherbo2/explore.kak" config %{
|
|
define-command -hidden -override explore-files-recursive -params 0..1 %{
|
|
explore-files-display "fd %sh(test $kak_opt_explore_files_show_hidden = true && echo --hidden)" %arg(1)
|
|
}
|
|
}
|
|
|
|
# TODO: check out snippets
|
|
# plug "alexherbo2/snippets.kak" config %{
|
|
# }
|
|
|
|
# TODO: check out tagbar
|
|
# plug "andreyorst/tagbar.kak" config %{
|
|
# set-option global tagbar_sort false
|
|
# set-option global tagbar_size 40
|
|
# set-option global tagbar_display_anon false
|
|
#} config %{
|
|
# if you have wrap highlighter enamled in you configuration
|
|
# # files it's better to turn it off for tagbar, using this hook:
|
|
# hook global WinSetOption filetype=tagbar %{
|
|
# remove-highlighter window/wrap
|
|
# # you can also disable rendering whitespaces here, line numbers, and
|
|
# # matching characters
|
|
# }
|
|
#}
|
|
|
|
# set-option global fzf_filesearch_cmd "fd '%s'"
|
|
|
|
# with inspiration from
|
|
# https://github.com/Delapouite/dotfiles/blob/master/link/kak/kakrc
|
|
set global modelinefmt %{
|
|
%val{bufname} [%opt{filetype}]
|
|
· %val{cursor_line}:%val{cursor_char_column}
|
|
· {{context_info}} {{mode_info}}
|
|
}
|
|
|
|
hook global BufWritePre .* %{
|
|
lint
|
|
}
|
|
|
|
# defines tabe and vsplit commands
|
|
# def -file-completion -params 1 tabe %{ tmux-terminal-window edit %arg{1} }
|
|
|
|
# spaces instead tabs
|
|
map global insert <tab> ' '
|
|
|
|
# ← system clipboard
|
|
map global user y '<a-|>xsel --input --clipboard<ret>; :echo -color Information "copied selection to X11 clipboard"<ret>' -docstring 'yank from clipboard'
|
|
map global user p '<a-!>xsel --output --clipboard<ret>' -docstring 'replace from clipboard'
|
|
map global user P '!xsel --output --clipboard<ret>' -docstring 'print from clipboard'
|
|
|
|
# → system clipboard
|
|
hook global NormalKey y|d|c %{ nop %sh{
|
|
printf %s "$kak_reg_dquote" | xsel --input --clipboard
|
|
}}
|
|
|
|
# editorconfig support
|
|
hook global BufCreate .* %{editorconfig-load}
|