diff --git a/kakoune/.config/kak/kakrc b/kakoune/.config/kak/kakrc index e24a429..87b326a 100644 --- a/kakoune/.config/kak/kakrc +++ b/kakoune/.config/kak/kakrc @@ -41,6 +41,13 @@ map global -docstring 'Delete buffer' file-mode 'x' ': delete-buffer ' map global -docstring 'REPL send selection' file-mode 'u' ': repl-send-text' map global -docstring 'REPL send paragraph' file-mode 'U' ': repl-send-paragraph' +declare-user-mode fossil-mode +map global -docstring 'Fossil' user 'f' ': enter-user-mode fossil-mode' + +map global -docstring 'Open file' fossil-mode 'a' ': file-open-fossil' +map global -docstring 'Grep' fossil-mode 'g' ':fossil-grep ' +map global -docstring 'ctags project symbols' fossil-mode 'w' ': ctags-project-fossil-symbols' + declare-user-mode git-mode map global -docstring 'Git' user 'g' ': enter-user-mode git-mode' @@ -80,6 +87,7 @@ map global -docstring 'Code' user 'c' ': enter-user-mode code-mode' map global -docstring 'Comment block' code-mode 'b' ': comment-block' map global -docstring 'Comment line' code-mode 'l' ': comment-line' +map global -docstring 'Format buffer' code-mode 'f' ': format-buffer' evaluate-commands %sh{ if [ -n "$WAYLAND_DISPLAY" ]; then @@ -113,6 +121,16 @@ define-command -override file-open-git %{ prompt -menu -shell-script-candidates %{ git ls-files } 'File (git): ' %{ edit -- %val{text} } } +define-command -override file-open-fossil %{ + prompt -menu -shell-script-candidates %{ fossil ls } 'File (git): ' %{ edit -- %val{text} } +} + +define-command -override fossil-grep -params 1- %{ + evaluate-commands %sh{ + printf '%s ' grep "$@" -- $(fossil ls) + } +} + define-command -override file-open-recent %{ prompt -menu -shell-script-candidates %{ cat ~/.cache/kak-mru } 'File (recent): ' %{ edit -- %val{text} } } @@ -164,6 +182,14 @@ define-command -override ctags-project-symbols %{ } } +define-command -override ctags-project-fossil-symbols %{ + prompt -menu -shell-script-candidates %{ + fossil ls | xargs wc | awk '$1 > 0 && $3/$1 < 1024 { print $4 }' | xargs ctags -uo - -x | awk -f "$kak_config/scripts/projectsymbols.awk" + } 'Project symbols: ' %{ + evaluate-commands %sh{ awk -f "$kak_config/scripts/projectsymbolscmd.awk" # "$kak_text" } + } +} + set-face global JumpLabel 'rgb:faf8f5,rgb:af8842+F' # CHANGE STATUS BAR COLOR IN INSERT MODE