]> Freerunner's - dotfiles.git/commitdiff
kakoune initial config
authorAndre Ramnitz <tux.rising@gmail.com>
Thu, 11 May 2023 00:35:36 +0000 (02:35 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Thu, 11 May 2023 00:35:36 +0000 (02:35 +0200)
kak/colors/base16.kak [new file with mode: 0644]
kak/kakrc [new file with mode: 0644]
kak/plugins/.build/bookmarks.kak/config [new file with mode: 0644]
kak/plugins/.build/powerline.kak/config [new file with mode: 0644]
kak/plugins/bookmarks.kak [new submodule]
kak/plugins/plug.kak [new submodule]
kak/plugins/powerline.kak [new submodule]
kak/plugins/shellcheck.kak [new submodule]

diff --git a/kak/colors/base16.kak b/kak/colors/base16.kak
new file mode 100644 (file)
index 0000000..0ae479e
--- /dev/null
@@ -0,0 +1,76 @@
+##
+## base16.kak by lenormf
+##
+
+evaluate-commands %sh{
+    black_lighterer='rgb:383838'
+    black_lighter='rgb:2D2D2D'
+    black_light='rgb:1C1C1C'
+    cyan_light='rgb:7CB0FF'
+    green_dark='rgb:A1B56C'
+    grey_dark='rgb:585858'
+    grey_medium='rgb:989898'
+    grey_light='rgb:D8D8D8'
+    magenta_dark='rgb:AB4642'
+    magenta_light='rgb:AB4434'
+    orange_dark='rgb:DC9656'
+    orange_light='rgb:F7CA88'
+    purple_dark='rgb:BA8BAF'
+
+    ## code
+    echo "
+        face global value ${orange_dark}+b
+        face global type ${orange_light}
+        face global variable ${magenta_dark}
+        face global module ${green_dark}
+        face global function ${cyan_light}
+        face global string ${green_dark}
+        face global keyword ${purple_dark}+b
+        face global operator ${cyan_light}
+        face global attribute ${orange_dark}
+        face global comment ${grey_medium}
+        face global documentation comment
+        face global meta ${orange_light}
+        face global builtin default+b
+    "
+
+    ## markup
+    echo "
+        face global title blue
+        face global header ${cyan_light}
+        face global mono ${green_dark}
+        face global block ${orange_dark}
+        face global link blue
+        face global bullet ${magenta_light}
+        face global list ${magenta_dark}
+    "
+
+    ## builtin
+    echo "
+        face global Default ${grey_light},${black_light}
+        face global PrimarySelection white,blue+fg
+        face global SecondarySelection black,blue+fg
+        face global PrimaryCursor black,white+fg
+        face global SecondaryCursor black,white+fg
+        face global PrimaryCursorEol black,${cyan_light}+fg
+        face global SecondaryCursorEol black,${cyan_light}+fg
+        face global LineNumbers ${grey_light},${black_lighter}
+        face global LineNumberCursor ${grey_light},rgb:282828+b
+        face global MenuForeground ${grey_light},blue
+        face global MenuBackground blue,${grey_light}
+        face global MenuInfo ${cyan_light}
+        face global Information ${black_light},${cyan_light}
+        face global Error ${grey_light},${magenta_light}
+        face global DiagnosticError ${magenta_light}
+        face global DiagnosticWarning ${cyan_light}
+        face global StatusLine ${grey_light},${black_lighterer}
+        face global StatusLineMode ${orange_dark}
+        face global StatusLineInfo ${cyan_light}
+        face global StatusLineValue ${green_dark}
+        face global StatusCursor ${black_lighterer},${cyan_light}
+        face global Prompt ${black_light},${cyan_light}
+        face global MatchingChar ${cyan_light},${black_light}+b
+        face global BufferPadding ${cyan_light},${black_lighter}
+        face global Whitespace ${grey_dark}+f
+    "
+}
diff --git a/kak/kakrc b/kak/kakrc
new file mode 100644 (file)
index 0000000..0205810
--- /dev/null
+++ b/kak/kakrc
@@ -0,0 +1,88 @@
+# 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
+colorscheme default
+
+# Enable editor config
+# ────────────────────
+hook global WinCreate ^[^*]+$ %{ editorconfig-load }
+
+# Extra editor commands
+# ─────────────────────
+# tab replacement
+define-command clean-selections -docstring 'Replace tabs with spaces and trim trailing whitespace' %{ try %{
+    execute-keys -draft @s\h+$<ret>d
+} }
+define-command clean-buffer -docstring 'Replace tabs with spaces and trim trailing whitespace' %{ try %{
+    execute-keys -draft \%@s\h+$<ret>d
+} }
+# Bring back <c-a> and <c-x> from Vim to increment/decrement the number under the cursor
+define-command -hidden -params 2 inc %{ try %{
+    evaluate-commands %sh{
+        [ "$1" = 0 ] && count=1 || count="$1"
+        printf '%s%s' 'exec h"_/\d<ret><a-i>na' "$2($count)<esc>|{<space>cat<semicolon>echo<semicolon>}|bc<ret>"
+    }
+} catch %{
+    execute-keys l
+}}
+
+# File management
+# ───────────────
+# nnn
+declare-option str kak_open "%val{config}/kak_open"
+define-command nnn -docstring "open nnn" -params .. %{
+    terminal sh -c "NNN_OPENER=%opt{kak_open} KAK_SESSION=%val{session} KAK_CLIENT=%val{client} nnn %arg{@}"
+}
+complete-command nnn file
+# broot
+define-command broot -docstring "open broot" -params .. %{
+    terminal sh -c "EDITOR=%opt{kak_open} KAK_SESSION=%val{session} KAK_CLIENT=%val{client} broot %arg{@}"
+}
+complete-command broot file
+# fuzzy finders
+define-command find -docstring "find files" -params 1 %{ edit %arg{1} }
+complete-command find shell-script-candidates %{ find . -type f }
+alias global f find
+
+# Various mappings
+# ────────────────
+map global normal '#' :comment-line<ret> -docstring 'comment line'
+map global normal '<a-#>' :comment-block<ret> -docstring 'comment block'
+map global goto m '<esc>m;' -docstring 'matching char'
+map -docstring 'select lines downwards' global normal X T<ret>Lx
+# see #inc
+map global normal <c-a> ': inc %val{count} +<ret>'
+map global normal <c-x> ': inc %val{count} -<ret>'
+
+# User modes
+# # ──────────
+map global user -docstring 'enable autocomplete' a ': set-option -add buffer autocomplete insert<ret>'
+map global user -docstring 'disable autocomplete' A ': set-option -remove buffer autocomplete insert<ret>'
+map global user -docstring 'edit kakrc' e ': e ~/.config/kak/kakrc<ret>'
+map global user -docstring 'clean tabs and trailing whitespace in selections' c ': clean-selections<ret>'
+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>'
+
+# Enable PLUGin manager
+# ─────────────────────
+source "%val{config}/plugins/plug.kak/rc/plug.kak"
+plug "andreyorst/plug.kak" noload
+
+    plug "andreyorst/powerline.kak" defer powerline_base16 %{
+        powerline-theme base16
+    } config %{
+        powerline-start
+    }
+
+    plug "Ersikan/bookmarks.kak" %{
+        hook global WinCreate .* bookmarks-enable
+    }
+
+    plug "whereswaldon/shellcheck.kak" 
+# PLUGin ends
+
+
diff --git a/kak/plugins/.build/bookmarks.kak/config b/kak/plugins/.build/bookmarks.kak/config
new file mode 100644 (file)
index 0000000..d88dc49
--- /dev/null
@@ -0,0 +1,19 @@
+try %{ 
+
+        hook global WinCreate .* bookmarks-enable
+     } catch %{
+    echo -debug "Error while evaluating 'bookmarks.kak' configuration: %val{error}"
+
+    set-option -add current plug_conf_errors "Error while evaluating 'bookmarks.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/.build/powerline.kak/config b/kak/plugins/.build/powerline.kak/config
new file mode 100644 (file)
index 0000000..9da9dda
--- /dev/null
@@ -0,0 +1,19 @@
+try %{ 
+
+        powerline-start
+     } catch %{
+    echo -debug "Error while evaluating 'powerline.kak' configuration: %val{error}"
+
+    set-option -add current plug_conf_errors "Error while evaluating 'powerline.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/bookmarks.kak b/kak/plugins/bookmarks.kak
new file mode 160000 (submodule)
index 0000000..2e92602
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 2e92602eef5ed1717660689765b93583eecce099
diff --git a/kak/plugins/plug.kak b/kak/plugins/plug.kak
new file mode 160000 (submodule)
index 0000000..f28b3fb
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit f28b3fb88fbc77d69b1027780cb9a16b0bd7fc76
diff --git a/kak/plugins/powerline.kak b/kak/plugins/powerline.kak
new file mode 160000 (submodule)
index 0000000..c5ef9a8
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit c5ef9a845bbd886c73ef00c0efff986e02d5f5d8
diff --git a/kak/plugins/shellcheck.kak b/kak/plugins/shellcheck.kak
new file mode 160000 (submodule)
index 0000000..4e63397
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 4e633978c119bbb71f215828f7b59cea71a2c5a4