diff --git a/.gitignore b/.gitignore index 51a5ee6c3..010447c73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,6 @@ locals.zsh log/.zsh_history projects.zsh -custom/* -!custom/example -!custom/example.zsh *.swp !custom/example.zshcache cache/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..3c066c2af --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vendor/beech"] + path = vendor/beech + url = git@github.com:pjaspers/beech.git 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..5f020380f --- /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 $9 }'` +} + +compdef _project project diff --git a/lib/directories.zsh b/lib/directories.zsh index 6c743e40e..b3a478d47 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -2,6 +2,7 @@ setopt auto_name_dirs setopt auto_pushd setopt pushd_ignore_dups +setopt pushdminus alias ..='cd ..' alias cd..='cd ..' @@ -11,14 +12,14 @@ alias cd.....='cd ../../../..' alias cd/='cd /' alias 1='cd -' -alias 2='cd +2' -alias 3='cd +3' -alias 4='cd +4' -alias 5='cd +5' -alias 6='cd +6' -alias 7='cd +7' -alias 8='cd +8' -alias 9='cd +9' +alias 2='cd -2' +alias 3='cd -3' +alias 4='cd -4' +alias 5='cd -5' +alias 6='cd -6' +alias 7='cd -7' +alias 8='cd -8' +alias 9='cd -9' cd () { if [[ "x$*" == "x..." ]]; then