diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-20 15:24:16 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-21 13:39:46 +0530 |
| commit | dff6bdcbd6951a38d1d4f43b4ab5342fbe4ca258 (patch) | |
| tree | c9c4fc0f432e6aca5c9b4c60cd46390dacd87078 /autoload/git.kak | |
| parent | 9fe68adda01dd932b76b55f727edd8f42937b812 (diff) | |
| download | kakoune-config-dff6bdcbd6951a38d1d4f43b4ab5342fbe4ca258.tar.gz kakoune-config-dff6bdcbd6951a38d1d4f43b4ab5342fbe4ca258.zip | |
Add org syntax + some commands
Diffstat (limited to '')
| -rw-r--r-- | autoload/git.kak | 64 |
1 files changed, 17 insertions, 47 deletions
diff --git a/autoload/git.kak b/autoload/git.kak index 6f4015c..e0db3c4 100644 --- a/autoload/git.kak +++ b/autoload/git.kak @@ -3,12 +3,16 @@ define-command gitui -params .. %{ } declare-user-mode git +declare-user-mode git-r map global user g ': enter-user-mode git<ret>' -docstring 'Git mode' map global git s ': gitui<ret>' -docstring 'Git tui' map global git A ': git add %val{buffile}<ret>' -docstring 'Add file' map global git c ': git add commit<ret>' -docstring 'Commit' map global git C ': git add commit --amend<ret>' -docstring 'Amend commit' +map global git r ': enter-user-mode git-r<ret>' -docstring 'Git re(base/set) mode' +map global git-r f ': git reset HEAD^1 -- %val{buffile}<ret>' -docstring 'Split file out of last commit' + # Hunk map global git n ': git next-hunk<ret>' -docstring 'Next hunk' map global git p ': git prev-hunk<ret>' -docstring 'Previous hunk' @@ -20,56 +24,22 @@ set-option global git_diff_mod_char "~" set-option global git_diff_top_char "^" define-command git-toggle-diff %{ - try %{ remove-highlighter window/git-diff } catch %{ git show-diff } + try %{ remove-highlighter window/git-diff } catch %{ git show-diff } catch %{ } } # TODO: Toggle this -hook global -group git-diff-if-repo EnterDirectory .* %{ - remove-hooks global git-diff - evaluate-commands %sh{ - if (git rev-parse --is-inside-work-tree >/dev/null 2>&1); then - echo " - hook global -group git-diff ModeChange .*:.*:normal %{ try %{git update-diff} } - hook global -group git-diff WinCreate .* %{ try %{git update-diff} } - hook global -group git-diff BufReload .* %{ try %{git update-diff} } - " - fi - } -} - -# Git window actions - -# declare-option -hidden str git_file -# define-command -hidden git-eval-status-line %{ -# evaluate-commands %sh{ -# file=$(echo "$kak_selection" | sed 's/^\s*[A-Z?]\+\s\+//') -# echo "set-option window git_file '$file'" +# hook global -group git-diff-if-repo EnterDirectory .* %{ +# remove-hooks global git-diff +# try %{ +# evaluate-commands %sh{ +# if (git rev-parse --is-inside-work-tree >/dev/null 2>&1); then +# echo " +# hook global -group git-diff ModeChange .*:.*:normal %{ try %{git update-diff} } +# hook global -group git-diff WinCreate .* %{ try %{git update-diff} } +# hook global -group git-diff BufReload .* %{ try %{git update-diff} } +# " +# fi +# } # } # } -# declare-user-mode git-status-commit -# declare-user-mode git-status-log -# map global git s ':git status -bs<ret>' -docstring 'Git status UI' -# hook -group git-status global WinSetOption filetype=git-status %{ -# set-option buffer readonly true -# map window normal R ':git status -bs<ret>' -# map window normal q ': delete-buffer %val{buffile}<ret>' - -# map window user l ': enter-user-mode git-status-log<ret>' -# map window git-status-log l ': git log --oneline<ret>' -# map window normal d 'x: git-eval-status-line<ret>: git diff -- %opt{git_file}' - -# map window normal c ': enter-user-mode git-status-commit<ret>' -# map window git-status-commit c ': git commit<ret>' -# map window git-status-commit a ': git commit --amend<ret>' -# } - -# hook -group git-log global WinSetOption filetype=git-log %{ -# set-option buffer readonly true -# map window normal q ': git status -bs<ret>' -# } - -# hook -group git-diff global WinSetOption filetype=git-diff %{ -# set-option buffer readonly true -# map window normal q ': git status -bs<ret>' -# } |
