Add pprint alias; redo ls setup
This commit is contained in:
parent
406026f038
commit
3126b29d73
1 changed files with 45 additions and 25 deletions
70
rc
70
rc
|
|
@ -23,30 +23,21 @@ alias today='date +%Y-%m-%d'
|
||||||
|
|
||||||
alias addkey="ssh-agent ~/.ssh/id_rsa"
|
alias addkey="ssh-agent ~/.ssh/id_rsa"
|
||||||
|
|
||||||
|
alias pprint="python -c 'import sys,pprint; pprint.pprint(eval(sys.stdin.read()))'"
|
||||||
alias pprint-json="python -c 'import sys,json;print json.dumps(json.load(sys.stdin), indent=2)'"
|
alias pprint-json="python -c 'import sys,json;print json.dumps(json.load(sys.stdin), indent=2)'"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print_info_sub_noisy 2 "Sourcing ${SYS}-specific settings"
|
print_info_sub_noisy 2 "Sourcing ${SYS}-specific settings"
|
||||||
case $SYS in
|
case $SYS in
|
||||||
darwin)
|
darwin)
|
||||||
if binary_exists gls; then
|
alias acls='command ls -le'
|
||||||
ls='gls'
|
# These things might have been installed by Homebrew
|
||||||
ls_options="--color=auto"
|
|
||||||
else
|
|
||||||
ls='ls'
|
|
||||||
ls_options='-G'
|
|
||||||
fi
|
|
||||||
alias ls="$ls $ls_options"
|
|
||||||
alias la="$ls -A $ls_options"
|
|
||||||
alias ll="$ls -l $ls_options"
|
|
||||||
binary_exists gdircolors && alias dircolors='gdircolors'
|
binary_exists gdircolors && alias dircolors='gdircolors'
|
||||||
alias indent='gnuindent'
|
binary_exists gfind && alias find='gfind'
|
||||||
alias acls='/bin/ls -le'
|
binary_exists gnuindent && alias indent='gnuindent'
|
||||||
;;
|
;;
|
||||||
linux)
|
linux)
|
||||||
alias ls="ls --color=auto"
|
|
||||||
alias la="ls -A --color=auto"
|
|
||||||
alias ll="ls -l --color=auto"
|
|
||||||
alias l.="ls -d --color=auto .*"
|
|
||||||
# iptables aliases
|
# iptables aliases
|
||||||
alias iptls='sudo iptables --line-numbers -nv -L'
|
alias iptls='sudo iptables --line-numbers -nv -L'
|
||||||
alias ip6tls='sudo ip6tables --line-numbers -nv -L'
|
alias ip6tls='sudo ip6tables --line-numbers -nv -L'
|
||||||
|
|
@ -57,18 +48,47 @@ case $SYS in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Set up dircolors
|
function {
|
||||||
print_info_sub_noisy 3 "Setting up dircolors"
|
local has_gnu_ls=1
|
||||||
if [ -e $HOME/.dircolors/$SYS.cfg ]; then
|
local ls='ls'
|
||||||
dircolors=$HOME/.dircolors/$SYS.cfg
|
local ls_options='--color=auto'
|
||||||
else
|
|
||||||
dircolors=$HOME/.dircolors/default.cfg
|
case $SYS in
|
||||||
fi
|
darwin)
|
||||||
eval `dircolors $dircolors`
|
if binary_exists gls; then
|
||||||
|
ls='gls'
|
||||||
|
else
|
||||||
|
has_gnu_ls=0
|
||||||
|
ls_options='-G'
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
linux)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
has_gnu_ls=0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
print_info_sub_noisy 3 "Setting up ls: `which $ls`"
|
||||||
|
alias ls="$ls $ls_options"
|
||||||
|
alias la="$ls -A $ls_options"
|
||||||
|
alias ll="$ls -l $ls_options"
|
||||||
|
alias l.="$ls -d $ls_options .*"
|
||||||
|
|
||||||
|
if [ $has_gnu_ls ]; then
|
||||||
|
if [ -e $HOME/.dircolors/$SYS.cfg ]; then
|
||||||
|
dircolors=$HOME/.dircolors/$SYS.cfg
|
||||||
|
else
|
||||||
|
dircolors=$HOME/.dircolors/default.cfg
|
||||||
|
fi
|
||||||
|
print_info_sub_noisy 3 "Setting up dircolors: `basename $dircolors`"
|
||||||
|
eval `dircolors $dircolors`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# NetHack options
|
# NetHack options
|
||||||
# use color in the terminal
|
# use color in the terminal
|
||||||
export NETHACKOPTIONS="color"
|
binary_exists nethack && export NETHACKOPTIONS="color"
|
||||||
|
|
||||||
# Default ledger file
|
# Default ledger file
|
||||||
[ -e "$HOME/Documents/Financial/personal.ledger" ] && \
|
[ -e "$HOME/Documents/Financial/personal.ledger" ] && \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue