Skip to content

Commit b877231

Browse files
committed
qs alias is now a function, it changes directory only when needed. Other minor cleanup.
1 parent 2874a86 commit b877231

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

source/50_editor.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
if [[ ! "$SSH_TTY" && "$OSTYPE" =~ ^darwin ]]; then
44
export EDITOR='mate -w'
55
export LESSEDIT='mate -l %lm %f'
6-
alias q="mate"
6+
alias q='mate'
77
else
8-
export EDITOR=$(type nano pico vi vim 2>/dev/null | sed "s/ .*$//;q")
8+
export EDITOR=$(type nano pico vi vim 2>/dev/null | sed 's/ .*$//;q')
99
alias q="$EDITOR -w -z"
1010
fi
1111

1212
export VISUAL="$EDITOR"
1313

14-
alias qs="cd ~/.dotfiles && q ."
14+
function qs() {
15+
pwd | perl -ne"s#^$(echo ~/.dotfiles)## && exit 1" && cd ~/.dotfiles
16+
q ~/.dotfiles
17+
}

0 commit comments

Comments
 (0)