From 518555f9b70892a9ed8cc0263ffc08d72c39dffe Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 5 May 2015 10:32:14 +0300 Subject: [PATCH 1/4] .tmux.conf: Use ${SHELL} to launch default shell Then it appears tmux uses the user's default shell on the system, ie the one set in /etc/passwd (or via chsh). Signed-off-by: Alan Orth --- .tmux.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index ddce02b..6a615d9 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -107,6 +107,8 @@ set-option -g history-limit 4096 # http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/FAQ set-option -g default-terminal "screen-256color" +set -g default-command "${SHELL}" + #### COLOUR (Solarized dark) # default statusbar colors From eee6929dc41a3177134f165e0aeb5788b453e49d Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 5 May 2015 10:34:10 +0300 Subject: [PATCH 2/4] .zshrc: Fix Ansible inventory variable Signed-off-by: Alan Orth --- .zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 31b5bbb..a6db7a1 100644 --- a/.zshrc +++ b/.zshrc @@ -37,7 +37,7 @@ export EDITOR=/usr/bin/vim export PAGER=/usr/bin/less # look for Ansible hosts file in current directory -export ANSIBLE_HOSTS=hosts +export ANSIBLE_INVENTORY=hosts # look for Node binaries in current directory # if we have npm, we probably want to use npm binaries From 5d13f77f1003cd6d57049540224d381e6a71194f Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 5 May 2015 11:39:45 +0300 Subject: [PATCH 3/4] .zshrc: Make more portable for cross-platform use Test Mac OS X / Linux properly, and get rid of Homebrew-isms -- I am now using pkgsrc instead. Signed-off-by: Alan Orth --- .zshrc | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/.zshrc b/.zshrc index a6db7a1..32a76d7 100644 --- a/.zshrc +++ b/.zshrc @@ -20,21 +20,44 @@ compinit # OS-specific things if [[ "$OSTYPE" =~ ^darwin.*$ ]]; then - PATH=$(brew --prefix coreutils)/libexec/gnubin:/usr/local/sbin:$PATH + # set pkgsrc paths + # see: http://pkgsrc.joyent.com/install-on-osx/ + PATH=/usr/pkg/sbin:/usr/pkg/bin:$PATH + MANPATH=/usr/pkg/man:$MANPATH - if [[ -f $(brew --prefix)/etc/bash_completion ]]; then - . $(brew --prefix)/etc/bash_completion - fi + # use pkgsrc's GNU coreutils (prefixed with 'g') + # requires at least: coreutils findutils gsed + alias du='gdu' + alias ls='gls -F --color=auto' + alias df='gdf' + alias rm='grm' + alias cp='gcp' + alias mv='gmv' + alias mkdir='gmkdir' + alias rmdir='grmdir' + alias chmod='gchmod' + alias chown='gchown' + alias ln='gln' + alias find='gfind' + alias less='gless -R' # preserves colors + alias sed='gsed' + + # solarized dircolors (needs coreutils from pkgsrc) + [[ -r ~/.dircolors.ansi-dark ]] && eval `gdircolors ~/.dircolors.ansi-dark` + +elif [[ "$OSTYPE" =~ ^linux*$ ]]; then + # aliases + alias ls='ls -F --color=auto' + alias less='less -R' # preserves colors in GNU coreutils' `less` + + # solarized dircolors + [[ -r ~/.dircolors.ansi-dark ]] && eval `dircolors ~/.dircolors.ansi-dark` fi -# Aliases -alias ls='ls -F --color=auto' -alias less='less -R' # preserves colors in GNU coreutils' `less` - # Environment export PS1='[%n@%m: %~]$ ' -export EDITOR=/usr/bin/vim -export PAGER=/usr/bin/less +export EDITOR=vim +export PAGER=less # look for Ansible hosts file in current directory export ANSIBLE_INVENTORY=hosts @@ -65,7 +88,4 @@ fi # If a private bin directory exists, add it to PATH [[ -d ~/bin ]] && PATH="$PATH:~/bin" -# solarized dircolors (needs coreutils from homebrew on Mac OS X) -[[ -r ~/.dircolors.ansi-dark ]] && eval `dircolors ~/.dircolors.ansi-dark` - export PATH From aaf0f156694f7bf9734ec55c4ce51426a0c7f268 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 5 May 2015 11:40:42 +0300 Subject: [PATCH 4/4] .zshrc: Only export variables at the end Signed-off-by: Alan Orth --- .zshrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.zshrc b/.zshrc index 32a76d7..9e750ce 100644 --- a/.zshrc +++ b/.zshrc @@ -68,14 +68,14 @@ export ANSIBLE_INVENTORY=hosts # node modules' bin to PATH command -v npm >/dev/null 2>&1 if [[ $? -eq 0 ]]; then - export PATH=$PATH:node_modules/.bin + PATH=$PATH:node_modules/.bin fi # Enable pyenv # See: https://github.com/yyuu/pyenv#basic-github-checkout if [[ -d ~/.pyenv ]]; then export PYENV_ROOT="$HOME/.pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" + PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init -)" # optionally enable pyenv-virtualenv @@ -89,3 +89,4 @@ fi [[ -d ~/bin ]] && PATH="$PATH:~/bin" export PATH +export MANPATH