Added Kakoune

This commit is contained in:
2026-04-26 00:28:41 +02:00
parent 355825df44
commit 8aba344904
3 changed files with 164 additions and 0 deletions
+2
View File
@@ -3,3 +3,5 @@
!.gitignore !.gitignore
!wezterm/ !wezterm/
!wezterm/** !wezterm/**
!kak/
!kak/**
+95
View File
@@ -0,0 +1,95 @@
# Mygruvbox theme for Kakoune
# Color palette
# declare-option str black 'rgb:282828'
declare-option str black default
declare-option str dark 'rgb:1d2021'
declare-option str gray 'rgb:928374'
declare-option str aqua 'rgb:8ec07c'
declare-option str white 'rgb:ebdbb2'
declare-option str blue 'rgb:83a598'
declare-option str cyan 'rgb:8be9fd'
declare-option str green 'rgb:b8bb26'
declare-option str peach 'rgb:E5C07B'
declare-option str orange 'rgb:fe8019'
declare-option str pink 'rgb:F879C6'
declare-option str purple 'rgb:d3869b'
declare-option str red 'rgb:fb4934'
declare-option str yellow 'rgb:fab2df'
declare-option str dimgray 'rgb:424242'
declare-option str psel 'rgba:50494580'
declare-option str ssel 'rgba:3c383880'
declare-option str background %opt{black}
declare-option str dimmed_background %opt{dark}
declare-option str foreground %opt{white}
# Reference
# https://github.com/mawww/kakoune/blob/master/colors/default.kak
# For code
set-face global value "%opt{purple}"
set-face global type "%opt{aqua}"
set-face global variable "%opt{orange}"
set-face global module "%opt{white}"
set-face global function "%opt{aqua}"
set-face global string "%opt{green}"
set-face global keyword "%opt{red}"
set-face global operator "%opt{pink}"
set-face global attribute "%opt{orange}"
set-face global bracket "%opt{white}+b"
set-face global arguement "%opt{orange}"
set-face global comma "%opt{white}"
# set-face global constant "%opt{white}+b"
set-face global comment "%opt{gray}+i"
set-face global meta "%opt{aqua}"
set-face global builtin "%opt{aqua}+b"
# For markup
set-face global title "%opt{pink}"
set-face global header "%opt{orange}"
set-face global bold "%opt{pink}"
set-face global italic "%opt{purple}"
set-face global mono "%opt{green}"
set-face global block "%opt{cyan}"
set-face global link "%opt{green}"
set-face global bullet "%opt{green}"
set-face global list "%opt{white}"
# Builtin faces
set-face global Default "%opt{white},%opt{black}"
# set-face global Default "%opt{white},default"
set-face global PrimarySelection "default,%opt{psel}"
set-face global SecondarySelection "default,%opt{ssel}"
set-face global PrimaryCursor "%opt{dark},%opt{purple}"
set-face global SecondaryCursor "%opt{dark},%opt{aqua}"
set-face global PrimaryCursorEol "%opt{dark},%opt{yellow}"
set-face global SecondaryCursorEol "%opt{dark},%opt{cyan}"
set-face global LineNumbers "%opt{gray},%opt{black}"
set-face global LineNumberCursor "%opt{yellow},%opt{black}+b"
set-face global LineNumbersWrapped "%opt{gray},%opt{black}+i"
set-face global MenuForeground "%opt{dark},%opt{white}+b"
set-face global MenuBackground "%opt{white},%opt{dark}"
set-face global MenuInfo "%opt{dark},%opt{orange}"
set-face global Information "%opt{yellow},%opt{black}"
set-face global Error "%opt{red},%opt{black}"
set-face global StatusLine "%opt{white},%opt{black}"
set-face global StatusLineMode "%opt{aqua},%opt{black}"
set-face global StatusLineInfo "%opt{purple},%opt{black}"
set-face global StatusLineValue "%opt{orange},%opt{black}"
set-face global StatusCursor "%opt{white},%opt{blue}"
set-face global Prompt "%opt{green},%opt{black}"
set-face global MatchingChar "%opt{blue},%opt{black}"
set-face global Whitespace "%opt{dimgray},%opt{black}+f"
set-face global WrapMarker Whitespace
set-face global BufferPadding "%opt{gray},%opt{black}"
# Dimmed background
hook -always global ModeChange 'push:normal:insert' %{
set-face window Default "%opt{foreground},%opt{dimmed_background}"
}
# Restore background
hook -always global ModeChange 'pop:insert:normal' %{
set-face window Default "%opt{foreground},%opt{background}"
}
+67
View File
@@ -0,0 +1,67 @@
colorscheme mygruvbox
add-highlighter global/ number-lines -hlcursor
# Highlight trailing whitespace
# Softwrap long lines
add-highlighter global/ wrap -word -indent -marker ">>>"
add-highlighter global/ show-whitespaces
set-option global ui_options terminal_status_on_top=true
set-option global tabstop 4
set-option global indentwidth 4
set-option global scrolloff 1,3
# Clipboard management mappings
map -docstring "yank the selection into the clipboard" global user y "<a-|> wl-copy<ret>"
map -docstring "paste the clipboard" global user p "<a-!> wl-paste<ret>"
map -docstring "Show filetype" global user t ': echo %opt{filetype}<ret>'
map -docstring "Open file" global user o ': tmux-repl-vertical "echo ""evaluate-commands -client %val{client} e $(fzf)"" | kak -p %val{session}"<ret>'
map -docstring "Zeile auskommentieren" global normal <C-l> ":comment-line<ret>"
map -docstring "Speichern" global normal <C-s> ":w<ret>"
map -docstring "Beenden" global normal <C-q> ":q<ret>"
map -docstring "Cursor nach oben erweitern" global normal <C-k> "<a-C><ret>"
map -docstring "Cursor nach unten erweitern" global normal <C-j> "<C><ret>"
map global normal <C-up> '|echo "$(($kak_selection + 1))"<ret>'
map global normal <C-down> '|echo "$(($kak_selection - 1))"<ret>'
hook global InsertCompletionShow .* %{
try %{
# this command temporarily removes cursors preceded by whitespace;
# if there are no cursors left, it raises an error, does not
# continue to execute the mapping commands, and the error is eaten
# by the `try` command so no warning appears.
execute-keys -draft 'h<a-K>\h<ret>'
map window insert <tab> <c-n>
map window insert <ret> <c-m>
map window insert <s-tab> <c-p>
hook -once -always window InsertCompletionHide .* %{
unmap window insert <tab> <c-n>
unmap window insert <ret> <c-m>
unmap window insert <s-tab> <c-p>
}
}
}
# Convert spaces to tabs
hook global BufWritePre .* %{
try %{ execute-keys -draft '%@' }
}
# hook global BufWritePost .* %{
# echo %sh{ sassc main.scss > main.css }
# }
nop %sh{ {
sleep 10
echo "eval -client '$kak_client' 'echo sleep ended'" |
kak -p ${kak_session}
} > /dev/null 2>&1 < /dev/null & }
eval %sh{kak-lsp}
lsp-enable
lsp-inlay-diagnostics-enable global