123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- source "%val{config}/plugins/plug.kak/rc/plug.kak"
- plug "andreyorst/plug.kak" noload
- plug "whereswaldon/shellcheck.kak"
- plug "https://gitlab.com/Screwtapello/kakoune-state-save"
- plug "andreyorst/fzf.kak" %{
- map global normal <c-p> ': fzf-mode<ret>'
- } defer fzf %{
- }
- plug "alexherbo2/prelude.kak"
- plug "alexherbo2/auto-pairs.kak" defer auto-pairs %{
- hook global WinCreate .* %{
- auto-pairs-enable
- }
- } demand
- plug "TeddyDD/kakoune-edit-or-dir" %{
- unalias global e edit
- alias global e edit-or-dir
- }
- plug "andreyorst/smarttab.kak" %{
- hook global WinSetOption filetype=python expandtab
- hook global BufCreate .* %{
- set-option buffer tabstop 2
- set-option buffer indentwidth 2
- smarttab
- }
- }
- plug "lePerdu/kakboard" %{
- hook global WinCreate .* %{ kakboard-enable }
- }
- plug "dmerejkowsky/kak-spell" config %{
- declare-user-mode kak-spell
- map global user s ': enter-user-mode -lock kak-spell<ret>' -docstring 'enter spell user mode'
- map global kak-spell a ': kak-spell-add<ret>' -docstring 'add the selection to the user dict'
- map global kak-spell d ': kak-spell-disable<ret>' -docstring 'clear spelling highlighters'
- map global kak-spell e ': kak-spell-enable en_GB<ret> :kak-spell <ret>' -docstring 'enable spell check in English'
- map global kak-spell f ': kak-spell-enable pl_PL<ret> :kak-spell <ret>' -docstring 'run spell check in Polish'
- map global kak-spell l ': kak-spell-list <ret>' -docstring 'list spelling errors in a buffer'
- map global kak-spell n ': kak-spell-next<ret>' -docstring 'go to next spell error'
- map global kak-spell p ': kak-spell-previous<ret>' -docstring 'go to next spell error'
- map global kak-spell r ': kak-spell-replace<ret>' -docstring 'suggest a list of replacements'
- map global kak-spell x ': kak-spell-remove<ret>' -docstring 'remove the selection from the user dict'
- }
- evaluate-commands %sh{
- if command -v kak-lsp > /dev/null 2>&1
- then
- kak-lsp --kakoune -s $kak_session
- echo "lsp-auto-hover-insert-mode-enable"
- echo "map global normal <c-a-l> ':lsp-formatting<ret>'"
- echo "map global normal <c-a-d> ':lsp-hover<ret>'"
- echo "map global normal <c-a-s> ':lsp-document-symbol<ret>'"
- echo "map global normal <c-a-r> ':lsp-rename-prompt<ret>'"
- echo "map global normal '#' ':lsp-highlight-references<ret>'"
- echo "set-option global lsp_hover_max_lines 3"
- echo "hook global WinSetOption filetype=(c|go) %{ \
- lsp-enable-window \
- }"
- echo "set-face global Reference blue,default+i"
- echo "set-face global DiagnosticWarning yellow+uf"
- echo "set-face global DiagnosticError red+uf"
- echo "map global normal <c-r> ':lsp-find-error --include-warnings<ret>' -docstring 'go to next error or warning'"
- echo "hook global KakEnd .* lsp-exit"
- fi
- }
- add-highlighter global/ number-lines -hlcursor
- hook global WinSetOption filetype=(c|go|kak|python) %{
- add-highlighter global/ column 80 default,rgb:00567e
- add-highlighter global/ column 120 default,rgb:7e2d2b
- add-highlighter global/ regex \b(TODO|todo|FIXME|fixme|XXX|xxx|NOTE|note)\b([^\n]*) 1:yellow+fbi 2:default+i
- }
- add-highlighter global/ show-matching
- add-highlighter global/ wrap -word -indent -marker
- set-face global PrimaryCursor default+rb
- set-face global PrimaryCursorEol default,blue
- set-face global PrimarySelection default+rb
- set-face global SecondaryCursor default+r
- set-face global SecondaryCursorEol default,cyan
- set-face global SecondarySelection default+r
- set-face global Error black,red
- set-face global MatchingChar blue,default+b
- set-face global MenuBackground blue,black
- set-face global MenuForeground black,blue
- set-face global Information black,red
- set-face global StatusLineMode rgb:c0bcc0,rgb:1b2022
- set-face global StatusLineInfo rgb:c0bcc0,rgb:1b2022
- set-face global StatusLineValue blue,cyan
- # todo hook global ModeChange ".*:normal" %{ face ... }
- # todo hook global ModeChange ".*:insert" %{ face ... }
- declare-option str spell
- set-option global ui_options ncurses_assistant=cat
- define-command gohome %{
- eval -itersel %{
- try %{
- exec -draft %{ <a-h><a-k>\A\h+.\z<ret> }
- exec gh
- } catch %{
- exec gi
- }
- }
- }
- map global normal <c-a-c> ':comment-line<ret>'
- map global normal <c-a-t> 'be :ctags-search<ret>'
- map global goto t '\:buffer-next<ret>' -docstring 'next buffer'
- map global normal <home> :gohome<ret>
- map global normal <end> gl
- hook global NormalIdle .* %{ evaluate-commands %sh{
- fmt=""
- branch=$(git branch --show-current 2>/dev/null)
- if [ "$branch" ]
- then
- fmt="$fmt{rgb:1c9867,default}{rgb:1b2022,rgb:1c9867} $branch {rgb:892b30,rgb:1c9867}"
- else
- fmt="$fmt{rgb:892b30,default}"
- fi
- case "${kak_opt_filetype}" in
- sh) filetype=" " ;;
- c) filetype=" ﭰ" ;;
- go) filetype=" ﳑ" ;;
- plain) filetype=" " ;;
- asciidoc) filetype=" " ;;
- html) filetype=" " ;;
- css) filetype=" " ;;
- git*) filetype=" " ;;
- "") filetype="" ;;
- *) filetype=" [${kak_opt_filetype}]" ;;
- esac
- if [ -f ${kak_bufname} ]
- then
- lines=$(wc -l ${kak_bufname} | awk '{print $1}')
- position=$(( ${kak_cursor_line} * 100 / $lines))
- position=" ($position%%) "
- else
- position=" "
- fi
- # todo add spell
- fmt="$fmt{rgb:c0bcc0,rgb:892b30} %val{bufname}$filetype {rgb:db9d3b,rgb:892b30}{rgb:1b2022,rgb:db9d3b} %val{cursor_line}:%val{cursor_char_column}$position{rgb:1b2022,rgb:db9d3b}{rgb:c0bcc0,rgb:1b2022} {{context_info}} {{mode_info}} {rgb:317b9f,rgb:1b2022}{rgb:1b2022,rgb:317b9f} %val{session} "
- echo "set-option buffer modelinefmt '$fmt'"
- }
- }
- hook global WinCreate [^*].* %{
- editorconfig-load
- evaluate-commands %sh{
- if git status >/dev/null 2>&1
- then
- echo "git show-diff"
- fi
- }
- }
- hook global BufWritePost .* %{ evaluate-commands %sh{
- if git status >/dev/null 2>&1
- then
- echo "git show-diff"
- fi
- if [ -n "$kak_opt_lintcmd" ]; then
- echo 'lint'
- fi
- }
- }
|