mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
feat(magic-enter plugin): Add support for jj to magic-enter plugin (#13241)
This commit is contained in:
parent
9d00a004b2
commit
61b144d809
1 changed files with 4 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue