diff --git a/custom/emacs.zsh b/custom/emacs.zsh new file mode 100644 index 000000000..a4baad2e1 --- /dev/null +++ b/custom/emacs.zsh @@ -0,0 +1,11 @@ +#!/bin/zsh + +# Emacs +function em() { + emacs $@ &>/dev/null &! +} + +# Emacs client +function emc() { + emacsclient -n $@ +} diff --git a/custom/go.zsh b/custom/go.zsh new file mode 100644 index 000000000..0fb3d6c5c --- /dev/null +++ b/custom/go.zsh @@ -0,0 +1,30 @@ +#!/bin/zsh + +function project() { + cmd="cd" + file=$1 + + if [[ "open" == "$file" ]] then + file=$2 + cmd=(${(s: :)EDITOR}) + fi + + for project in $PROJECT_PATHS; do + if [[ -d $project/$file ]] then + $cmd "$project/$file" + unset project # Unset project var + return + fi + done + + echo "No such project $1" +} + +alias p="project" +alias m="project open" + +function _project () { + compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $8 }'` +} + +compdef _project project