~cricket/dotfiles

b285c885dbedb7c9ac2229079a6274bb555061e9 — c piapiac 4 months ago 593cae2
kak: clean up & update configuration
A .config/kak/colemak.kak => .config/kak/colemak.kak +35 -0
@@ 0,0 1,35 @@
map global normal n h                   -docstring "move left"
map global normal <a-n> <a-h>           -docstring "select to line begin"
map global normal <c-n> <c-h>           -docstring "delete char before cursor"
map global goto   n h                   -docstring "line start"
map global view   n h                   -docstring "scroll left"
map global normal N H                   -docstring "extend left"
map global normal <a-N> <a-H>           -docstring "extend to line begin"
map global normal h n                   -docstring "select next search pattern match"
map global normal <a-h> <a-n>           -docstring "select previous search pattern match"
map global normal H N                   -docstring "extend with next search pattern match"
map global normal <a-H> <a-N>           -docstring "extend with previous search pattern match"

map global normal e j                   -docstring "move down"
map global goto   e j                   -docstring "buffer bottom"
map global view   e j                   -docstring "scroll down"
map global normal E J                   -docstring "extend down"

map global normal i k                   -docstring "move up"
map global normal <c-i> <c-k>           -docstring "delete to line end"
map global goto   i k                   -docstring "buffer top"
map global view   i k                   -docstring "scroll up"
map global normal I K                   -docstring "extend up"
map global normal k i                   -docstring "insert before selection"
map global goto   k i                   -docstring "line non blank start"

map global normal o l                   -docstring "move right"
map global normal <a-o> <a-l>           -docstring "select to line end"
map global goto   o l                   -docstring "line end"
map global view   o l                   -docstring "scroll right"
map global normal O L                   -docstring "extend right"
map global normal <a-O> <a-L>           -docstring "extend to line end"
map global normal l o                   -docstring "insert on a new line below"
map global normal <a-l> <a-o>           -docstring "add an empty line below cursor"
map global normal L O                   -docstring "insert on a new line above"
map global normal <c-L> <c-O>           -docstring "add an empty line above cursor"

A .config/kak/colors/pink_panther.kak => .config/kak/colors/pink_panther.kak +64 -0
@@ 0,0 1,64 @@
# personal theme i've dubbed 'pink_panther'

evaluate-commands %sh{
    bg="rgb:FCEADE"
    fg="rgb:32292F"

    pink="rgb:F374AE"
    green="rgb:465C69"
    yellow="rgb:DC851F"
    blue="rgb:386FA4"
    magenta="rgb:7E1946"
    cyan="rgb:297373"

    echo "
    # code highlighting
    face global value           ${pink}
    face global type            ${fg}
    face global variable        ${cyan}
    face global module          ${green}
    face global function        ${magenta}
    face global string          ${cyan}
    face global keyword         ${magenta}
    face global operator        ${yellow}
    face global attribute       ${magenta}
    face global comment         ${green}+i
    face global documentation   ${green}+i
    face global meta            ${magenta}
    face global builtin         ${fg}+b

    # markup highlighting
    face global title		${green}+b
    face global header		${blue}+b
    face global mono		${cyan}
    face global block		${magenta}
    face global link		${blue}+u
    face global bullet		${cyan}
    face global list		${yellow}

    # builtin faces
    face global Default             ${fg},${bg}
    face global PrimarySelection    ${bg},${pink}+fg
    face global SecondarySelection  ${fg},${pink}+fg
    face global PrimaryCursor       ${bg},${fg}+fg
    face global SecondaryCursor     ${bg},${fg}+fg
    face global PrimaryCursorEol    ${fg},${magenta}+fg
    face global SecondaryCursorEol  ${fg},${magenta}+fg
    face global LineNumbers         ${fg},${bg}
    face global LineNumberCursor    ${bg},${fg}+b
    face global MenuForeground      ${fg},${pink}+b
    face global MenuBackground      ${pink},${fg}
    face global MenuInfo            ${pink}
    face global Information         ${bg},${pink}
    face global Error               ${bg},${pink}+b
    face global StatusLine          ${fg},${bg}
    face global StatusLineMode      ${green},${bg}
    face global StatusLineInfo      ${magenta},${bg}
    face global StatusLineValue     ${green},${bg}
    face global StatusCursor        ${fg},${cyan}
    face global Prompt              ${pink},${bg}
    face global MatchingChar        ${fg},${bg}+b
    face global Whitespace          ${fg},${bg}+f
    face global BufferPadding       ${cyan},${bg}+b
    "
}

M .config/kak/kakrc => .config/kak/kakrc +11 -89
@@ 1,95 1,17 @@
# cricket's configuration for kakoune

# 4 space indent width
set global tabstop 4
set global indentwidth 4

# plug.kak
source "%val{config}/plugins/plug.kak/rc/plug.kak"

# carp.kak
source "%val{config}/plugins/carp-kak/rc/carp.kak"

# zzz.kak
source "%val{config}/plugins/zzz.kak/rc/zzz.kak"

hook global WinSetOption filetype=(zzz) %{
    set global indentwidth 2
    set global tabstop 2
}

plug "abuffseagull/kakoune-discord" do %{ cargo install --path . --force } %{
    discord-presence-enable
}

# kak-lsp
plug "kak-lsp/kak-lsp" do %{
    cargo build --release --locked
} config %{
    hook global WinSetOption filetype=(rust|zig|c) %{
        lsp-enable-window
        lsp-auto-hover-enable
    }
}

# gruvbox colorscheme
colorscheme gruvbox-light
# looks
colorscheme pink_panther
add-highlighter global/ number-lines -relative -hlcursor

# copy & paste
map global user   y '<a-|>xclip -i -selection clipboard<ret>'
map global user   p '!xclip -o<ret>'

# hooks
hook global InsertCompletionShow .* %{
    map window insert <tab> <c-n>
    map window insert <s-tab> <c-p>
}

hook global InsertCompletionHide .* %{
    unmap window insert <tab> <c-n>
    unmap window insert <s-tab> <c-p>
}

hook global InsertChar \t %{ try %{
    execute-keys -draft "h<a-h><a-k>\A\h+\z<ret><a-;>;%opt{indentwidth}@"
}}

hook global InsertDelete ' ' %{ try %{
    execute-keys -draft 'h<a-h><a-k>\A\h+\z<ret>i<space><esc><lt>'
}}

# keymap for colemak
map global normal n h 			-docstring "move left"
map global normal <a-n> <a-h> 	-docstring "select to line begin"
map global normal <c-n> <c-h>	-docstring "delete char before cursor"
map global goto   n h 			-docstring "line start"
map global view   n h 			-docstring "scroll left"
map global normal N H 			-docstring "extend left"
map global normal <a-N> <a-H>	-docstring "extend to line begin"
map global normal h n 			-docstring "select next search pattern match"
map global normal <a-h> <a-n>	-docstring "select previous search pattern match"
map global normal H N			-docstring "extend with next search pattern match"
map global normal <a-H> <a-N>	-docstring "extend with previous search pattern match"

map global normal e j			-docstring "move down"
map global goto   e j			-docstring "buffer bottom"
map global view   e j			-docstring "scroll down"
map global normal E J			-docstring "extend down"

map global normal i k			-docstring "move up"
map global normal <c-i> <c-k>	-docstring "delete to line end"
map global goto   i k			-docstring "buffer top"
map global view   i k			-docstring "scroll up"
map global normal I K			-docstring "extend up"
map global normal k i			-docstring "insert before selection"
map global goto   k i			-docstring "line non blank start"
# plugins
source "%val{config}/plugins/plug.kak/rc/plug.kak"
source "%val{config}/plugins/ckt-kak/rc/ckt.kak"
source "%val{config}/plugins/zzz.kak/rc/zzz.kak"

map global normal o l			-docstring "move right"
map global normal <a-o> <a-l>	-docstring "select to line end"
map global goto   o l			-docstring "line end"
map global view   o l			-docstring "scroll right"
map global normal O L			-docstring "extend right"
map global normal <a-O> <a-L> 	-docstring "extend to line end"
map global normal l o			-docstring "insert on a new line below"
map global normal <a-l> <a-o>	-docstring "add an empty line below cursor"
map global normal L O			-docstring "insert on a new line above"
map global normal <c-L> <c-O>	-docstring "add an empty line above cursor"
# others
source "%val{config}/language.kak"
source "%val{config}/keys.kak"

A .config/kak/keys.kak => .config/kak/keys.kak +23 -0
@@ 0,0 1,23 @@
# copy & paste
map global user y '<a-|>xclip -i -selection clipboard<ret>' -docstring "yank to clipboard"
map global user p '!xclip -o<ret>'                          -docstring "paste from clipboard"

hook global InsertCompletionShow .* %{
    map window insert <tab> <c-n>
    map window insert <s-tab> <c-p>
}

hook global InsertCompletionHide .* %{
    unmap window insert <tab> <c-n>
    unmap window insert <s-tab> <c-p>
}

hook global InsertChar \t %{ try %{
    execute-keys -draft "h%opt{indentwidth}@"
}}

hook global InsertDelete ' ' %{ try %{
    execute-keys -draft '<a-h><a-k>^\h+.\z<ret>I<space><esc><lt>'
}}

source "%val{config}/colemak.kak"

A .config/kak/language.kak => .config/kak/language.kak +23 -0
@@ 0,0 1,23 @@
hook global WinSetOption filetype=zzz %{
    set buffer indentwidth 2
}

hook global WinSetOption filetype=zig %{
    set-option buffer formatcmd 'zig fmt --stdin'

    add-highlighter window/ column 153 yellow,blue
    set window autowrap_column 153
    autowrap-enable

    hook window BufWritePre .* format
}

plug "kak-lsp/kak-lsp" do %{
    cargo build --release --locked
} config %{
    hook global WinSetOption filetype=(c|nim|rust|zig) %{
        lsp-enable-window
        lsp-auto-hover-enable
    }
}


A .config/kak/plugins/ckt-kak => .config/kak/plugins/ckt-kak +1 -0
@@ 0,0 1,1 @@
Subproject commit 731b94ebb6af568dc08480fd547b1309f21058a2