--- /dev/null
+[submodule "kak/plugins/powerline.kak"]
+ path = kak/plugins/powerline.kak
+ url = https://github.com/andreyorst/powerline.kak
+[submodule "kak/plugins/plug.kak"]
+ path = kak/plugins/plug.kak
+ url = https://github.com/andreyorst/plug.kak
+[submodule "kak/plugins/bookmarks.kak"]
+ path = kak/plugins/bookmarks.kak
+ url = https://github.com/Ersikan/bookmarks.kak
+[submodule "kak/plugins/shellcheck.kak"]
+ path = kak/plugins/shellcheck.kak
+ url = https://github.com/whereswaldon/shellcheck.kak
+[submodule "kak/plugins/prelude.kak"]
+ path = kak/plugins/prelude.kak
+ url = https://github.com/kakounedotcom/prelude.kak
+[submodule "kak/plugins/connect.kak"]
+ path = kak/plugins/connect.kak
+ url = https://github.com/kakounedotcom/connect.kak
+[submodule "kak/plugins/kakoune-sudo-write.kak"]
+ path = kak/plugins/kakoune-sudo-write.kak
+ url = https://github.com/occivink/kakoune-sudo-write
+[submodule "kak/plugins/kakoune-smooth-scroll"]
+ path = kak/plugins/kakoune-smooth-scroll
+ url = https://github.com/caksoylar/kakoune-smooth-scroll
+[submodule "kak/plugins/kakoune-sudo-write"]
+ path = kak/plugins/kakoune-sudo-write
+ url = https://github.com/occivink/kakoune-sudo-write
+[submodule "kak/plugins/smarttab.kak"]
+ path = kak/plugins/smarttab.kak
+ url = https://github.com/andreyorst/smarttab.kak
+# System integration
+hook global RegisterModified '"' %{ nop %sh{
+ printf %s "$kak_main_reg_dquote" | xsel --input --clipboard
+}}
+
# Look and Feel
# ─────────────
add-highlighter global/trailing-whitespace regex '\h+$' 0:Error # trailing whitespaces in red
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 -min-digits 3 # absolute line nums everywhere
colorscheme default
+set-option global tabstop 4
+set-option global indentwidth 4
+set-option global scrolloff 10,10
+
+# Different Cursor color in insert mode
+# ─────────────────────────────────────
+# Shades of blue/cyan for normal mode
+set-face global PrimarySelection white,blue+F
+set-face global SecondarySelection black,blue+F
+set-face global PrimaryCursor black,bright-cyan+F
+set-face global SecondaryCursor black,bright-blue+F
+set-face global PrimaryCursorEol black,bright-cyan
+set-face global SecondaryCursorEol black,bright-blue
+
+# Shades of green/yellow for insert mode.
+hook global ModeChange (push|pop):.*:insert %{
+ set-face window PrimarySelection white,green+F
+ set-face window SecondarySelection black,green+F
+ set-face window PrimaryCursor black,bright-yellow+F
+ set-face window SecondaryCursor black,bright-green+F
+ set-face window PrimaryCursorEol black,bright-yellow
+ set-face window SecondaryCursorEol black,bright-green
+}
+
+# Undo colour changes when we leave insert mode.
+hook global ModeChange (push|pop):insert:.* %{
+ unset-face window PrimarySelection
+ unset-face window SecondarySelection
+ unset-face window PrimaryCursor
+ unset-face window SecondaryCursor
+ unset-face window PrimaryCursorEol
+ unset-face window SecondaryCursorEol
+}
# Enable editor config
# ────────────────────
map global user -docstring 'clean tabs and trailing whitespace in the buffer' C ': clean-buffer<ret>'
map global user -docstring 'next buffer' n ': buffer-next<ret>'
map global user -docstring 'previous buffer' p ': buffer-previous<ret>'
-map global user -docstring 'lint-buffer' l ': buffer *lint-output*<ret>'
+map global user -docstring 'comment-line' l ': comment-line<ret>'
+map global user -docstring 'lint-buffer' L ': buffer *lint-output*<ret>'
+map global user -docstring 'relative line numbers enable' r ': add-highlighter window/nl number-lines -relative -hlcursor<ret>'
+map global user -docstring 'relative line numbers disable' R ': remove-highlighter window/nl<ret>'
+map global user -docstring 'wrap enable' w ': add-highlighter buffer/bw wrap<ret>'
+map global user -docstring 'wrap disable' W ': remove-highlighter buffer/bw<ret>'
# Enable PLUGin manager
# ─────────────────────
hook global WinCreate .* bookmarks-enable
}
- plug "whereswaldon/shellcheck.kak"
+ 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 "whereswaldon/shellcheck.kak"
+ plug "kakounedotcom/prelude.kak"
+ plug "kakounedotcom/connect.kak"
+ plug "occivink/kakoune-sudo-write"
+
# PLUGin ends
+# set up plugins
+# ─────────────────────
+
+# for connect.kak
+require-module prelude
+require-module connect
+require-module connect-dolphin
--- /dev/null
+try %{
+
+ # configuration here
+ # hook global WinCreate [^*].* %{
+ # hook -once window WinDisplay .* %{
+ # smooth-scroll-enable
+ # }
+ hook -group smooth-scroll window User ScrollBegin %{
+ add-highlighter -override window/nl number-lines
+ }
+ hook -group smooth-scroll window User ScrollEnd %{
+ add-highlighter -override window/nl number-lines -relative -hlcursor
+ }
+ }
+ } catch %{
+ echo -debug "Error while evaluating 'kakoune-smooth-scroll' configuration: %val{error}"
+
+ set-option -add current plug_conf_errors "Error while evaluating 'kakoune-smooth-scroll' configuration:"
+ set-option -add current plug_conf_errors %sh{ printf "\n " }
+ set-option -add current plug_conf_errors %val{error}
+ set-option -add current plug_conf_errors %sh{ printf "\n\n" }
+
+ hook -once -group plug-conf-err global WinDisplay .* %{
+ info -style modal -title "plug.kak error" "%opt{plug_conf_errors}"
+ on-key %{
+ info -style modal
+ execute-keys -with-maps -with-hooks %val{key}
+ }
+ }
+}
--- /dev/null
+try %{
+
+ 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
+ } catch %{
+ echo -debug "Error while evaluating 'smarttab.kak' configuration: %val{error}"
+
+ set-option -add current plug_conf_errors "Error while evaluating 'smarttab.kak' configuration:"
+ set-option -add current plug_conf_errors %sh{ printf "\n " }
+ set-option -add current plug_conf_errors %val{error}
+ set-option -add current plug_conf_errors %sh{ printf "\n\n" }
+
+ hook -once -group plug-conf-err global WinDisplay .* %{
+ info -style modal -title "plug.kak error" "%opt{plug_conf_errors}"
+ on-key %{
+ info -style modal
+ execute-keys -with-maps -with-hooks %val{key}
+ }
+ }
+}