~piotr-machura/dotfiles

f33288fdbe6c4501197bb837b5c413f8925f3043 — Piotr Machura 2 months ago cd2d948
Add separate command section to kakoune config
1 files changed, 24 insertions(+), 18 deletions(-)

M .config/kak/kakrc
M .config/kak/kakrc => .config/kak/kakrc +24 -18
@@ 11,7 11,7 @@ hook global BufNewFile  .* autoconfigtab

# User interface
colorscheme bright
add-highlighter global/ number-lines -hlcursor -separator '╎ ' -cursor-separator '│ '
add-highlighter global/ number-lines -hlcursor -separator '╎'
add-highlighter global/ wrap -word -indent -marker '↳ '
add-highlighter global/ show-matching
add-highlighter global/ show-whitespaces -spc ' ' -lf ' ' -tab '⇥' -tabpad ' '


@@ 20,23 20,6 @@ set-option -add global ui_options terminal_enable_mouse=false

# KEYMAPS
# -------
define-command skim -docstring 'Choose a file and open it in new client' %{
    terminal \
    sh -ce "f=`sk --height=100`; exec kak -c %val{session} ""$f"""
}
define-command xclip-yank -docstring 'Yank selection into system clipboard' %{
    execute-keys -draft '<a-|> xclip -in -selection clipboard<ret>'
    echo 'yanked selection into system clipboard'
}
define-command xclip-paste -docstring 'Paste from system clipboard' %{
    execute-keys -draft '! xclip -out -selection clipboard<ret>'
    echo 'pasted from system clipboard'
}
declare-option -docstring 'Used by format-width' int flowwidth 88
define-command format-width \
-docstring 'Format selection with fmt using %opt{flowwidth}' %{
    execute-keys "| fmt -w %opt{flowwidth}<ret>"
}
alias global wqa write-all-quit

map global normal <c-y> %{: xclip-yank<ret>}


@@ 93,6 76,29 @@ map global spell r %{: spell-replace<ret>} -docstring 'replace'
map global spell e %{: spell en<ret>} -docstring 'check (en)'
map global spell p %{: spell pl<ret>} -docstring 'check (pl)'

# COMMANDS
# --------
define-command skim -docstring 'Choose a file and open it in new client' %{
    terminal \
    sh -ce "f=`sk --height=100`; exec kak -c %val{session} ""$f"""
}

define-command xclip-yank -docstring 'Yank selection into system clipboard' %{
    execute-keys -draft '<a-|> xclip -in -selection clipboard<ret>'
    echo 'yanked selection into system clipboard'
}

define-command xclip-paste -docstring 'Paste from system clipboard' %{
    execute-keys -draft '! xclip -out -selection clipboard<ret>'
    echo 'pasted from system clipboard'
}

declare-option -docstring 'Used by format-width' int fmtwidth 88
define-command format-width \
-docstring 'Format selection with fmt using %opt{fmtwidth}' %{
    execute-keys "| fmt -w %opt{fmtwidth}<ret>"
}

# LSP
# ---
evaluate-commands %sh{