From 134ee092ba3b8d00e46884a5cd422c2bc5dc33eb Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sun, 27 Jun 2021 12:36:06 +0800 Subject: update --- tools/init/load-settings.sh | 4 ++-- zsh/_cdg.zsh | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 zsh/_cdg.zsh diff --git a/tools/init/load-settings.sh b/tools/init/load-settings.sh index 9592b50..1990c1f 100755 --- a/tools/init/load-settings.sh +++ b/tools/init/load-settings.sh @@ -1,7 +1,7 @@ -if [[ $0 == 'zsh' ]]; then +if [[ $SHELL =~ zsh$ ]]; then setopt extended_glob fpath=($SETTING_DIR/zsh $fpath) -elif [[ $0 == 'bash' ]]; then +elif [[ $SHELL =~ bash$ ]]; then shopt -s extglob fi diff --git a/zsh/_cdg.zsh b/zsh/_cdg.zsh new file mode 100644 index 0000000..fe7e26b --- /dev/null +++ b/zsh/_cdg.zsh @@ -0,0 +1,7 @@ +#compdef cdg + +function _cdg() { + compadd -S '/' $(cd ~/git && ls -d ${words[2]}*) +} + +_cdg -- cgit v1.2.3-70-g09d2