########### # plugins # ########### source "%val{config}/plugins/plug.kak/rc/plug.kak" plug "andreyorst/plug.kak" noload ######################### # colors and appearance # ######################### add-highlighter global/ number-lines -relative add-highlighter -override global/number-lines number-lines -hlcursor colorscheme one #################### # system clipboard # #################### plug "lePerdu/kakboard" %{ hook global WinCreate .* %{ kakboard-enable } } hook global NormalKey y|d|c %{ nop %sh{ printf "%s" "$kak_reg_dquote" | xclip -selection clipboard >&- 2>&- } } ############ # snippets # ############ # plug "occivink/kakoune-snippets" config %{ # set-option -add global snippets_directories "%opt{plug_install_dir}/kakoune-snippet-collection/snippets" # # some other kakoune-snippets related configurations # } # # plug "andreyorst/kakoune-snippet-collection" ########### # buffers # ########### plug "Delapouite/kakoune-buffers" %{ map global normal ^ q map global normal Q map global normal q b map global normal Q B map global normal map global normal map global normal b ': enter-buffers-mode' -docstring 'buffers' map global normal B ': enter-user-mode -lock buffers' -docstring 'buffers (lock)' } alias global bd delete-buffer alias global bf buffer-first alias global bl buffer-last alias global bo buffer-only alias global bo! buffer-only-force hook global WinDisplay .* info-buffers map global user b ':enter-buffers-mode' -docstring 'buffers…' map global user B ':enter-user-mode -lock buffers' -docstring 'buffers (dick)' ################## # tabs expansion # ################## plug "andreyorst/smarttab.kak" hook global WinSetOption filetype=(python|rust) expandtab map global insert '' ####### # lsp # ####### eval %sh{kak-lsp --kakoune -s $kak_session} # Not needed if you load it with plug.kak. lsp-enable map global user l %{: enter-user-mode lsp} -docstring "LSP mode" # vim migration # define-command -hidden alt-x %{ evaluate-commands %sh{ width=$kak_window_width printf "%s\n" "execute-keys '$width'lhl" unset width } } define-command -hidden alt-X %{ evaluate-commands %sh{ width=$kak_window_width printf "%s\n" "execute-keys '$width'hlh" unset width } } ############## # formatters # ############## # indentation set-option global indentwidth 4 hook global WinSetOption filetype=python %{ set-option window formatcmd 'black -q -' hook -group python-auto-format window BufWritePre .* format hook -once WinSetOption filetype=.* %{ unset-option window formatcmd remove-hooks window python-auto-format } } hook global WinSetOption filetype=rust %{ set-option window formatcmd 'rustfmt' hook -group rust-autoformat window BufWritePre .* format hook -once WinSetOption filetype=.* %{ unset-option window formatcmd remove-hooks window rust-autoformat } } hook global BufSetOption filetype=markdown %{ set-option buffer formatcmd 'pandoc -f commonmark -t commonmark' } hook global WinSetOption filetype=(nix|latex|yaml|markdown|haskell) %{ set-option buffer indentwidth 2 set window autowrap_column 80 autowrap-enable } map global user W '|fmt --width 80' -docstring "Wrap to 80 columns" ############ # spelling # ############ # thesaurus langauge switchers? map global normal ' :synonyms-set-thesaurus th_ru_RU_v2 :echo set ru thesaurus' map global normal ' :synonyms-set-thesaurus th_en_US_v2 :echo set en thesaurus' hook global WinDisplay .* %{ synonyms-enable-on } ############### # file search # ############### plug "andreyorst/fzf.kak" map global normal ': fzf-mode'