diff options
| author | Benjamin Bock <bb@users.noreply.github.com> | 2025-09-01 20:47:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-01 11:47:54 -0700 |
| commit | 61b144d809f8f8258cfd74a4bb3c6c8b66bac0b1 (patch) | |
| tree | 3348010058f26d96d8434e9ce8083d39ae1a4a72 | |
| parent | 9d00a004b21791557c7d5cd1070b21054125b149 (diff) | |
| download | zsh-61b144d809f8f8258cfd74a4bb3c6c8b66bac0b1.tar.gz zsh-61b144d809f8f8258cfd74a4bb3c6c8b66bac0b1.tar.bz2 zsh-61b144d809f8f8258cfd74a4bb3c6c8b66bac0b1.zip | |
feat(magic-enter plugin): Add support for jj to magic-enter plugin (#13241)
| -rw-r--r-- | plugins/magic-enter/magic-enter.plugin.zsh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/magic-enter/magic-enter.plugin.zsh b/plugins/magic-enter/magic-enter.plugin.zsh index 55b893535..c3175b70b 100644 --- a/plugins/magic-enter/magic-enter.plugin.zsh +++ b/plugins/magic-enter/magic-enter.plugin.zsh @@ -1,5 +1,6 @@ # Default commands : ${MAGIC_ENTER_GIT_COMMAND:="git status -u ."} # run when in a git repository +: ${MAGIC_ENTER_JJ_COMMAND:="jj st --no-pager ."} # run when in a jj repository : ${MAGIC_ENTER_OTHER_COMMAND:="ls -lh ."} # run anywhere else magic-enter() { @@ -9,7 +10,9 @@ magic-enter() { return fi - if command git rev-parse --is-inside-work-tree &>/dev/null; then + if command jj st &>/dev/null; then # needs to be before git to handle colocated repositories + BUFFER="$MAGIC_ENTER_JJ_COMMAND" + elif command git rev-parse --is-inside-work-tree &>/dev/null; then BUFFER="$MAGIC_ENTER_GIT_COMMAND" else BUFFER="$MAGIC_ENTER_OTHER_COMMAND" |
