# ──────────────────────────────────────────────────────────────────────────────
hook global BufOpenFile .* %{
modeline-parse
+ editorconfig-load
}
hook global BufCreate [^*].* %{
}
}
+hook global BufNewFile .* %{
+ editorconfig-load
+}
# dynamic scrolloff
# ──────────────────────────────────────────────────────────────────────────────
kks init
}
-
# Enable PLUGin manager
# ──────────────────────────────────────────────────────────────────────────────
-source "%val{config}/plugins/plug.kak/rc/plug.kak"
-plug "andreyorst/plug.kak" noload
- plug "Ersikan/bookmarks.kak" %{
- hook global WinCreate .* bookmarks-enable
- }
- plug "andreyorst/smarttab.kak" defer smarttab %{
- # when 'backspace' is pressed, 4 spaces are deleted at once
- set-option global softtabstop 4
- } config %{
- hook global WinSetOption filetype=(rust|markdown|kak|lisp|scheme|py|sh|perl) expandtab
- hook global WinSetOption filetype=(makefile|gas) noexpandtab
- hook global WinSetOption filetype=(c|cpp) smarttab
- }
- plug "occivink/kakoune-sudo-write"
- plug "occivink/kakoune-find"
- plug "foot.kak"
- plug "https://git.sr.ht/~nasmevka/dabruin.kak" noload
- plug "eburghar/kakship" do %{
- cargo install --force --path . --root ~/.local
+source "%val{config}/bundle/kak-bundle/rc/kak-bundle.kak"
+bundle-noload kak-bundle https://codeberg.org/jdugan6249/kak-bundle
+bundle kakoune-sudo-write https://github.com/occivink/kakoune-sudo-write
+bundle kakoune-find https://github.com/occivink/kakoune-find
+bundle kakoune-expand https://github.com/occivink/kakoune-expand
+bundle foot.kak https://github.com/kkga/foot.kak
+bundle kak-harpoon https://github.com/raiguard/kak-harpoon %{
+ hook global WinCreate .* harpoon-add-bindings
+}
+bundle kakship https://github.com/eburghar/kakship %{
+ kakship-enable
+}
+ bundle-install-hook kakship %{
+ cargo install --force --path . --root ~/.local
[ ! -e $kak_config/starship.toml ] && cp starship.toml $kak_config/
- } config %{
- kakship-enable
}
- plug "raiguard/kak-harpoon" %{
- hook global WinCreate .* harpoon-add-bindings
+bundle-noload dabruin.kak https://git.sr.ht/~nasmevka/dabruin.kak
+ bundle-install-hook dabruin.kak %{
+ mkdir -p ${kak_config}/colors
+ ln -sf "${kak_opt_bundle_path}/dabruin.kak" "${kak_config}/colors/"
+ ln -sf "${kak_opt_bundle_path}/dabruin-light.kak" "${kak_config}/colors/"
+ }
+ bundle-cleaner dabruin.kak %{
+ rm -f "${kak_config}/colors/dabruin.kak"
+ rm -f "${kak_config}/colors/dabruin-light.kak"
}
-
# Enable some linting and formatting
# ──────────────────────────────────────────────────────────────────────────────
add-highlighter global/todos regex '(//|#|/\*)\h*(TODO|WARNING|FIXME)[:]?[^\n]*' 2:+bu # highlight comment tags
add-highlighter global/ show-matching # show matching brackets
add-highlighter global/ number-lines -hlcursor -min-digits 3 # absolute line nums everywhere
-declare-option str dabruin_accent 'rgb:A1B56C'
-declare-option str dabruin_background 'rgb:242124'
+# declare-option str dabruin_accent 'rgb:A1B56C'
+# declare-option str dabruin_ratio '-3/5'
colorscheme dabruin
-set-option global tabstop 4
-set-option global indentwidth 4
+# set-option global tabstop 4
+# set-option global indentwidth 4
add-highlighter global/ wrap -word -indent
# Different Cursor color in insert mode
# ──────────────────────────────────────────────────────────────────────────────
# Shades of green/yellow for insert mode.
hook global ModeChange (push|pop):.*:insert %{
- set-face window StatusLine black,blue
+ set-face window StatusLine black,yellow
}
# Undo colour changes when we leave insert mode.
hook global ModeChange (push|pop):insert:.* %{
- unset-face window StatusLine
+ unset-face window StatusLine
}
# default user mode
# ──────────────────────────────────────────────────────────────────────────────
-map global user -docstring 'Buffer mode' b ':enter-user-mode buffermode<ret>'
-map global user -docstring 'Selection mode' s ':enter-user-mode selectionmode<ret>'
-map global user -docstring 'edit kakrc' E ': e ~/.config/kak/kakrc<ret>'
-map global user -docstring 'relative line numbers enable' r ': add-highlighter window/nl number-lines -min-digits 3 -relative -hlcursor<ret>'
-map global user -docstring 'relative line numbers disable' R ': remove-highlighter window/nl<ret>'
-map global user -docstring 'decrease value' d ': inc %val{count} -<ret>'
-map global user -docstring 'increase value' i ': inc %val{count} +<ret>'
+map global user -docstring '(B)uffer mode' b ': enter-user-mode buffermode<ret>'
+map global user -docstring '(S)election mode' s ': enter-user-mode selmode<ret>'
+map global user -docstring '(e)xpand selection' e ': expand<ret>'
+map global user -docstring '(E)dit kakrc' E ': e ~/.config/kak/kakrc<ret>'
+map global user -docstring '(r)elative line numbers enable' r ': addhl window/nl number-lines -min-digits 3 -relative -hlcursor<ret>'
+map global user -docstring '(R)elative line numbers disable' R ': remove-highlighter window/nl<ret>'
+map global user -docstring '(d)ecrease value' d ': inc %val{count} -<ret>'
+map global user -docstring '(i)ncrease value' i ': inc %val{count} +<ret>'
# buffer user mode
# ──────────────────────────────────────────────────────────────────────────────
declare-user-mode buffermode
-map global buffermode -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert<ret>'
-map global buffermode -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
-map global buffermode -docstring 'clean tabs and trailing whitespace in the buffer' c ': clean-buffer<ret>'
-map global buffermode -docstring 'delete buffer' d ': delete-buffer<ret>'
-map global buffermode -docstring 'buffer picker' l ': kks-connect terminal-popup kks-buffers<ret>'
-map global buffermode -docstring 'Lint buffer' L ': buffer *lint-output*<ret>'
-map global buffermode -docstring 'Next buffer ' n ': buffer-next<ret>'
-map global buffermode -docstring 'Previous buffer' p ': buffer-previous<ret>'
-map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
-map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
+map global buffermode -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert<ret>'
+map global buffermode -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
+map global buffermode -docstring 'clean tabs and trailing whitespaces' c ': clean-buffer<ret>'
+map global buffermode -docstring 'delete buffer' d ': delete-buffer<ret>'
+map global buffermode -docstring 'buffer picker' l ': kks-connect terminal-popup kks-buffers<ret>'
+map global buffermode -docstring 'Lint buffer' L ': buffer *lint-output*<ret>'
+map global buffermode -docstring 'Next buffer ' n ': buffer-next<ret>'
+map global buffermode -docstring 'Previous buffer' p ': buffer-previous<ret>'
+map global buffermode -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
+map global buffermode -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
# selection user mode
# ──────────────────────────────────────────────────────────────────────────────
-declare-user-mode selectionmode
-map global selectionmode -docstring 'clean tabs and trailing whitespace in selections' c ': clean-selections<ret>'
-map global selectionmode -docstring 'sort words (H)orizontally in selection ' h '| xargs -n1 | sort -u | xargs <ret>'
-map global selectionmode -docstring 'sort words (V)ertically in selection ' v '| sort -n <ret>'
+declare-user-mode selmode
+map global selmode -docstring 'clean tabs and trailing whitespaces' c ': clean-selections<ret>'
+map global selmode -docstring 'sort words (H)orizontally in selection ' h '| xargs -n1 | sort -u | xargs <ret>'
+map global selmode -docstring 'sort words (V)ertically in selection ' v '| sort -n <ret>'
# terminal config (via foot.kak)
# ──────────────────────────────────────────────────────────────────────────────