65 lines
2.2 KiB
Text
65 lines
2.2 KiB
Text
colorscheme desertex
|
|
|
|
add-highlighter global/ number-lines -relative -hlcursor
|
|
add-highlighter global/ show-matching
|
|
|
|
hook global BufWritePost .* %{ git show-diff }
|
|
hook global WinCreate .* %{ git show-diff }
|
|
|
|
define-command vifm %{
|
|
terminal sh -c %{
|
|
file=$(eval "vifm --select $3 --choose-files -")
|
|
printf "evaluate-commands -client '%s' %%{ edit -- '%s' }" \
|
|
"$2" "$file" \
|
|
| kak -p "$1"
|
|
} -- %val{session} %val{client} %val{buffile}
|
|
}
|
|
|
|
declare-option -docstring "command listing files for fzf" \
|
|
str fzf_files_cmd 'find . -type f -not -path *.git* -not -path */node_modules*'
|
|
|
|
define-command fzf-files -docstring "pick a file with fzf and open it" %{
|
|
terminal sh -c %{
|
|
file=$(eval "$3" | fzf) || exit 0
|
|
[ -n "$file" ] || exit 0
|
|
printf "evaluate-commands -client '%s' %%{ edit -- '%s' }" \
|
|
"$2" "$file" \
|
|
| kak -p "$1"
|
|
} -- %val{session} %val{client} %opt{fzf_files_cmd}
|
|
}
|
|
|
|
define-command lazygit -docstring "lazygit; 'e' edits in this kak session" %{
|
|
terminal sh -c %{
|
|
export KAK_SESSION=$1
|
|
lazygit
|
|
} -- %val{session}
|
|
}
|
|
|
|
map -docstring 'lsp' global user l ':enter-user-mode lsp<ret>'
|
|
map -docstring "git" global user g ":enter-user-mode git<ret>"
|
|
map -docstring "find" global user f ":enter-user-mode search<ret>"
|
|
|
|
# user
|
|
map -docstring "toogle comment" global user c ":comment-line<ret>"
|
|
map -docstring "format" global user F ":lsp-formatting<ret>"
|
|
map -docstring "lsp hint" global user K ":lsp-hover-buffer<ret>"
|
|
map -docstring "yank" global user y "<a-|>wl-copy<ret>"
|
|
map -docstring "paste" global user p "!wl-paste<ret>"
|
|
|
|
# git
|
|
declare-user-mode git
|
|
map -docstring "preview" global git p ":git show-diff<ret>"
|
|
map -docstring "next change" global git j ":git next-hunk<ret>"
|
|
map -docstring "previous change" global git k ":git prev-hunk<ret>"
|
|
map -docstring "previous lazygit" global git g ":lazygit<ret>"
|
|
|
|
# search
|
|
declare-user-mode search
|
|
map -docstring "file" global search f ":fzf-files<ret>"
|
|
map -docstring "grep" global search g ":grep<ret>"
|
|
map -docstring "vifm" global search k ":vifm<ret>"
|
|
|
|
eval %sh{kak-lsp}
|
|
lsp-enable
|
|
# lsp-auto-hover-enable
|
|
# set-option global modelinefmt "%opt{lsp_modeline} %opt{modelinefmt}"
|