]> Freerunner's - dotfiles.git/commitdiff
kak: add config
authorAndre Ramnitz <tux.rising@gmail.com>
Mon, 5 Jun 2023 06:05:02 +0000 (08:05 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Tue, 5 Dec 2023 01:54:36 +0000 (02:54 +0100)
.gitmodules [new file with mode: 0644]
kak/kakrc
kak/plugins/.build/kakoune-smooth-scroll/config [new file with mode: 0644]
kak/plugins/.build/smarttab.kak/config [new file with mode: 0644]
kak/plugins/connect.kak [new submodule]
kak/plugins/kakoune-sudo-write [new submodule]
kak/plugins/prelude.kak [new submodule]
kak/plugins/smarttab.kak [new submodule]

diff --git a/.gitmodules b/.gitmodules
new file mode 100644 (file)
index 0000000..22725d5
--- /dev/null
@@ -0,0 +1,30 @@
+[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
index 020581008f8145c01028090efa262c21b419e0aa..483181290957e685573eaea815dd2ca054f8890c 100644 (file)
--- a/kak/kakrc
+++ b/kak/kakrc
@@ -1,9 +1,48 @@
+# 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
 # ────────────────────
@@ -65,7 +104,12 @@ map global user -docstring 'clean tabs and trailing whitespace in selections' c
 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
 # ─────────────────────
@@ -82,7 +126,26 @@ plug "andreyorst/plug.kak" noload
         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
 
diff --git a/kak/plugins/.build/kakoune-smooth-scroll/config b/kak/plugins/.build/kakoune-smooth-scroll/config
new file mode 100644 (file)
index 0000000..1f93d39
--- /dev/null
@@ -0,0 +1,30 @@
+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}
+        }
+    }
+}
diff --git a/kak/plugins/.build/smarttab.kak/config b/kak/plugins/.build/smarttab.kak/config
new file mode 100644 (file)
index 0000000..c43b50f
--- /dev/null
@@ -0,0 +1,21 @@
+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}
+        }
+    }
+}
diff --git a/kak/plugins/connect.kak b/kak/plugins/connect.kak
new file mode 160000 (submodule)
index 0000000..a536605
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit a536605a208149eed58986bda54f3dda215dfe61
diff --git a/kak/plugins/kakoune-sudo-write b/kak/plugins/kakoune-sudo-write
new file mode 160000 (submodule)
index 0000000..ec0d6d2
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit ec0d6d26ceaadd93d6824630ba587b31e442214d
diff --git a/kak/plugins/prelude.kak b/kak/plugins/prelude.kak
new file mode 160000 (submodule)
index 0000000..5dbdc02
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 5dbdc020c546032885c1fdb463e366cc89fc15ad
diff --git a/kak/plugins/smarttab.kak b/kak/plugins/smarttab.kak
new file mode 160000 (submodule)
index 0000000..86ac659
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 86ac6599b13617ff938905ba4cdd8225d7eb6a2e