mirror of
https://github.com/NaomiAmethyst/dots.git
synced 2025-08-31 22:08:34 +00:00
Merge branch 'master' of gitosis@majnematic.com:davesdots
Conflicts: bashrc commonsh/02_term commonsh/10_alias commonsh/10_rlwrap
This commit is contained in:
commit
2f7f5c16ef
27 changed files with 340 additions and 85 deletions
|
@ -1,3 +1,3 @@
|
||||||
for file in /etc/bash_completion /opt/local/etc/bash_completion ; do
|
for file in /etc/bash_completion /opt/local/etc/bash_completion ; do
|
||||||
[ -f ${file} ] && source $file && break
|
[ -f ${file} ] && . $file && break
|
||||||
done
|
done
|
||||||
|
|
2
bash/git
2
bash/git
|
@ -1,3 +1,3 @@
|
||||||
if [ -x /usr/local/git/contrib/completion/git-completion.bash ]; then
|
if [ -x /usr/local/git/contrib/completion/git-completion.bash ]; then
|
||||||
source /usr/local/git/contrib/completion/git-completion.bash
|
. /usr/local/git/contrib/completion/git-completion.bash
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -12,12 +12,12 @@ function do_prompt ()
|
||||||
fi
|
fi
|
||||||
export PS1="\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]"
|
export PS1="\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]"
|
||||||
|
|
||||||
[[ $TERM != "cons*" ]] && [[ $TERM != "linux" ]] &&
|
[[ $TERM != cons* ]] && [ $TERM != linux ] &&
|
||||||
echo -ne "\033]0;${USER}@${HOSTNAME}\007"
|
echo -ne "\033]0;${USER}@${HOSTNAME}\007"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PROMPT_COMMAND=do_prompt
|
PROMPT_COMMAND=do_prompt
|
||||||
|
|
||||||
[[ $TERM != "cons*" ]] && [[ $TERM != "linux" ]] &&
|
[[ $TERM != cons* ]] && [ $TERM != linux ] &&
|
||||||
trap 'echo -e "\e]1;${USER}@${HOSTNAME}: $BASH_COMMAND\007\c"' DEBUG
|
trap 'echo -e "\e]1;${USER}@${HOSTNAME}: $BASH_COMMAND\007\c"' DEBUG
|
||||||
|
|
8
bashrc
8
bashrc
|
@ -3,14 +3,14 @@
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[ -z "$PS1" ] && return
|
[ -z "$PS1" ] && return
|
||||||
|
|
||||||
if [[ -d "${HOME}/.commonsh" ]] ; then
|
if [ -d "${HOME}/.commonsh" ] ; then
|
||||||
for file in "${HOME}"/.commonsh/* ; do
|
for file in "${HOME}"/.commonsh/* ; do
|
||||||
source $file
|
. $file
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "${HOME}/.bash" ]] ; then
|
if [ -d "${HOME}/.bash" ] ; then
|
||||||
for file in "${HOME}"/.bash/* ; do
|
for file in "${HOME}"/.bash/* ; do
|
||||||
source $file
|
. $file
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,25 +1,27 @@
|
||||||
if [[ -d /opt/local/man ]] ; then
|
#! /bin/sh
|
||||||
if [[ -z "${MANPATH}" ]] ; then
|
|
||||||
MANPATH="/opt/local/man":$(manpath)
|
if [ -d /opt/local/man ] ; then
|
||||||
|
if [ -z "${MANPATH}" ] ; then
|
||||||
|
MANPATH="/opt/local/man":`manpath`
|
||||||
else
|
else
|
||||||
MANPATH="/opt/local/man:${MANPATH}"
|
MANPATH="/opt/local/man:${MANPATH}"
|
||||||
fi
|
fi
|
||||||
export MANPATH
|
export MANPATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d /opt/local/bin ]] ; then
|
if [ -d /opt/local/bin ] ; then
|
||||||
if [[ -z "${PATH}" ]] ; then
|
if [ -z "${PATH}" ] ; then
|
||||||
PATH="/opt/local/bin"
|
PATH="/opt/local/bin"
|
||||||
else
|
else
|
||||||
PATH="/opt/local/bin:${PATH}"
|
PATH="/opt/local/bin:${PATH}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d /opt/local/sbin ]] ; then
|
if [ -d /opt/local/sbin ] ; then
|
||||||
PATH="/opt/local/sbin:${PATH}"
|
PATH="/opt/local/sbin:${PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d /opt/local/libexec ]] ; then
|
if [ -d /opt/local/libexec ] ; then
|
||||||
PATH="/opt/local/libexec:${PATH}"
|
PATH="/opt/local/libexec:${PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
# terminal fallback stuff
|
# terminal fallback stuff
|
||||||
function fix_term ()
|
fix_term ()
|
||||||
{
|
{
|
||||||
if (infocmp $1 &> /dev/null) ; then
|
if (infocmp $1 > /dev/null 2>&1) ; then
|
||||||
echo $1
|
echo $1
|
||||||
else
|
else
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -38,12 +40,14 @@ function fix_term ()
|
||||||
}
|
}
|
||||||
|
|
||||||
# sorta hacky, but I cannot find a better way to do this :/
|
# sorta hacky, but I cannot find a better way to do this :/
|
||||||
function fix_terminfo_db ()
|
fix_terminfo_db ()
|
||||||
{
|
{
|
||||||
if [[ `type -p infocmp` = "$1/bin/infocmp" ]] ; then
|
if [ `command -v infocmp 2>/dev/null` = "$1/bin/infocmp" ] ; then
|
||||||
export TERMINFO="$1/share/terminfo"
|
TERMINFO="$1/share/terminfo"
|
||||||
|
export TERMINFO
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# terminal surgery
|
# terminal surgery
|
||||||
case `uname -s` in
|
case `uname -s` in
|
||||||
Interix)
|
Interix)
|
||||||
|
@ -52,12 +56,25 @@ case `uname -s` in
|
||||||
SunOS)
|
SunOS)
|
||||||
fix_terminfo_db "/opt/csw"
|
fix_terminfo_db "/opt/csw"
|
||||||
;;
|
;;
|
||||||
|
Darwin)
|
||||||
|
fix_terminfo_db "/opt/local"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export TERM=$(fix_term $TERM)
|
TERM=`fix_term $TERM`
|
||||||
|
|
||||||
if [[ $TERM == *256* ]] ; then
|
# I am sorry to hear that you are running an
|
||||||
SCREEN_TERM=$(fix_term screen-256color-bce)
|
# xterm that has no colors (I am looking at you solaris)
|
||||||
alias screen="screen -T ${SCREEN_TERM}"
|
if [ $TERM = xterm ] && (type -p tput > /dev/null 2>&1) && [ `tput -T xterm colors` = -1 ] ; then
|
||||||
|
# lets see what we can do about your terrible term
|
||||||
|
TERM=`fix_term xterm-color`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export TERM
|
||||||
|
|
||||||
|
case $TERM in
|
||||||
|
*256*)
|
||||||
|
SCREEN_TERM=$(fix_term screen-256color-bce)
|
||||||
|
alias screen="screen -T ${SCREEN_TERM}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -1,18 +1,23 @@
|
||||||
|
#! /bin/sh
|
||||||
# colors
|
# colors
|
||||||
for dircolors in gdircolors dircolors ; do
|
for dircolors in gdircolors dircolors ; do
|
||||||
if (type -p $dircolors &> /dev/null) ; then
|
if (command -v $dircolors > /dev/null 2>&1) ; then
|
||||||
[ -f /etc/DIR_COLORS ] && eval $($dircolors -b /etc/DIR_COLORS) && break
|
[ -f "${HOME}/.dir_colors" ] && eval `$dircolors -b "${HOME}/.dir_colors"` && break
|
||||||
[ -f "${HOME}/.dir_colors" ] && eval $($dircolors -b "${HOME}/.dir_colors") && break
|
[ -f /etc/DIR_COLORS ] && eval `$dircolors -b /etc/DIR_COLORS` && break
|
||||||
eval $($dircolors -b) && break
|
eval `$dircolors -b` && break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# gimmie an editor, make it a nice vi clone
|
# gimmie an editor, make it a nice vi clone
|
||||||
for EDITOR in vim elvis vile nvi vi ; do
|
for EDITOR in vim elvis vile nvi vi ; do
|
||||||
(type -p $EDITOR &> /dev/null) && break
|
(command -v $EDITOR > /dev/null 2>&1) && break
|
||||||
done
|
done
|
||||||
export EDITOR
|
export EDITOR
|
||||||
|
|
||||||
|
# make the history editor the editor we want
|
||||||
|
FCEDIT=$EDITOR
|
||||||
|
export $FCEDIT
|
||||||
|
|
||||||
# aliases
|
# aliases
|
||||||
alias cd..='cd ..'
|
alias cd..='cd ..'
|
||||||
|
|
||||||
|
@ -23,7 +28,8 @@ case `uname -s` in
|
||||||
alias grep='grep -d skip --color=auto'
|
alias grep='grep -d skip --color=auto'
|
||||||
;;
|
;;
|
||||||
FreeBSD|Darwin|DragonFly)
|
FreeBSD|Darwin|DragonFly)
|
||||||
export LSCOLORS=ExGxFxDxCxDxDxHbaDacec
|
LSCOLORS=ExGxFxDxCxDxDxHbaDacec
|
||||||
|
export LSCOLORS
|
||||||
alias ls="ls -Gh"
|
alias ls="ls -Gh"
|
||||||
alias grep='grep -d skip --color=auto'
|
alias grep='grep -d skip --color=auto'
|
||||||
;;
|
;;
|
||||||
|
@ -31,7 +37,7 @@ case `uname -s` in
|
||||||
alias ls="ls --color"
|
alias ls="ls --color"
|
||||||
;;
|
;;
|
||||||
SunOS)
|
SunOS)
|
||||||
if (type -p gls &> /dev/null) ; then
|
if (command -v gls > /dev/null 2>&1) ; then
|
||||||
alias ls="gls -h --color=auto"
|
alias ls="gls -h --color=auto"
|
||||||
else
|
else
|
||||||
# you have a GNU ls, surprise...
|
# you have a GNU ls, surprise...
|
||||||
|
@ -45,7 +51,7 @@ case `uname -s` in
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (type -p ggrep &> /dev/null) ; then
|
if (command -v ggrep > /dev/null 2>&1) ; then
|
||||||
alias grep='ggrep -d skip --color=auto'
|
alias grep='ggrep -d skip --color=auto'
|
||||||
else
|
else
|
||||||
# woah, you have a GNU grep...
|
# woah, you have a GNU grep...
|
||||||
|
@ -57,7 +63,7 @@ case `uname -s` in
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for locate in glocate slocate ; do
|
for locate in glocate slocate ; do
|
||||||
(type -p $locate &> /dev/null) && alias locate=$locate && break
|
(command -v $locate > /dev/null 2>&1) && alias locate=$locate
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -67,4 +73,4 @@ alias du='du -h'
|
||||||
|
|
||||||
alias ping='ping -c4'
|
alias ping='ping -c4'
|
||||||
|
|
||||||
(type -p time &> /dev/null) && alias time='command time'
|
(command -v time > /dev/null 2>&1) && alias time='command time'
|
||||||
|
|
|
@ -1,21 +1,23 @@
|
||||||
if [[ -d /usr/local/git/man ]] ; then
|
#! /bin/sh
|
||||||
if [[ -z "${MANPATH}" ]] ; then
|
|
||||||
MANPATH="/usr/local/git/man":$(manpath)
|
if [ -d /usr/local/git/man ] ; then
|
||||||
|
if [ -z "${MANPATH}" ] ; then
|
||||||
|
MANPATH="/usr/local/git/man":`manpath`
|
||||||
else
|
else
|
||||||
MANPATH="/usr/local/git/man:${MANPATH}"
|
MANPATH="/usr/local/git/man:${MANPATH}"
|
||||||
fi
|
fi
|
||||||
export MANPATH
|
export MANPATH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d /usr/local/git/bin ]] ; then
|
if [ -d /usr/local/git/bin ] ; then
|
||||||
if [[ -z "${PATH}" ]] ; then
|
if [ -z "${PATH}" ] ; then
|
||||||
PATH="/usr/local/git/bin"
|
PATH="/usr/local/git/bin"
|
||||||
else
|
else
|
||||||
PATH="/usr/local/git/bin:${PATH}"
|
PATH="/usr/local/git/bin:${PATH}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d /usr/local/git/libexec/git-core ]] ; then
|
if [ -d /usr/local/git/libexec/git-core ] ; then
|
||||||
PATH="/usr/local/git/libexec/git-core:${PATH}"
|
PATH="/usr/local/git/libexec/git-core:${PATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,23 @@
|
||||||
for PAGER in less more pg ; do
|
for PAGER in less more pg ; do
|
||||||
(type -p $PAGER &> /dev/null) && break
|
(command -v $PAGER > /dev/null 2>&1) && break
|
||||||
done
|
done
|
||||||
export PAGER
|
export PAGER
|
||||||
|
|
||||||
# if we are in less, we can set some options and use lesspipe
|
# if we are in less, we can set some options and use lesspipe
|
||||||
if [[ $PAGER = "less" ]] ; then
|
if [ $PAGER = less ] ; then
|
||||||
# lesspipe can go by either lesspipe or lesspipe.sh
|
|
||||||
for lesspipe in lesspipe lesspipe.sh ; do
|
for lesspipe in lesspipe lesspipe.sh ; do
|
||||||
if (type -p $lesspipe &> /dev/null) ; then
|
lesspipe_test=`command -v ${lesspipe} 2>/dev/null`
|
||||||
eval $(SHELL=/bin/sh $lesspipe) && break
|
if [ -n $lesspipe_test ] ; then
|
||||||
|
LESSOPEN="| ${lesspipe_test} %s" && break
|
||||||
|
export LESSOPEN
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ $lesspipe = lesspipe ] ; then
|
||||||
|
LESSCLOSE="${lesspipe_test} %s %s"
|
||||||
|
export LESSCLOSE
|
||||||
|
fi
|
||||||
|
|
||||||
# let less be case insensitive
|
# let less be case insensitive
|
||||||
export LESS='-i -R -M'
|
LESS='-R -M'
|
||||||
|
export LESS
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#! /bin/sh
|
||||||
for wrap in rlwrap rlfe cle ; do
|
for wrap in rlwrap rlfe cle ; do
|
||||||
(type -p $wrap > /dev/null 2>&1) && alias ocaml="$wrap ocaml" && break
|
(command -v $wrap > /dev/null 2>&1) && alias ocaml="$wrap ocaml" && break
|
||||||
done
|
done
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
|
#! /bin/sh
|
||||||
# utility.sh
|
# utility.sh
|
||||||
# Miscellaneous Utility Functions
|
# Miscellaneous Utility Functions
|
||||||
|
|
||||||
function unkey-host ()
|
unkey_host ()
|
||||||
{
|
{
|
||||||
[ ${#} -ne 1 ] && return 1
|
[ ${#} -ne 1 ] && return 1
|
||||||
sed -i -e "/$1/d" $HOME/.ssh/known_hosts
|
sed -i -e "/$1/d" $HOME/.ssh/known_hosts
|
||||||
}
|
}
|
||||||
|
|
||||||
function mkcd ()
|
mkcd ()
|
||||||
{
|
{
|
||||||
if [[ -d "$1" ]] ; then
|
if [ -d "$1" ] ; then
|
||||||
cd "$1"
|
cd "$1"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
@ -17,16 +18,14 @@ function mkcd ()
|
||||||
mkdir -p "$1" && cd "$1"
|
mkdir -p "$1" && cd "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function extract ()
|
extract ()
|
||||||
{
|
{
|
||||||
if [[ ! -f "$1" ]] ; then
|
if [ ! -f "$1" ] ; then
|
||||||
echo "The file ("$1") does not exist!"
|
echo "The file ("$1") does not exist!"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local filename
|
filename=`echo "$1" | tr '[:upper:]' '[:lower:]'`
|
||||||
|
|
||||||
filename=$(echo "$1" | tr '[:upper:]' '[:lower:]')
|
|
||||||
|
|
||||||
case "$filename" in
|
case "$filename" in
|
||||||
*.tar)
|
*.tar)
|
||||||
|
@ -42,10 +41,10 @@ function extract ()
|
||||||
unzip -qo "${1}"
|
unzip -qo "${1}"
|
||||||
;;
|
;;
|
||||||
*.gz|*.z)
|
*.gz|*.z)
|
||||||
gzip -dc "${1}" > $(basename "${1%.*}")
|
gzip -dc "${1}" > `basename "${1%.*}"`
|
||||||
;;
|
;;
|
||||||
*.bz2)
|
*.bz2)
|
||||||
bzip2 -dc "${1}" > $(basename "${1%.*}")
|
bzip2 -dc "${1}" > `basename "${1%.*}"`
|
||||||
;;
|
;;
|
||||||
*.rar)
|
*.rar)
|
||||||
unrar x -idq "${1}"
|
unrar x -idq "${1}"
|
||||||
|
@ -60,7 +59,7 @@ function extract ()
|
||||||
lzma -dc "${1}" | tar xf
|
lzma -dc "${1}" | tar xf
|
||||||
;;
|
;;
|
||||||
*.lzma)
|
*.lzma)
|
||||||
lzma -dc "${1}" > $(basename "${1%.*}")
|
lzma -dc "${1}" > `basename "${1%.*}"`
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unable to extract '"$1"'"
|
echo "Unable to extract '"$1"'"
|
||||||
|
|
170
dir_colors
Normal file
170
dir_colors
Normal file
|
@ -0,0 +1,170 @@
|
||||||
|
# Configuration file for dircolors, a utility to help you set the
|
||||||
|
# LS_COLORS environment variable used by GNU ls with the --color option.
|
||||||
|
# Copyright (C) 1996, 1999-2008
|
||||||
|
# Free Software Foundation, Inc.
|
||||||
|
# Copying and distribution of this file, with or without modification,
|
||||||
|
# are permitted provided the copyright notice and this notice are preserved.
|
||||||
|
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
|
||||||
|
# slackware version of dircolors) are recognized but ignored.
|
||||||
|
# Below, there should be one TERM entry for each termtype that is colorizable
|
||||||
|
TERM Eterm
|
||||||
|
TERM ansi
|
||||||
|
TERM color-xterm
|
||||||
|
TERM con132x25
|
||||||
|
TERM con132x30
|
||||||
|
TERM con132x43
|
||||||
|
TERM con132x60
|
||||||
|
TERM con80x25
|
||||||
|
TERM con80x28
|
||||||
|
TERM con80x30
|
||||||
|
TERM con80x43
|
||||||
|
TERM con80x50
|
||||||
|
TERM con80x60
|
||||||
|
TERM cons25
|
||||||
|
TERM console
|
||||||
|
TERM cygwin
|
||||||
|
TERM dtterm
|
||||||
|
TERM eterm-color
|
||||||
|
TERM gnome
|
||||||
|
TERM gnome-256color
|
||||||
|
TERM konsole
|
||||||
|
TERM kterm
|
||||||
|
TERM linux
|
||||||
|
TERM linux-c
|
||||||
|
TERM mach-color
|
||||||
|
TERM mlterm
|
||||||
|
TERM putty
|
||||||
|
TERM rxvt
|
||||||
|
TERM rxvt-cygwin
|
||||||
|
TERM rxvt-cygwin-native
|
||||||
|
TERM rxvt-unicode
|
||||||
|
TERM screen
|
||||||
|
TERM screen-256color
|
||||||
|
TERM screen-bce
|
||||||
|
TERM screen-w
|
||||||
|
TERM screen.linux
|
||||||
|
TERM vt100
|
||||||
|
TERM xterm
|
||||||
|
TERM xterm-16color
|
||||||
|
TERM xterm-256color
|
||||||
|
TERM xterm-88color
|
||||||
|
TERM xterm-color
|
||||||
|
TERM xterm-debian
|
||||||
|
# Below are the color init strings for the basic file types. A color init
|
||||||
|
# string consists of one or more of the following numeric codes:
|
||||||
|
# Attribute codes:
|
||||||
|
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
|
||||||
|
# Text color codes:
|
||||||
|
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
|
||||||
|
# Background color codes:
|
||||||
|
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
|
||||||
|
NORMAL 00 # global default, although everything should be something.
|
||||||
|
FILE 00 # normal file
|
||||||
|
DIR 01;34 # directory
|
||||||
|
LINK 01;36 # symbolic link. (If you set this to 'target' instead of a
|
||||||
|
# numerical value, the color is as for the file pointed to.)
|
||||||
|
FIFO 40;33 # pipe
|
||||||
|
SOCK 01;35 # socket
|
||||||
|
DOOR 01;35 # door
|
||||||
|
BLK 40;33;01 # block device driver
|
||||||
|
CHR 40;33;01 # character device driver
|
||||||
|
ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file
|
||||||
|
# SETUID 37;41 # file that is setuid (u+s)
|
||||||
|
# SETGID 30;43 # file that is setgid (g+s)
|
||||||
|
# STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
|
||||||
|
# OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky
|
||||||
|
# STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
|
||||||
|
# This is for files with execute permission:
|
||||||
|
EXEC 01;32
|
||||||
|
# List any file extensions like '.gz' or '.tar' that you would like ls
|
||||||
|
# to colorize below. Put the extension, a space, and the color init string.
|
||||||
|
# (and any comments you want to add after a '#')
|
||||||
|
# If you use DOS-style suffixes, you may want to uncomment the following:
|
||||||
|
.cmd 01;32 # executables (bright green)
|
||||||
|
.exe 01;32
|
||||||
|
.com 01;32
|
||||||
|
.btm 01;32
|
||||||
|
.bat 01;32
|
||||||
|
# Or if you want to colorize scripts even if they do not have the
|
||||||
|
# executable bit actually set.
|
||||||
|
#.sh 01;32
|
||||||
|
#.csh 01;32
|
||||||
|
# archives or compressed (bright red)
|
||||||
|
.tar 01;31
|
||||||
|
.tgz 01;31
|
||||||
|
.svgz 01;31
|
||||||
|
.arj 01;31
|
||||||
|
.taz 01;31
|
||||||
|
.lzh 01;31
|
||||||
|
.lzma 01;31
|
||||||
|
.zip 01;31
|
||||||
|
.z 01;31
|
||||||
|
.Z 01;31
|
||||||
|
.dz 01;31
|
||||||
|
.gz 01;31
|
||||||
|
.bz2 01;31
|
||||||
|
.bz 01;31
|
||||||
|
.tbz2 01;31
|
||||||
|
.tz 01;31
|
||||||
|
.deb 01;31
|
||||||
|
.rpm 01;31
|
||||||
|
.jar 01;31
|
||||||
|
.rar 01;31
|
||||||
|
.ace 01;31
|
||||||
|
.zoo 01;31
|
||||||
|
.cpio 01;31
|
||||||
|
.7z 01;31
|
||||||
|
.rz 01;31
|
||||||
|
# image formats
|
||||||
|
.jpg 01;35
|
||||||
|
.jpeg 01;35
|
||||||
|
.gif 01;35
|
||||||
|
.bmp 01;35
|
||||||
|
.pbm 01;35
|
||||||
|
.pgm 01;35
|
||||||
|
.ppm 01;35
|
||||||
|
.tga 01;35
|
||||||
|
.xbm 01;35
|
||||||
|
.xpm 01;35
|
||||||
|
.tif 01;35
|
||||||
|
.tiff 01;35
|
||||||
|
.png 01;35
|
||||||
|
.svg 01;35
|
||||||
|
.mng 01;35
|
||||||
|
.pcx 01;35
|
||||||
|
.mov 01;35
|
||||||
|
.mpg 01;35
|
||||||
|
.mpeg 01;35
|
||||||
|
.m2v 01;35
|
||||||
|
.mkv 01;35
|
||||||
|
.ogm 01;35
|
||||||
|
.mp4 01;35
|
||||||
|
.m4v 01;35
|
||||||
|
.mp4v 01;35
|
||||||
|
.vob 01;35
|
||||||
|
.qt 01;35
|
||||||
|
.nuv 01;35
|
||||||
|
.wmv 01;35
|
||||||
|
.asf 01;35
|
||||||
|
.rm 01;35
|
||||||
|
.rmvb 01;35
|
||||||
|
.flc 01;35
|
||||||
|
.avi 01;35
|
||||||
|
.fli 01;35
|
||||||
|
.gl 01;35
|
||||||
|
.dl 01;35
|
||||||
|
.xcf 01;35
|
||||||
|
.xwd 01;35
|
||||||
|
.yuv 01;35
|
||||||
|
# audio formats
|
||||||
|
.aac 00;36
|
||||||
|
.au 00;36
|
||||||
|
.flac 00;36
|
||||||
|
.mid 00;36
|
||||||
|
.midi 00;36
|
||||||
|
.mka 00;36
|
||||||
|
.mp3 00;36
|
||||||
|
.mpc 00;36
|
||||||
|
.ogg 00;36
|
||||||
|
.ra 00;36
|
||||||
|
.wav 00;36
|
|
@ -39,6 +39,7 @@ unless(eval {symlink('', ''); 1;}) {
|
||||||
my %links = (
|
my %links = (
|
||||||
screenrc => '.screenrc',
|
screenrc => '.screenrc',
|
||||||
toprc => '.toprc',
|
toprc => '.toprc',
|
||||||
|
dir_colors => '.dir_colors',
|
||||||
lessfilter => '.lessfilter',
|
lessfilter => '.lessfilter',
|
||||||
|
|
||||||
vim => '.vim',
|
vim => '.vim',
|
||||||
|
@ -56,6 +57,13 @@ my %links = (
|
||||||
zsh => '.zsh',
|
zsh => '.zsh',
|
||||||
zshrc => '.zshrc',
|
zshrc => '.zshrc',
|
||||||
|
|
||||||
|
ksh => '.ksh',
|
||||||
|
kshrc => '.kshrc',
|
||||||
|
mkshrc => '.mkshrc',
|
||||||
|
|
||||||
|
sh => '.sh',
|
||||||
|
shinit => '.shinit',
|
||||||
|
|
||||||
Xdefaults => '.Xdefaults',
|
Xdefaults => '.Xdefaults',
|
||||||
Xresources => '.Xresources',
|
Xresources => '.Xresources',
|
||||||
|
|
||||||
|
|
4
ksh/options
Executable file
4
ksh/options
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
set -o emacs
|
||||||
|
|
||||||
|
HISTSIZE=1000
|
||||||
|
export HISTSIZE
|
9
ksh/prompt
Executable file
9
ksh/prompt
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
if [ $USER = root ] ; then
|
||||||
|
BASE="#"
|
||||||
|
else
|
||||||
|
BASE="$"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
PS1=$'\E[01;32m'"${USER} "$'\E[01;34m''$PWD'" ${BASE} "$'\E[0m'
|
||||||
|
export PS1
|
11
kshrc
Normal file
11
kshrc
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
if [ -d "${HOME}/.commonsh" ] ; then
|
||||||
|
for file in "${HOME}"/.commonsh/* ; do
|
||||||
|
. $file
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "${HOME}/.ksh" ] ; then
|
||||||
|
for file in "${HOME}"/.ksh/* ; do
|
||||||
|
. $file
|
||||||
|
done
|
||||||
|
fi
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#! /bin/sh
|
||||||
# Decode file for less
|
# Decode file for less
|
||||||
case `echo "$1" | tr '[:upper:]' '[:lower:]'` in
|
case `echo "$1" | tr '[:upper:]' '[:lower:]'` in
|
||||||
# we don't handle archives, we let the big guy do it
|
# we don't handle archives, we let the big guy do it
|
||||||
|
|
1
mkshrc
Symbolic link
1
mkshrc
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
shinit
|
8
sh/title
Normal file
8
sh/title
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
if [ $USER = root ] ; then
|
||||||
|
BASE="#"
|
||||||
|
else
|
||||||
|
BASE="$"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PS1="${USER} ${BASE} "
|
||||||
|
export PS1
|
11
shinit
Normal file
11
shinit
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
if [ -d "${HOME}/.commonsh" ] ; then
|
||||||
|
for file in "${HOME}"/.commonsh/* ; do
|
||||||
|
. $file
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "${HOME}/.sh" ] ; then
|
||||||
|
for file in "${HOME}"/.sh/* ; do
|
||||||
|
. $file
|
||||||
|
done
|
||||||
|
fi
|
19
xmonad.hs
19
xmonad.hs
|
@ -1,8 +1,7 @@
|
||||||
import XMonad
|
import XMonad
|
||||||
|
|
||||||
import XMonad.Layout
|
|
||||||
import XMonad.Layout.Grid
|
import XMonad.Layout.Grid
|
||||||
import XMonad.Layout.NoBorders
|
import XMonad.Layout.NoBorders(smartBorders)
|
||||||
|
|
||||||
import XMonad.Hooks.DynamicLog
|
import XMonad.Hooks.DynamicLog
|
||||||
import XMonad.Hooks.ManageDocks
|
import XMonad.Hooks.ManageDocks
|
||||||
|
@ -11,10 +10,9 @@ import XMonad.Util.Run(spawnPipe)
|
||||||
import XMonad.Util.EZConfig(additionalKeys)
|
import XMonad.Util.EZConfig(additionalKeys)
|
||||||
|
|
||||||
import XMonad.Prompt
|
import XMonad.Prompt
|
||||||
import XMonad.Prompt.Shell
|
import XMonad.Prompt.Shell(shellPrompt)
|
||||||
import XMonad.Prompt.Ssh
|
|
||||||
|
|
||||||
import System.IO
|
import System.IO(hPutStrLn)
|
||||||
|
|
||||||
myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| Full
|
myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| Full
|
||||||
where
|
where
|
||||||
|
@ -30,6 +28,8 @@ myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| Full
|
||||||
-- Percent of screen to increment by when resizing panes
|
-- Percent of screen to increment by when resizing panes
|
||||||
delta = 3/100
|
delta = 3/100
|
||||||
|
|
||||||
|
myModMask = mod1Mask
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
xmproc <- spawnPipe "xmobar"
|
xmproc <- spawnPipe "xmobar"
|
||||||
xmonad $ defaultConfig {
|
xmonad $ defaultConfig {
|
||||||
|
@ -38,9 +38,10 @@ main = do
|
||||||
logHook = dynamicLogWithPP $ xmobarPP {
|
logHook = dynamicLogWithPP $ xmobarPP {
|
||||||
ppOutput = hPutStrLn xmproc,
|
ppOutput = hPutStrLn xmproc,
|
||||||
ppTitle = xmobarColor "green" ""
|
ppTitle = xmobarColor "green" ""
|
||||||
}
|
},
|
||||||
} `additionalKeys`
|
modMask = myModMask
|
||||||
|
} `additionalKeys`
|
||||||
[
|
[
|
||||||
((mod1Mask, xK_o), shellPrompt defaultXPConfig { position = Top }),
|
((myModMask, xK_o), shellPrompt defaultXPConfig { position = Top }),
|
||||||
((mod1Mask, xK_b), sendMessage ToggleStruts)
|
((myModMask, xK_b), sendMessage ToggleStruts)
|
||||||
]
|
]
|
||||||
|
|
|
@ -44,7 +44,7 @@ case `uname -s` in
|
||||||
zstyle ':completion:*:processes-names' command 'ps -e -o args | awk "NR != 1"'
|
zstyle ':completion:*:processes-names' command 'ps -e -o args | awk "NR != 1"'
|
||||||
;;
|
;;
|
||||||
Darwin)
|
Darwin)
|
||||||
if [[ $(sw_vers -productVersion) > 10.4 ]] ; then
|
if [[ `sw_vers -productVersion` = 10<5->.<-> ]] ; then
|
||||||
zstyle ':completion:*:processes-names' command 'ps -e -o command | awk "NR != 1"'
|
zstyle ':completion:*:processes-names' command 'ps -e -o command | awk "NR != 1"'
|
||||||
else
|
else
|
||||||
zstyle ':completion:*:processes-names' command 'ps -A -o command | awk "NR != 1"'
|
zstyle ':completion:*:processes-names' command 'ps -A -o command | awk "NR != 1"'
|
||||||
|
@ -81,7 +81,7 @@ case `uname -s` in
|
||||||
zstyle ':completion:*:*:killall:*:processes-names' command "ps -u '${USERNAME}' -s"
|
zstyle ':completion:*:*:killall:*:processes-names' command "ps -u '${USERNAME}' -s"
|
||||||
;;
|
;;
|
||||||
Darwin)
|
Darwin)
|
||||||
if [[ $(sw_vers -productVersion) > 10.4 ]] ; then
|
if [[ `sw_vers -productVersion` = 10<5->.<-> ]] ; then
|
||||||
zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o comm"
|
zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o comm"
|
||||||
else
|
else
|
||||||
zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o command"
|
zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o command"
|
||||||
|
|
8
zsh/icc
8
zsh/icc
|
@ -1,7 +1,7 @@
|
||||||
local iccvars_path;
|
local iccvars_path;
|
||||||
if [[ -d "/opt/intel/Compiler" ]] ; then
|
if [ -d "/opt/intel/Compiler" ] ; then
|
||||||
iccvars_path=$(echo /opt/intel/Compiler/11.*/*/bin/iccvars.sh(On[1]))
|
iccvars_path=$(echo /opt/intel/Compiler/11.*/*/bin/iccvars.sh(On[1]))
|
||||||
if [[ -r $iccvars_path ]] ; then
|
if [ -r $iccvars_path ] ; then
|
||||||
case `uname -m` in
|
case `uname -m` in
|
||||||
x86_64)
|
x86_64)
|
||||||
source $iccvars_path intel64
|
source $iccvars_path intel64
|
||||||
|
@ -14,9 +14,9 @@ if [[ -d "/opt/intel/Compiler" ]] ; then
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
elif [[ -d "/opt/intel/cc" ]] || [[ -d "/opt/intel/cce" ]] ; then
|
elif [ -d "/opt/intel/cc" ] || [ -d "/opt/intel/cce" ] ; then
|
||||||
iccvars_path=$(echo /opt/intel/cc*/(10|9).*/bin/iccvars.sh(On[1]))
|
iccvars_path=$(echo /opt/intel/cc*/(10|9).*/bin/iccvars.sh(On[1]))
|
||||||
if [[ -r $iccvars_path ]] ; then
|
if [ -r $iccvars_path ] ; then
|
||||||
source $iccvars_path
|
source $iccvars_path
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -41,4 +41,3 @@ setopt HIST_IGNORE_ALL_DUPS
|
||||||
|
|
||||||
unsetopt HIST_BEEP
|
unsetopt HIST_BEEP
|
||||||
unsetopt EXTENDED_HISTORY
|
unsetopt EXTENDED_HISTORY
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# prompt
|
# prompt
|
||||||
if [[ -z ${SSH_TTY} ]] ; then
|
if [ -z ${SSH_TTY} ] ; then
|
||||||
PROMPT=$'%{\e[01;32m%}%n@%m %{\e[01;34m%}%~ %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}'
|
PROMPT=$'%{\e[01;32m%}%n@%m %{\e[01;34m%}%~ %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}'
|
||||||
RPROMPT=$'%1(j.%{\e[00;36m%}[%j].)%{\e[01;33m%}[%t]%{\e[00;00m%}'
|
RPROMPT=$'%1(j.%{\e[00;36m%}[%j].)%{\e[01;33m%}[%t]%{\e[00;00m%}'
|
||||||
else
|
else
|
||||||
|
|
|
@ -3,7 +3,7 @@ precmd()
|
||||||
{
|
{
|
||||||
local termtitle
|
local termtitle
|
||||||
|
|
||||||
termtitle=$(print -P "%n@%m")
|
termtitle=`print -P "%n@%m"`
|
||||||
title zsh "$termtitle"
|
title zsh "$termtitle"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ preexec()
|
||||||
|
|
||||||
# Prepend this string to the title.
|
# Prepend this string to the title.
|
||||||
# termtitle=$(print -P "%(!.-=*[ROOT]*=- | .)%n@%m:")
|
# termtitle=$(print -P "%(!.-=*[ROOT]*=- | .)%n@%m:")
|
||||||
termtitle=$(print -P "%n@%m:")
|
termtitle=`print -P "%n@%m:"`
|
||||||
|
|
||||||
case $cmd[1] in
|
case $cmd[1] in
|
||||||
fg)
|
fg)
|
||||||
|
|
14
zshrc
14
zshrc
|
@ -8,7 +8,7 @@ autoload -U compinit; compinit -d "${HOME}/.zsh/.zcompdump"
|
||||||
autoload -U age
|
autoload -U age
|
||||||
autoload -U zmv
|
autoload -U zmv
|
||||||
|
|
||||||
if [[ ${ZSH_VERSION//.} -gt 420 ]] ; then
|
if [ ${ZSH_VERSION//.} -gt 420 ] ; then
|
||||||
autoload -U url-quote-magic
|
autoload -U url-quote-magic
|
||||||
zle -N self-insert url-quote-magic
|
zle -N self-insert url-quote-magic
|
||||||
fi
|
fi
|
||||||
|
@ -22,11 +22,11 @@ export LOGCHECK=30
|
||||||
export WATCHFMT=$'\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m'
|
export WATCHFMT=$'\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m'
|
||||||
|
|
||||||
# directory hashes
|
# directory hashes
|
||||||
if [[ -d "${HOME}/sandbox" ]] ; then
|
if [ -d "${HOME}/sandbox" ] ; then
|
||||||
hash -d sandbox="${HOME}/sandbox"
|
hash -d sandbox="${HOME}/sandbox"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "${HOME}/work" ]] ; then
|
if [ -d "${HOME}/work" ] ; then
|
||||||
hash -d work="${HOME}/work"
|
hash -d work="${HOME}/work"
|
||||||
|
|
||||||
for dir in "${HOME}"/work/*(N-/) ; do
|
for dir in "${HOME}"/work/*(N-/) ; do
|
||||||
|
@ -35,15 +35,15 @@ if [[ -d "${HOME}/work" ]] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# common shell utils
|
# common shell utils
|
||||||
if [[ -d "${HOME}/.commonsh" ]] ; then
|
if [ -d "${HOME}/.commonsh" ] ; then
|
||||||
for file in "${HOME}"/.commonsh/*(N.x:t) ; do
|
for file in "${HOME}"/.commonsh/*(N.x:t) ; do
|
||||||
source "${HOME}/.commonsh/${file}"
|
. "${HOME}/.commonsh/${file}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# extras
|
# extras
|
||||||
if [[ -d "${HOME}/.zsh" ]] ; then
|
if [ -d "${HOME}/.zsh" ] ; then
|
||||||
for file in "${HOME}"/.zsh/*(N.x:t) ; do
|
for file in "${HOME}"/.zsh/*(N.x:t) ; do
|
||||||
source "${HOME}/.zsh/${file}"
|
. "${HOME}/.zsh/${file}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue