From 73694897c36b48b7c03a7053237807d390b503df Mon Sep 17 00:00:00 2001 From: Ashwin Vishnu Date: Sat, 27 Jul 2019 12:17:12 +0200 Subject: [PATCH] Open EDITOR if output of autojump is a file --- bin/autojump.bash | 2 ++ bin/autojump.zsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bin/autojump.bash b/bin/autojump.bash index 379e529..abf927e 100644 --- a/bin/autojump.bash +++ b/bin/autojump.bash @@ -67,6 +67,8 @@ j() { echo -e "${output}" fi cd "${output}" + elif [[ -f "${output}" ]]; then + $EDITOR "${output}" else echo "autojump: directory '${@}' not found" echo "\n${output}\n" diff --git a/bin/autojump.zsh b/bin/autojump.zsh index a761206..beaf8e7 100644 --- a/bin/autojump.zsh +++ b/bin/autojump.zsh @@ -61,6 +61,8 @@ j() { echo -e "${output}" fi cd "${output}" + elif [[ -f "${output}" ]]; then + $EDITOR "${output}" else echo "autojump: directory '${@}' not found" echo "\n${output}\n"