diff --git a/kakoune/.config/kak/kakrc b/kakoune/.config/kak/kakrc index 3b296dd..231596f 100644 --- a/kakoune/.config/kak/kakrc +++ b/kakoune/.config/kak/kakrc @@ -15,28 +15,48 @@ nop %sh{ [ -e "$kak_config/autoload/stdlib" ] || ln -s "$kak_runtime/autoload" "$kak_config/autoload/stdlib" } -declare-user-mode file-mode -declare-user-mode options-mode - -map global -docstring 'File' user 'f' ': enter-user-mode file-mode' map global -docstring 'Buffer' user ' ' ': b ' +declare-user-mode file-mode +map global -docstring 'Search/open' user 's' ': enter-user-mode file-mode' + map global -docstring 'Open (git)' file-mode 'a' ': file-open-git' -map global -docstring 'Git diff file' file-mode 'd' ': git diff %val{buffile}' map global -docstring 'Open (fd)' file-mode 'f' ': file-open' map global -docstring 'Open (recent)' file-mode 'r' ': file-open-recent' -map global -docstring 'Git grep' file-mode 'g' ': git grep ' map global -docstring 'Open (nnn)' file-mode 'n' ': nnn-open %val{buffile}' map global -docstring 'Open (nnn)' file-mode 'N' ': nnn-open .' map global -docstring 'Open/create in dir' file-mode 'c' ': open-create-in-dir' +declare-user-mode git-mode +map global -docstring 'Git' user 'g' ': enter-user-mode git-mode' + +map global -docstring 'Blame' git-mode 'b' ': git blame' +map global -docstring 'Blame' git-mode 'B' ': git blame-jump' +map global -docstring 'Diff file' git-mode 'd' ': git diff %val{buffile}' +map global -docstring 'Grep' git-mode 'g' ': git grep ' +map global -docstring 'Log' git-mode 'l' ': git log -- %val{buffile}' +map global -docstring 'Log' git-mode 'L' ': git log' +map global -docstring 'Show diff' git-mode 's' ': git show-diff' +map global -docstring 'Hide diff' git-mode 'h' ': git hide-diff' +map global -docstring 'Next hunk' git-mode 'n' ': git next-hunk' +map global -docstring 'Prev hunk' git-mode 'p' ': git prev-hunk' + +declare-user-mode options-mode map global -docstring 'Options' user 'o' ': enter-user-mode options-mode' -map global -docstring 'LP Dark mode' options-mode 'd' ': colorscheme five-colors-dark' -map global -docstring 'LP Light mode' options-mode 'l' ': colorscheme five-colors-light' +map global -docstring 'Five Dark mode' options-mode 'd' ': colorscheme five-colors-dark' +map global -docstring 'Five Light mode' options-mode 'l' ': colorscheme five-colors-light' map global -docstring 'Light mode' options-mode 'L' ': colorscheme one-light' map global -docstring 'Dark mode' options-mode 'D' ': colorscheme one-darker' +declare-user-mode make-mode +map global -docstring 'Make' user 'k' ': enter-user-mode make-mode' + +map global -docstring 'Make' make-mode 'a' ':make ' +map global -docstring 'Next' make-mode 'n' ': make-next-error' +map global -docstring 'Previous' make-mode 'p' ': make-previous-error' +map global -docstring 'General messages' make-mode 'g' ': set window make_error_pattern "^([^:\n]+):(\d+):(?:(\d+):)? ([^\n]+)?"' + evaluate-commands %sh{ if [ -n "$WAYLAND_DISPLAY" ]; then echo " @@ -77,6 +97,11 @@ define-command -override open-create-in-dir %{ execute-keys ': edit ' %sh{dirname "$kak_buffile"}/ } +define-command git-log-show-current-commit %{ + execute-keys ';^commit\s[0-9a-f]+b' + git show %val{selection} +} + set-face global JumpLabel 'rgb:faf8f5,rgb:af8842+F' # CHANGE STATUS BAR COLOR IN INSERT MODE @@ -133,7 +158,7 @@ bundle-theme kakoune-themes 'https://codeberg.org/anhsirk0/kakoune-themes' # FZF bundle fzf.kak 'https://github.com/andreyorst/fzf.kak' %{ - map global -docstring 'FZF menu' user s ': fzf-mode' + map global -docstring 'FZF menu' user 'f' ': fzf-mode' require-module fzf set-option global fzf_highlight_command "bat" } @@ -190,15 +215,13 @@ bundle 'peneira' 'https://github.com/gustavo-hms/peneira' %{ map global -docstring 'Buffer' user ' ' ': buffers' - declare-user-mode peneira-mode - map global -docstring 'Peneira' user 'd' ': enter-user-mode peneira-mode' - map global -docstring 'Git files' peneira-mode 'a' ': peneira-git-files' - map global -docstring 'Buffers' peneira-mode 'b' ': buffers' - map global -docstring 'Files' peneira-mode 'f' ': peneira-files' - map global -docstring 'Files' peneira-mode 'F' ': peneira-local-files' - map global -docstring 'Lines' peneira-mode 'l' ': peneira-lines' - map global -docstring 'Symbols' peneira-mode 's' ': peneira-symbols' - map global -docstring 'Recent files' peneira-mode 'r' ': peneira-recent-files' + map global -docstring 'Git files' file-mode 'a' ': peneira-git-files' + map global -docstring 'Buffers' file-mode 'b' ': buffers' + map global -docstring 'Files' file-mode 'f' ': peneira-files' + map global -docstring 'Files' file-mode 'F' ': peneira-local-files' + map global -docstring 'Lines' file-mode 'l' ': peneira-lines' + map global -docstring 'Symbols' file-mode 's' ': peneira-symbols' + map global -docstring 'Recent files' file-mode 'r' ': peneira-recent-files' } # LOCAL