source "%val{config}/plugins/plug.kak/rc/plug.kak" plug "andreyorst/plug.kak" noload # Highlight current line plug "insipx/kak-crosshairs" config %{ cursorline } # Fuzzy find with find def find -params 1 -shell-script-candidates %{ find . -type f -not -path '*/\.git/*' } %{ edit %arg{1} } # Fuzzy find with fzf plug "andreyorst/fzf.kak" config %{ map global user p ': fzf-modef' -docstring 'fzf find file' } defer "fzf-file" %{ set-option global fzf_file_command 'rg --hidden --files --glob !*.git' evaluate-commands %sh{ [ -n "$(command -v bat)" ] && echo "set-option global fzf_highlight_command bat" } } # Fuzzy find with Lua plug "gustavo-hms/luar" %{ plug "gustavo-hms/peneira" %{ require-module peneira set-option global peneira_files_command "rg --files" define-command peneira-buffers %{ peneira 'buffers: ' %{ printf '%s\n' $kak_quoted_buflist } %{ buffer %arg{1} } } map global normal ':peneira-files' -docstring 'fuzzy find files' map global user b ':peneira-buffers' -docstring 'fuzzy find buffers' } } # Tree 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 map global user 'n' ':kaktree-toggle' } # LSP eval %sh{kak-lsp --kakoune -s $kak_session} hook global WinSetOption filetype=(haskell|go|elm|sh) %{ lsp-enable-window lsp-auto-hover-enable } # Format Go on save hook global BufWritePre .*[.]go %{ try %{ lsp-code-action-sync '^Organize Imports$' } lsp-formatting-sync } # Default setings for buffers define-command -hidden buffer-default-setup %{ add-highlighter buffer/numbers number-lines -hlcursor -separator " │ " -min-digits 3 modeline-parse } hook global BufOpenFile .* %{ buffer-default-setup } hook global BufCreate .* %{ buffer-default-setup } set-option global tabstop 4 set-option global indentwidth 4 # Paragraph jumping map global normal '' '[p' map global normal '=' 'p' map global normal '' '}p' map global normal '_' '{p' # UI colors face global LineNumbers rgb:595959,default face global LineNumberCursor rgb:999999,default face global CursorLine default,rgb:ff0000 face global crosshairs_line default,rgb:262626 declare-option bool showing_whitespaces define-command -docstring "show whitespaces" show-whitespaces %{ add-highlighter global/whitespaces show-whitespaces -tab ▸ } define-command -docstring "hide whitespaces" hide-whitespaces %{ remove-highlighter global/whitespaces } define-command -docstring "toggle whitespaces" toggle-whitespaces %{ evaluate-commands %sh{ if [ "$kak_opt_showing_whitespaces" = "true" ]; then printf "%s\n" "hide-whitespaces" printf "%s\n" "set global showing_whitespaces false" else printf "%s\n" "show-whitespaces" printf "%s\n" "set global showing_whitespaces true" fi } } map global user -docstring "toggle whitespaces" 'w' ':toggle-whitespaces' # Horizontal split with tmux define-command horizontal-split \ -docstring "horizontal-split : open vertical-split" \ -params 0.. \ -file-completion \ %{ tmux-terminal-horizontal kak -c %val{session} %arg{@} } alias global hs horizontal-split # Vertical split with tmux define-command vertical-split \ -docstring "vertical-split : open vertical-split" \ -params 0.. \ -file-completion \ %{ tmux-terminal-vertical kak -c %val{session} %arg{@} } alias global vs vertical-split hook global BufCreate .*/bash(rc|_profile|_funcs) %{ set buffer filetype sh }