diff --git a/Xresources b/Xresources index 5f4566d..c7557d7 100644 --- a/Xresources +++ b/Xresources @@ -88,3 +88,6 @@ URxvt*color12: #729FCF URxvt*color13: #AD7FA8 URxvt*color14: #34E2E2 URxvt*color15: #EEEEEC + +/* Rxvt */ +Rxvt*termName: rxvt diff --git a/screenrc b/screenrc new file mode 100644 index 0000000..7fb3896 --- /dev/null +++ b/screenrc @@ -0,0 +1,64 @@ +# Originally by Deason +# Modified by Majnematic + +# turn on visual bell +vbell on + +# default scrollback to 5000 lines +defscrollback 5000 + +# turn off visual bell +termcapinfo * vb@ + +# see, it's a bell, get it? +vbell_msg "Ring Ring Ring Ring Ring Ring" + +# make screen even more fun +nethack on + +# mess with bold +attrcolor b ".I" + +# get screen to go for 256 colors +termcapinfo xterm-256color 'Co#256' + +# erase background with current bg color +defbce on + +# turn on utf8 +defutf8 on + +# set the term to 256 color, maybe +term "screen${SCREEN_COLOR}-bce" + +# changes from the default binding " to `windowlist -b', so we don't create +# a new empty window +bind \" windowlist + +# includes window title name in activity/bell messages +activity "Activity in window %n (%t)" +bell_msg "Bell in window %n (%t)" + +# Argh, choosing a hardstatus line is difficult +# This can only be explained by example, but it takes too much damn space. +# The screen man page is actually good documentation for this, but it takes +# a little while to read. Look for "STRING ESCAPES', and that section will +# explain what all this line noise means. +# +# White background, black text, underlined bold current window +#hardstatus alwayslastline "%{= Wk}%-w%50>%{=ub dd}%n %t%?(%u)%?%{-}%+w%<" +# Normal text, underlined bold current window +#hardstatus alwayslastline "%{= dd}%-w%50>%{=ub}%n %t%?(%u)%?%{-}%+w%<" +# Blue background, white text, underlined bold current window +hardstatus alwayslastline "%{= bw}%-w%50>%{=ub dd}%n %t%?(%u)%?%{-}%+w%<" + +startup_message off + +# Show the screen version just for a second +msgwait 1 +version + +# how many seconds a message appears when we don't press any keys +msgwait 2 + +altscreen on diff --git a/vimrc b/vimrc index 2e5b7c7..d70b8d0 100644 --- a/vimrc +++ b/vimrc @@ -131,9 +131,6 @@ if has('eval') elseif &t_Co == 256 set background=light " We use a light background here call LoadColorScheme("wombat:inkpot") " Set the colorscheme - elseif &t_Co == 88 - set background=dark " We use a dark background here - call LoadColorScheme("inkpot:zellner") " Set the colorscheme else set background=dark " We use a dark background here call LoadColorScheme("zellner") " Set the colorscheme @@ -191,7 +188,7 @@ if has('autocmd') endif " ---- cscope/ctags setup ---- -if has('cscope') && filereadable('/usr/bin/cscope') +if has('cscope') && executable('cscope') == 1 " Search cscope and ctags, in that order set cscopetag set cscopetagorder=0 @@ -274,18 +271,18 @@ imap :silent set number! " Don't force column 0 for # inoremap # X# -" Force to be backspace except when in interix mode -" because interix uses that for forward delete... -" and always accept as a backspace key -" Let interix use ^[[U for end and ^[[H for home +" Always map to backspace +" Both interix and cons use C-? as forward delete, +" besides those two exceptions, always set it to backspace +" Also let interix use ^[[U for end and ^[[H for home map map! -if (&term !~ "interix") - map - map! -else +if (&term =~ "interix") map  map  +elseif (&term !~ "cons") + map + map! endif " Python specific stuff diff --git a/zsh/icc b/zsh/icc new file mode 100755 index 0000000..97e8502 --- /dev/null +++ b/zsh/icc @@ -0,0 +1,24 @@ +local iccvars_path; +iccvars_path=$(echo /opt/intel/Compiler/11.*/*/bin/iccvars.sh(On[1])) +if [[ -r $iccvars_path ]] ; then + case `uname -m` in + x86_64) + source $iccvars_path intel64 + ;; + i*86) + source $iccvars_path ia32 + ;; + ia64) + source $iccvars_path ia64 + ;; + esac +else + if [[ `uname -m` == x86_64 ]] ; then + iccvars_path=$(echo /opt/intel/cce/(10|9).*/bin/iccvars.sh(On[1])) + else + iccvars_path=$(echo /opt/intel/cc/(10|9).*/bin/iccvars.sh(On[1])) + fi + if [[ -r $iccvars_path ]] ; then + source $iccvars_path + fi +fi diff --git a/zsh/macdev b/zsh/macdev new file mode 100755 index 0000000..827f26d --- /dev/null +++ b/zsh/macdev @@ -0,0 +1,10 @@ +local dev_path; +case `uname -s` in + Darwin) + dev_path=/Developer/usr + if [[ -r $dev_path ]] ; then + export PATH=$PATH:$dev_path/bin:$dev_path/sbin + export MANPATH=`manpath -c`:$dev_path/share/man + fi + ;; +esac diff --git a/zshrc b/zshrc index d8d07d5..851c902 100644 --- a/zshrc +++ b/zshrc @@ -68,12 +68,40 @@ elif ( which gdircolors &> /dev/null ) ; then fi # terminal fallback stuff -if (which infocmp &> /dev/null) ; then - case "${TERM}" in - xterm*) - ( infocmp $TERM &> /dev/null ) || export TERM=xterm +function fix_term +{ + case "$1" in + xterm|screen) + ( ( infocmp $1 &> /dev/null ) && echo $1 ) || echo "vt100" + ;; + rxvt|xterm*) + ( ( infocmp $1 &> /dev/null ) && echo $1 ) || fix_term xterm + ;; + rxvt*) + ( ( infocmp $1 &> /dev/null ) && echo $1 ) || fix_term rxvt + ;; + screen*) + ( ( infocmp $1 &> /dev/null ) && echo $1 ) || fix_term screen + ;; + *) + ( ( infocmp $1 &> /dev/null ) && echo $1 ) || echo "vt100" ;; esac +} + +# sorta hacky, but I cannot find a better way to do this :/ +function fix_terminfo_db +{ + if [[ `which infocmp` = "$1/bin/infocmp" ]] ; then + export TERMINFO="$1/share/terminfo" + export TERM=$TERM + fi +} + +export TERM=$(fix_term $TERM) + +if [[ $TERM == *256* ]] ; then + export SCREEN_COLOR="-256color" fi ( which lesspipe &> /dev/null ) && eval $(lesspipe) @@ -88,19 +116,21 @@ export GIT_PAGER='' # aliases alias cd..='cd ..' +# handles per OS aliases, fixes a few terms case `uname -s` in Linux|CYGWIN*) alias ls="ls -h --color=auto" alias grep='grep -d skip --color=auto' ;; FreeBSD|Darwin|DragonFly) - # we must lie to the mac, for it is dumb export LSCOLORS=ExGxFxDxCxDxDxHbaDacec alias ls="ls -Gh" alias grep='grep -d skip --color=auto' ;; Interix) alias ls="ls --color" + + fix_terminfo_db "/usr/local" ;; SunOS) if (which gls &> /dev/null) ; then @@ -119,11 +149,7 @@ case `uname -s` in alias locate='glocate' fi - # sorta hacky, but I cannot find a better way to do this :/ - if [[ `which infocmp` = /opt/csw/bin/infocmp ]] ; then - export TERMINFO=/opt/csw/share/terminfo - export TERM=$TERM - fi + fix_terminfo_db "/opt/csw" ;; esac @@ -151,48 +177,62 @@ bindkey ' ' magic-space bindkey -M emacs '\ee' edit-command-line -bindkey -M emacs '' history-incremental-search-forward -bindkey -M emacs '' history-incremental-search-backward - case $TERM in xterm*) - bindkey '^[[H' beginning-of-line - bindkey '^[[F' end-of-line - bindkey '^[OH' beginning-of-line - bindkey '^[OF' end-of-line - bindkey '^[[1~' beginning-of-line - bindkey '^[[4~' end-of-line - bindkey '^[[7~' beginning-of-line - bindkey '^[[8~' end-of-line - bindkey '^[[3~' delete-char - bindkey '^[[1;5C' emacs-forward-word - bindkey '^[[1;5D' emacs-backward-word - bindkey '^[[5C' emacs-forward-word - bindkey '^[[5D' emacs-backward-word - bindkey '^[OC' emacs-forward-word - bindkey '^[OD' emacs-backward-word + bindkey '\e[H' beginning-of-line + bindkey '\e[F' end-of-line + bindkey '\eOH' beginning-of-line + bindkey '\eOF' end-of-line + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + bindkey '\e[7~' beginning-of-line + bindkey '\e[8~' end-of-line + bindkey '\e[3~' delete-char + bindkey '\e[1;5C' emacs-forward-word + bindkey '\e[1;5D' emacs-backward-word + bindkey '\e[5C' emacs-forward-word + bindkey '\e[5D' emacs-backward-word + bindkey '\eOC' emacs-forward-word + bindkey '\eOD' emacs-backward-word + bindkey '\eOc' emacs-forward-word + bindkey '\eOd' emacs-backward-word + bindkey '\e[c' emacs-forward-word + bindkey '\e[d' emacs-backward-word + ;; + screen*) + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + bindkey '\e[1;5C' emacs-forward-word + bindkey '\e[1;5D' emacs-backward-word + bindkey '\e[3~' delete-char ;; linux) - bindkey '^[[1~' beginning-of-line - bindkey '^[[4~' end-of-line - bindkey '^[[3~' delete-char + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + bindkey '\e[3~' delete-char ;; rxvt*) - bindkey '^[[c' emacs-forward-word - bindkey '^[[d' emacs-backward-word - bindkey '^[Oc' emacs-forward-word - bindkey '^[Od' emacs-backward-word - bindkey '^[[3~' delete-char - bindkey '^[[7~' beginning-of-line - bindkey '^[[8~' end-of-line + bindkey '\e[c' emacs-forward-word + bindkey '\e[d' emacs-backward-word + bindkey '\eOc' emacs-forward-word + bindkey '\eOd' emacs-backward-word + bindkey '\e[3~' delete-char + bindkey '\e[7~' beginning-of-line + bindkey '\e[8~' end-of-line + ;; + cons*) + bindkey '\e[H' beginning-of-line + bindkey '\e[F' end-of-line + bindkey '^?' delete-char ;; interix) - bindkey '^[[H' beginning-of-line - bindkey '^[[U' end-of-line + bindkey '\e[H' beginning-of-line + bindkey '\e[U' end-of-line + bindkey '^?' delete-char ;; - cygwin) - bindkey '^[[1~' beginning-of-line - bindkey '^[[4~' end-of-line + cygwin*) + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line ;; esac @@ -210,9 +250,6 @@ precmd() { local termtitle - ## Changing IFS breaks a few things otherwise, especially clear-zle-screen - IFS=$' \t\n' - termtitle=$(print -P "%n@%m") title zsh "$termtitle" } @@ -269,7 +306,6 @@ function title # Use these two for GNU Screen: print -nR $'\ek'$1$'\e'"\\" shift -# print -nR $'\e]0;'$*$'\a' print -nR $'\e_screen \005 | '$*$'\e'"\\" ;; xterm*|rxvt*|cygwin|interix) @@ -351,7 +387,7 @@ case `uname -s` in zstyle ':completion:*:*:kill:*:processes' command 'ps -U '${USERNAME}' -o pid,args | sed "/ps -U '${USERNAME}' -o pid,args/d"' ;; Darwin) - zstyle ':completion:*:*:kill:*:processes' command 'ps -U '${USERNAME}' -o pid,command | sed "/ps -U '${USERNAME}' -o pid,command/d"' + zstyle ':completion:*:*:kill:*:processes' command 'ps -U '${USERNAME}' -o pid,command | sed "/ps -U '${USERNAME}' -o pid/d"' ;; esac