73 lines
2.5 KiB
Text
73 lines
2.5 KiB
Text
eval %sh{ kak-tree-sitter -dks --init $kak_session }
|
|
colorscheme ashen
|
|
|
|
# disable clippy
|
|
set-option global ui_options terminal_assistant=none
|
|
|
|
hook global ModuleLoaded wayland %{
|
|
set-option global termcmd 'footclient sh -c'
|
|
}
|
|
|
|
hook global WinSetOption filetype=kak %{
|
|
set-option window formatcmd "%val{config}/scripts/kakfmt"
|
|
}
|
|
|
|
hook global WinSetOption filetype=markdown %{
|
|
set-option window formatcmd "dprint fmt --stdin md"
|
|
}
|
|
|
|
# open tutor (needs curl)
|
|
define-command trampoline -docstring "open a tutorial" %{
|
|
evaluate-commands %sh{
|
|
tramp_file=$(mktemp -t "kakoune-trampoline.XXXXXXXX")
|
|
echo "edit -fifo $tramp_file *TRAMPOLINE*"
|
|
curl -s https://raw.githubusercontent.com/mawww/kakoune/master/contrib/TRAMPOLINE -o "$tramp_file"
|
|
}
|
|
}
|
|
|
|
set-option global tabstop 4
|
|
|
|
set-option global indentwidth 4
|
|
|
|
set-option global scrolloff 3,3
|
|
|
|
# define-command -override tree-sitter-use-after-highlighter %{
|
|
# add-highlighter -override buffer/
|
|
# }
|
|
add-highlighter global/bracket regex [\[\]\(\)\{\}]{1} 0:red
|
|
# add-highlighter global/bracket regex [\[\]\(\)\{\}]{1} 0:rgb:737373
|
|
add-highlighter global/ number-lines -hlcursor -relative -separator " "
|
|
add-highlighter global/ show-whitespaces -lf "" -tab "" -only-trailing
|
|
add-highlighter global/ show-matching
|
|
add-highlighter global/ wrap -word -indent
|
|
|
|
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 -n<ret>"
|
|
map -docstring "paste the clipboard before" global user P "! wl-paste -n<ret>"
|
|
map -docstring "replace with the clipboard" global user R '"_d! wl-paste -n<ret>'
|
|
|
|
map -docstring "quit" global user q ":q<ret>"
|
|
map -docstring "save" global normal <c-s> ": w<ret>"
|
|
|
|
map -docstring "close current buffer" global user x ": db<ret>"
|
|
map -docstring "goto previous buffer" global user m ": bp<ret>"
|
|
map -docstring "goto next buffer" global user i ": bn<ret>"
|
|
|
|
# map global normal X "x<a-semicolon>"
|
|
|
|
# map global normal <c-u> ":exec <c-u>vv<ret>"
|
|
# map global normal <c-d> ":exec <c-d>vv<ret>"
|
|
|
|
map global normal <tab> _
|
|
map -docstring "commenct line" global normal <c-v> ":comment-line<ret>"
|
|
|
|
declare-user-mode git
|
|
map -docstring "git" global user g ": enter-user-mode git<ret>"
|
|
map -docstring "lazygit" global git g ": terminal lazygit<ret>"
|
|
def git_blame %{
|
|
info %sh{
|
|
git -C $(dirname $(realpath $kak_buffile)) blame -L $kak_cursor_line,$kak_cursor_line $(realpath $kak_buffile)
|
|
}
|
|
}
|
|
map -docstring "blame" global git b ": git_blame"
|