diff options
author | Tom Willemse | 2013-04-24 02:43:56 +0200 |
---|---|---|
committer | Tom Willemse | 2013-04-24 02:43:56 +0200 |
commit | 370726e0ccc14eab5f0736fc3f07efbad64d2943 (patch) | |
tree | 581ecac3603e1017a28dce9ce090872d81abb6f0 | |
parent | d9323f0c017dddccfc0a107690736477527ea33f (diff) | |
download | dotfiles-370726e0ccc14eab5f0736fc3f07efbad64d2943.tar.gz dotfiles-370726e0ccc14eab5f0736fc3f07efbad64d2943.zip |
Move PATHS to .zshrc
And use a new function to make it clean
-rw-r--r-- | .zprofile | 12 | ||||
-rw-r--r-- | .zsh/functions/Makefile | 2 | ||||
-rw-r--r-- | .zsh/functions/add-to-list | 10 | ||||
-rw-r--r-- | .zshrc | 7 |
4 files changed, 18 insertions, 13 deletions
@@ -1,18 +1,6 @@ export BROWSER=conkeror export EDITOR="emacsclient -c -a emacs" -INFOPATH="$HOME/documents/info" -INFOPATH="$INFOPATH:/usr/local/emacs/share/info" -INFOPATH="$INFOPATH:/usr/share/info" -INFOPATH="$INFOPATH:/usr/local/clark/share/info" -export INFOPATH="$INFOPATH:/usr/local/stumpwm/share/info" - -PATH="${HOME}/usr/bin:${PATH}:/usr/local/bin:/usr/local/stumpwm/bin" -PATH="/usr/local/scwm/bin:$PATH" -PATH="/usr/local/clfswm/bin:$PATH" -PATH="/usr/local/clark/bin:$PATH" -export PATH="/usr/local/emacs/bin:$PATH" - if [ -z "$SSH_AGENT_PID" ]; then eval `ssh-agent` fi diff --git a/.zsh/functions/Makefile b/.zsh/functions/Makefile index d410977..617d883 100644 --- a/.zsh/functions/Makefile +++ b/.zsh/functions/Makefile @@ -2,6 +2,6 @@ SUBDIR=functions objects=chpwd_show_todo chpwd_update_git_vars env get_cnt line \ precmd_maybe_festival precmd_update_git_vars precmd_update_updates \ preexec_update_vars prompt prompt_git_info rprompt \ - update_current_git_vars welcome venv + update_current_git_vars welcome venv add-to-list include ../../dotfiles.mk diff --git a/.zsh/functions/add-to-list b/.zsh/functions/add-to-list new file mode 100644 index 0000000..18720e0 --- /dev/null +++ b/.zsh/functions/add-to-list @@ -0,0 +1,10 @@ +# -*- mode: sh; -*- +if [[ ! "${(P)${1}}" =~ (^|:)"$2"(:|$) ]]; then + if [ -n "$3" ]; then + # Append + typeset -g $1="${(P)${1}}:$2" + else + # Prepend + typeset -g $1="$2:${(P)${1}}" + fi +fi @@ -70,6 +70,13 @@ case $TERM in ;; esac +add-to-list PATH "$HOME/usr/bin" +add-to-list PATH "/usr/local/clark/bin" t + +add-to-list INFOPATH "$HOME/documents/info" +add-to-list INFOPATH "$HOME/.emacs.d/vendor-lisp/org/doc" +add-to-list INFOPATH "/usr/local/clark/share/info" t + # Set terminal keys bindkey "\e[1~" beginning-of-line bindkey "\e[4~" end-of-line |