refactoring

This commit is contained in:
Loic Nageleisen 2012-08-09 15:37:56 +02:00
parent 53b18ca0db
commit f699a87614
24 changed files with 67 additions and 57 deletions

View file

@ -1,8 +1,7 @@
## bash_profile
# handle .profile too
. .profile
. ~/.profile
# homebrew bash autocompletion
if [ -f `brew --prefix`/etc/bash_completion ]; then

View file

@ -1,7 +1,7 @@
## bashrc
# set a nice prompt
source ~/.bash_prompt
source ~/.dotfiles/bash/prompt
# ignore repeated, space-started, and casual commands
export HISTIGNORE="&:[ ]*:l[sl]:[bf]g:exit"
@ -15,5 +15,5 @@ shopt -s cdspell
# turn off bells
set bell-style none
source ~/.aliases
#source ~/.aliases

View file

1
home/bash_profile Symbolic link
View file

@ -0,0 +1 @@
../bash/profile

1
home/bashrc Symbolic link
View file

@ -0,0 +1 @@
../bash/rc

19
home/profile Normal file
View file

@ -0,0 +1,19 @@
## .profile
# utility functions
path_append () {
PATH="$PATH:$1"
}
path_prepend () {
PATH="$1:$PATH"
}
# load all shell files
for file in ~/.dotfiles/shell/*; do
. $file
done
export PATH
# vim: ft=sh

1
home/zprofile Symbolic link
View file

@ -0,0 +1 @@
../zsh/profile

1
home/zshrc Symbolic link
View file

@ -0,0 +1 @@
../zsh/rc

49
profile
View file

@ -1,49 +0,0 @@
## .profile
# set locale
#export LC_ALL="en_US.UTF-8"
# mono paths
#export MANPATH=/Library/Frameworks/Mono.framework/Versions/Current/share/man:$MANPATH
#export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig:$PKG_CONFIG_PATH
# user path
PATH=~/.local/bin:$PATH
# python user path
PATH=~/Library/Python/2.7/bin:$PATH
# local path
PATH=/usr/local/bin:/usr/local/sbin:$PATH
# node.js path
NODE_PATH=/usr/local/lib/node
export NODE_PATH
# rbenv
test -d "$HOME/.rbenv/bin" && PATH="$HOME/.rbenv/bin:$PATH"
which rbenv 2>&1 >/dev/null && eval "$(rbenv init -)"
# homebrew python
test -d /usr/local/share/python3 && PATH="/usr/local/share/python3:$PATH"
test -d /usr/local/share/python && PATH="/usr/local/share/python:$PATH"
export PATH
# default editor
EDITOR=vim
VISUAL=vim
export EDITOR VISUAL
# add some color
GREP_OPTIONS='--color=auto'
CLICOLOR=1;
export GREP_OPTIONS CLICOLOR
# ssh keychain, if no agent set
if [ -z "$SSH_AUTH_SOCK" ]; then
if which keychain 2>&1 >/dev/null; then
eval $(keychain --eval --agents ssh -Q --quiet id_rsa)
fi
fi

View file

@ -1,6 +1,7 @@
#!/bin/sh
for dotfile in *; do
for file in home/*; do
dotfile="$(basename "$file")"
case "${dotfile}" in
Makefile|*.md|LICENSE|setup.sh)
# NOOP
@ -8,7 +9,7 @@ for dotfile in *; do
*)
# link the file with a leading dot
echo "linking ${dotfile}"
ln -sf "$(pwd)/${dotfile}" "$HOME/.${dotfile}"
ln -sf "$(pwd)/${file}" "$HOME/.${dotfile}"
;;
esac
done

View file

@ -10,4 +10,5 @@ case "$(uname)" in
esac
alias ll="ls -l"
alias tree="tree -C"

4
shell/colors Normal file
View file

@ -0,0 +1,4 @@
# add some color
GREP_OPTIONS='--color=auto'
CLICOLOR=1;
export GREP_OPTIONS CLICOLOR

5
shell/editor Normal file
View file

@ -0,0 +1,5 @@
# default editor
EDITOR=vim
VISUAL=vim
export EDITOR VISUAL

12
shell/homebrew Normal file
View file

@ -0,0 +1,12 @@
# local path
PATH=/usr/local/bin:/usr/local/sbin:$PATH
# node.js path
NODE_PATH=/usr/local/lib/node
export NODE_PATH
# python
test -d /usr/local/share/python3 && PATH="/usr/local/share/python3:$PATH"
test -d /usr/local/share/python && PATH="/usr/local/share/python:$PATH"
export PATH

3
shell/osx Normal file
View file

@ -0,0 +1,3 @@
# OS X python user path
PATH=~/Library/Python/2.7/bin:$PATH
export PATH

4
shell/rbenv Normal file
View file

@ -0,0 +1,4 @@
# rbenv
test -d "$HOME/.rbenv/bin" && PATH="$HOME/.rbenv/bin:$PATH"
which rbenv 2>&1 >/dev/null && eval "$(rbenv init -)"
export PATH

6
shell/ssh Normal file
View file

@ -0,0 +1,6 @@
# ssh keychain, if no agent set
if [ -z "$SSH_AUTH_SOCK" ]; then
if which keychain 2>&1 >/dev/null; then
eval $(keychain --eval --agents ssh -Q --quiet id_rsa)
fi
fi

3
shell/user Normal file
View file

@ -0,0 +1,3 @@
# user path
PATH=~/.local/bin:$PATH
export PATH

View file

@ -139,5 +139,3 @@ chpwd() {
set_term_title
}
source ~/.aliases