diff --git a/Xdefaults b/Xdefaults new file mode 120000 index 0000000..2db9ff3 --- /dev/null +++ b/Xdefaults @@ -0,0 +1 @@ +Xresources \ No newline at end of file diff --git a/Xresources b/Xresources new file mode 100644 index 0000000..c7e707d --- /dev/null +++ b/Xresources @@ -0,0 +1,99 @@ +/* XFT */ +Xft*dpi: 96 +Xft*antialias: true + +/* XTerm */ +XTerm*utf8: 1 + +XTerm*faceSize: 9 +XTerm*faceName: Monospace + +XTerm*background: black +XTerm*foreground: #CCCCCC + +XTerm*termName: xterm-256color + +XTerm*eightBitInput: false +XTerm*eightBitOutput: true +XTerm*eightBitControl: false + +XTerm*color0: #2E3436 +XTerm*color1: #CC0000 +XTerm*color2: #4E9A06 +XTerm*color3: #C4A000 +XTerm*color4: #3465A4 +XTerm*color5: #75507B +XTerm*color6: #06989A +XTerm*color7: #D3D7CF +XTerm*color8: #555753 +XTerm*color9: #EF2929 +XTerm*color10: #8AE234 +XTerm*color11: #FCE94F +XTerm*color12: #729FCF +XTerm*color13: #AD7FA8 +XTerm*color14: #34E2E2 +XTerm*color15: #EEEEEC + +/* UXTerm */ +UXTerm*faceSize: 9 +UXTerm*faceName: Monospace + +UXTerm*background: black +UXTerm*foreground: #CCCCCC + +UXTerm*termName: xterm-256color + +UXTerm*eightBitInput: false +UXTerm*eightBitOutput: true +UXTerm*eightBitControl: false + +UXTerm*color0: #2E3436 +UXTerm*color1: #CC0000 +UXTerm*color2: #4E9A06 +UXTerm*color3: #C4A000 +UXTerm*color4: #3465A4 +UXTerm*color5: #75507B +UXTerm*color6: #06989A +UXTerm*color7: #D3D7CF +UXTerm*color8: #555753 +UXTerm*color9: #EF2929 +UXTerm*color10: #8AE234 +UXTerm*color11: #FCE94F +UXTerm*color12: #729FCF +UXTerm*color13: #AD7FA8 +UXTerm*color14: #34E2E2 +UXTerm*color15: #EEEEEC + +/* URxvt */ +URxvt*font: xft:Monospace-9 + +URxvt*background: black +URxvt*foreground: #CCCCCC + +URxvt*termName: rxvt-unicode + +URxvt*color0: #2E3436 +URxvt*color1: #CC0000 +URxvt*color2: #4E9A06 +URxvt*color3: #C4A000 +URxvt*color4: #3465A4 +URxvt*color5: #75507B +URxvt*color6: #06989A +URxvt*color7: #D3D7CF +URxvt*color8: #555753 +URxvt*color9: #EF2929 +URxvt*color10: #8AE234 +URxvt*color11: #FCE94F +URxvt*color12: #729FCF +URxvt*color13: #AD7FA8 +URxvt*color14: #34E2E2 +URxvt*color15: #EEEEEC + +/* Rxvt */ +Rxvt*termName: rxvt + +/* Aterm */ +Aterm*termName: aterm + +/* pterm */ +pterm.TerminalType: putty-256color diff --git a/bash/.gitignore b/bash/.gitignore new file mode 100644 index 0000000..8f5fd87 --- /dev/null +++ b/bash/.gitignore @@ -0,0 +1 @@ +.history diff --git a/bash/alias b/bash/alias new file mode 100755 index 0000000..b8da409 --- /dev/null +++ b/bash/alias @@ -0,0 +1,2 @@ +alias :q='exit' +alias :wq='exit' diff --git a/bash/completion b/bash/completion new file mode 100755 index 0000000..883b676 --- /dev/null +++ b/bash/completion @@ -0,0 +1,3 @@ +for file in /etc/bash_completion /opt/local/etc/bash_completion ; do + [ -f ${file} ] && . $file && break +done diff --git a/bash/git b/bash/git new file mode 100755 index 0000000..a7edcf1 --- /dev/null +++ b/bash/git @@ -0,0 +1,3 @@ +if [ -x /usr/local/git/contrib/completion/git-completion.bash ]; then + . /usr/local/git/contrib/completion/git-completion.bash +fi diff --git a/bash/options b/bash/options new file mode 100755 index 0000000..a675b4d --- /dev/null +++ b/bash/options @@ -0,0 +1,19 @@ +# put history in .bash +export HISTFILE="${HOME}/.bash/.history" + +export HISTSIZE=1000 + +# don't put duplicate lines in the history. See bash(1) for more options +# don't overwrite GNU Midnight Commander's setting of `ignorespace'. +export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups +# ... or force ignoredups and ignorespace +export HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize diff --git a/bash/title_prompt b/bash/title_prompt new file mode 100755 index 0000000..75f8607 --- /dev/null +++ b/bash/title_prompt @@ -0,0 +1,34 @@ +function do_prompt () +{ + if [ $? -ne 0 ] ; then + local ERROR_PROMPT="\[\033[01;31m\]" + fi + + local BASE + if [ $UID -ne 0 ] ; then + BASE="$" + else + BASE="#" + fi + + local TITLEBAR + case $TERM in + xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*) + if [ "${STY}" ] ; then + TITLEBAR='\[\033k\u@\h:\w\033\134\]' + else + TITLEBAR='\[\033]1;\u@\h:\w\007\033]2;\u@\h:\w\007\]' + fi + ;; + screen*) + TITLEBAR='\[\033k\u@\h:\w\033\134\]' + ;; + *) + TITLEBAR='' + ;; + esac + PS1="${TITLEBAR}\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]" + export PS1 +} + +PROMPT_COMMAND=do_prompt diff --git a/bash_profile b/bash_profile new file mode 100644 index 0000000..d1fb79b --- /dev/null +++ b/bash_profile @@ -0,0 +1 @@ +. ~/.bashrc diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..ddef8da --- /dev/null +++ b/bashrc @@ -0,0 +1,16 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +if [ -d "${HOME}/.commonsh" ] ; then + for file in "${HOME}"/.commonsh/* ; do + . $file + done +fi + +if [ -d "${HOME}/.bash" ] ; then + for file in "${HOME}"/.bash/* ; do + . $file + done +fi diff --git a/colortest.pl b/colortest.pl new file mode 100755 index 0000000..3a71a39 --- /dev/null +++ b/colortest.pl @@ -0,0 +1,40 @@ +#! /usr/bin/env perl + +# Generate the array + +# Fill in the first 16 colors. The exact hex codes vary by terminal and device +# This table comes from our .Xresources file. It should be close enough. +my @arr = qw( + 2e/34/36 cc/00/00 4e/9a/06 c4/a0/00 34/65/a4 75/50/7b 06/98/9a d3/d7/cf + 55/57/53 ef/29/29 8a/e2/34 fc/e9/4f 72/9f/cf ad/7f/a8 34/e2/e2 ee/ee/ec +); + +# Main colors +for my $num (16 .. 231) { + push @arr, number_to_color($num); +} + +# Gray scale +for my $num (232 .. 255) { + my $hex = sprintf '%02x', 0x08 + 0x0a * ($num - 232); + push @arr, join '/', ($hex) x 3; +} + +print "This is your standard text color.\n"; +my $width = 6; +for my $num (0 .. $#arr) { + print '[38;5;', $num, 'm'; + printf '%03d: ', $num; + print "$arr[$num] "; + print "\n" if ($num + 1) % $width == 0; +} +print "\n"; + + +sub number_to_color { + my $num = shift; + $num -= 16; + + my @steps = qw(00 5f 87 af d7 ff); + return join('/', $steps[($num / 36) % 6], $steps[($num / 6) % 6], $steps[$num % 6]); +} diff --git a/commonsh/00_helper b/commonsh/00_helper new file mode 100755 index 0000000..8d802e3 --- /dev/null +++ b/commonsh/00_helper @@ -0,0 +1,72 @@ +#! /bin/sh + +concat_path () +{ + if [ -z "$1" ] ; then + echo "Please give me a value to concatinate to the variable!" + exit + fi + + addition=$1 + + if [ -d "${addition}" ] ; then + if [ -z "${PATH}" ] ; then + PATH=${addition} + else + PATH=${addition}:${PATH} + fi + + export PATH + fi +} + +concat_manpath () +{ + if [ -z "$1" ] ; then + echo "Please give me a value to concatinate to the variable!" + exit + fi + + addition=$1 + + if [ -d "${addition}" ] ; then + if [ -z "${MANPATH}" ] ; then + MANPATH=${addition} + else + MANPATH=${addition}:${MANPATH} + fi + + export MANPATH + fi +} + +# we don't have a MANPATH? we can find one. +if [ -z "${MANPATH}" ] ; then + case `uname -s` in + SunOS) + # some solaris systems have manpath + if ( command -v manpath >/dev/null 2>&1 ) ; then + MANPATH=`manpath` + export MANPATH + else + concat_manpath "/usr/share/man" + fi + ;; + OpenBSD) + concat_manpath "/usr/local/man/old" + concat_manpath "/usr/gnu/man/old" + concat_manpath "/usr/contrib/man/old" + concat_manpath "/usr/X11R6/man/old" + concat_manpath "/usr/X11/man/old" + concat_manpath "/usr/gnu/man" + concat_manpath "/usr/contrib/man" + concat_manpath "/usr/X11R6/man" + concat_manpath "/usr/X11/man" + concat_manpath "/usr/share/man" + ;; + Darwin|Linux|FreeBSD) + MANPATH=`manpath` + export MANPATH + ;; + esac +fi diff --git a/commonsh/01_bin b/commonsh/01_bin new file mode 100755 index 0000000..ffd6137 --- /dev/null +++ b/commonsh/01_bin @@ -0,0 +1,2 @@ +#! /bin/sh +concat_path "${HOME}/bin" diff --git a/commonsh/01_ports b/commonsh/01_ports new file mode 100755 index 0000000..1421c4c --- /dev/null +++ b/commonsh/01_ports @@ -0,0 +1,7 @@ +#! /bin/sh + +concat_manpath "/opt/local/man" +concat_path "/opt/local/bin" +concat_path "/opt/local/sbin" +concat_path "/opt/local/libexec" + diff --git a/commonsh/02_term b/commonsh/02_term new file mode 100755 index 0000000..84d1a42 --- /dev/null +++ b/commonsh/02_term @@ -0,0 +1,85 @@ +#! /bin/sh + +# terminal fallback stuff +fix_term () +{ + # we were requested to go on screen and we are on a mac + if ( infocmp $1 >/dev/null 2>&1 ) ; then + echo $1 + else + case $1 in + rxvt|xterm?*|kterm|putty|screen) + fix_term xterm + ;; + *rxvt?*|Eterm|aterm) + fix_term rxvt + ;; + mlterm) + fix_term kterm + ;; + screen-256colors-bce) + fix_term screen-256colors + ;; + screen-256colors) + if ( infocmp xterm-256colors >/dev/null 2>&1 ) ; then + fix_term xterm-256colors + else + fix_term screen + fi + ;; + screen?*) + fix_term screen + ;; + putty-vt100) + echo "vt100" + ;; + putty-256color) + fix_term xterm-256color + ;; + *) + echo "vt100" + ;; + esac + fi +} + +# sorta hacky, but I cannot find a better way to do this :/ +fix_terminfo_db () +{ + if [ -d "$1" ] && [ `command -v infocmp 2>/dev/null` = "$1/bin/infocmp" ] ; then + TERMINFO="$1/share/terminfo" + export TERMINFO + fi +} + +if ( command -v infocmp >/dev/null 2>&1 ) ; then + # terminal surgery + case `uname -s` in + Interix) + fix_terminfo_db "/usr/local" + ;; + SunOS) + fix_terminfo_db "/opt/csw" + ;; + Darwin) + fix_terminfo_db "/opt/local" + ;; + esac + + TERM=`fix_term $TERM` + + # I am sorry to hear that you are running an + # xterm that has no colors (I am looking at you solaris) + if [ $TERM = xterm ] && ( command -v 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 + + export TERM + + case $TERM in + *256*) + alias screen="screen -T `fix_term xterm-256color`" + ;; + esac +fi diff --git a/commonsh/03_cabal b/commonsh/03_cabal new file mode 100755 index 0000000..4aa013b --- /dev/null +++ b/commonsh/03_cabal @@ -0,0 +1,4 @@ +#! /bin/sh + +concat_path "${HOME}/.cabal/bin" + diff --git a/commonsh/10_alias b/commonsh/10_alias new file mode 100755 index 0000000..d4011d5 --- /dev/null +++ b/commonsh/10_alias @@ -0,0 +1,73 @@ +#! /bin/sh +# colors +for dircolors in gdircolors dircolors ; do + if ( command -v $dircolors >/dev/null 2>&1) ; then + [ -f "${HOME}/.$dircolors" ] && eval `$dircolors -b "${HOME}/.$dircolors"` && break + [ -f /etc/DIR_COLORS ] && eval `$dircolors -b /etc/DIR_COLORS` && break + eval `$dircolors -b` && break + fi +done + +# gimmie an editor, make it a nice vi clone +for EDITOR in vim elvis vile nvi vi ; do + ( command -v $EDITOR >/dev/null 2>&1 ) && break +done +export EDITOR + +# make the history editor the editor we want +FCEDIT=$EDITOR +export FCEDIT + +# 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) + if ( command -v gls >/dev/null 2>&1 ) ; then + alias ls="gls -h --color=auto" + elif ( ls --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then + alias ls="ls -h --color=auto" + else + LSCOLORS="ExGxFxDxCxDxDxHbaDEaEa" + export LSCOLORS + alias ls="ls -Gh" + fi + alias grep='grep -d skip --color=auto' + ;; + Interix) + alias ls="ls --color" + ;; + SunOS) + if ( command -v gls >/dev/null 2>&1 ) ; then + alias ls="gls -h --color=auto" + elif ( ls --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then + alias ls="ls -h --color=auto" + else + alias ls="ls -h" + fi + + if ( command -v ggrep >/dev/null 2>&1 ) ; then + alias grep='ggrep -d skip --color=auto' + elif ( grep --version 2>/dev/null | grep GNU >/dev/null 2>&1 ) ; then + alias grep='grep -d skip --color=auto' + fi + + for locate in glocate slocate ; do + ( command -v $locate >/dev/null 2>&1 ) && alias locate=$locate + done + ;; +esac + +alias rm='rm -ir' + +alias df='df -h' +alias du='du -h' + +alias ping='ping -c4' + +( command -v time >/dev/null 2>&1 ) && alias time='command time' diff --git a/commonsh/10_git b/commonsh/10_git new file mode 100755 index 0000000..37e6128 --- /dev/null +++ b/commonsh/10_git @@ -0,0 +1,6 @@ +#! /bin/sh + +concat_manpath "/usr/local/git/man" +concat_path "/usr/local/git/bin" +concat_path "/usr/local/git/libexec/git-core" + diff --git a/commonsh/10_pager b/commonsh/10_pager new file mode 100755 index 0000000..4b9747c --- /dev/null +++ b/commonsh/10_pager @@ -0,0 +1,25 @@ +#! /bin/sh +for PAGER in less more pg ; do + ( command -v $PAGER >/dev/null 2>&1 ) && break +done +export PAGER + +# if we are in less, we can set some options and use lesspipe +if [ $PAGER = less ] ; then + for lesspipe in lesspipe lesspipe.sh ; do + lesspipe_test=`command -v ${lesspipe} 2>/dev/null` + if [ -n "${lesspipe_test}" ] ; then + LESSOPEN="| ${lesspipe_test} %s" + export LESSOPEN + break + fi + done + if [ $lesspipe = lesspipe ] ; then + LESSCLOSE="${lesspipe_test} %s %s" + export LESSCLOSE + fi + + # let less be case insensitive + LESS='-R -M' + export LESS +fi diff --git a/commonsh/10_rlwrap b/commonsh/10_rlwrap new file mode 100755 index 0000000..1314fff --- /dev/null +++ b/commonsh/10_rlwrap @@ -0,0 +1,4 @@ +#! /bin/sh +for wrap in rlwrap rlfe cle ; do + ( command -v $wrap >/dev/null 2>&1 ) && alias ocaml="$wrap ocaml" && break +done diff --git a/commonsh/10_utility b/commonsh/10_utility new file mode 100755 index 0000000..4fc26d3 --- /dev/null +++ b/commonsh/10_utility @@ -0,0 +1,76 @@ +#! /bin/sh +# utility.sh +# Miscellaneous Utility Functions + +unkey_host () +{ + [ ${#} -ne 1 ] && return 1 + sed -i -e "/$1/d" $HOME/.ssh/known_hosts +} + +mkcd () +{ + if [ -d "$1" ] ; then + cd "$1" + return + fi + + mkdir -p "$1" && cd "$1" +} + +extract () +{ + if [ ! -f "$1" ] ; then + echo "The file ("$1") does not exist!" + return + fi + + filename=`echo "$1" | tr '[:upper:]' '[:lower:]'` + + case "$filename" in + *.tar) + tar xf "${1}" + ;; + *.tar.gz|*.tgz|*.tar.z) + tar zxf "${1}" + ;; + *.tar.bz2|*.tbz2) + tar jxf "${1}" + ;; + *.zip|*.jar) + unzip -qo "${1}" + ;; + *.gz|*.z) + gzip -dc "${1}" > `basename "${1%.*}"` + ;; + *.bz2) + bzip2 -dc "${1}" > `basename "${1%.*}"` + ;; + *.rar) + unrar x -idq "${1}" + ;; + *.lha|*.lzh) + lha xqf "${1}" + ;; + *.a|*.deb) + ar x "${1}" + ;; + *.tar.lzma) + lzma -dc "${1}" | tar xf + ;; + *.lzma) + lzma -dc "${1}" > `basename "${1%.*}"` + ;; + *.7z) + 7zr x "${1}" + ;; + *) + echo "Unable to extract '"$1"'" + return 1 + ;; + esac + + return $? +} + +# vim: set ft=sh ts=3 sw=3 et: diff --git a/dircolors b/dircolors new file mode 100644 index 0000000..b39922b --- /dev/null +++ b/dircolors @@ -0,0 +1,172 @@ +# 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 jfbterm +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 01;04;34;40 # dir that is sticky and other-writable (+t,o+w) +OTHER_WRITABLE 01;34;40 # dir that is other-writable (o+w) and not sticky +# STICKY 01;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 +.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 +.svgz 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 +.flv 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 diff --git a/gdircolors b/gdircolors new file mode 100644 index 0000000..f108bdb --- /dev/null +++ b/gdircolors @@ -0,0 +1,172 @@ +# 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 jfbterm +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 01;04;34;40 # dir that is sticky and other-writable (+t,o+w) +# OTHER_WRITABLE 01;34;40 # dir that is other-writable (o+w) and not sticky +# STICKY 01;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 +.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 +.svgz 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 +.flv 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 diff --git a/gitconfig b/gitconfig new file mode 100644 index 0000000..268ac5c --- /dev/null +++ b/gitconfig @@ -0,0 +1,13 @@ +[alias] + co = checkout + ci = commit + st = status + stat = status + di = diff --color-words + up = pull +[color] + diff = auto + status = auto + branch = auto +[core] + pager = diff --git a/gvimrc b/gvimrc new file mode 100644 index 0000000..2408b1a --- /dev/null +++ b/gvimrc @@ -0,0 +1,12 @@ +if has('autocmd') + autocmd GuiEnter * set t_vb= " Disable the visual bell +endif + +" Get rid of the annoying UI +set guioptions-=t " Disable menu tear-offs +set guioptions-=T " Disable the toolbar +set guioptions-=m " Disable the menu +set guioptions-=R " Disable the (right) scrollbar +set guioptions-=r " Disable the (right) scrollbar +set guioptions-=l " Disable the (left) scrollbar +set guioptions-=L " Disable the (left) scrollbar diff --git a/indent.pro b/indent.pro new file mode 100644 index 0000000..bf5a5a2 --- /dev/null +++ b/indent.pro @@ -0,0 +1 @@ +-i8 -bli0 -ut -sai -l100 -npcs -bap -ncs -npsl -fca -nbad diff --git a/inputrc b/inputrc new file mode 100644 index 0000000..bb12dec --- /dev/null +++ b/inputrc @@ -0,0 +1,154 @@ +# Be 8 bit clean. (EXPERIMENTAL: if problems occur, contact me) +set input-meta on +set output-meta on +set convert-meta on + +# Turn off that bell +set bell-style none + +$if mode=emacs + $if term=screen + "\e[H": beginning-of-line + "\e[F": end-of-line + "\eOH": beginning-of-line + "\eOF": end-of-line + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[7~": beginning-of-line + "\e[8~": end-of-line + "\e[3~": delete-char + "\e[1;5C": forward-word + "\e[1;5D": backward-word + "\e[5C": forward-word + "\e[5D": backward-word + "\eOC": forward-word + "\eOD": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[c": forward-word + "\e[d": backward-word + $endif + $if term=xterm + "\e[H": beginning-of-line + "\e[F": end-of-line + "\eOH": beginning-of-line + "\eOF": end-of-line + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[7~": beginning-of-line + "\e[8~": end-of-line + "\e[3~": delete-char + "\e[1;5C": forward-word + "\e[1;5D": backward-word + "\e[5C": forward-word + "\e[5D": backward-word + "\eOC": forward-word + "\eOD": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[c": forward-word + "\e[d": backward-word + $endif + $if term=putty + "\e[H": beginning-of-line + "\e[F": end-of-line + "\eOH": beginning-of-line + "\eOF": end-of-line + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[7~": beginning-of-line + "\e[8~": end-of-line + "\e[3~": delete-char + "\e[1;5C": forward-word + "\e[1;5D": backward-word + "\e[5C": forward-word + "\e[5D": backward-word + "\eOC": forward-word + "\eOD": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[c": forward-word + "\e[d": backward-word + $endif + $if term=mlterm + "\e[H": beginning-of-line + "\e[F": end-of-line + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[1;5C": forward-word + "\e[1;5D": backward-word + "\e[3~": delete-char + $endif + $if term=kterm + "\e[H": beginning-of-line + "\e[F": end-of-line + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[1;5C": forward-word + "\e[1;5D": backward-word + "\e[3~": delete-char + $endif + $if term=linux + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[3~": delete-char + $endif + $if term=vt100 + "\e[1~": beginning-of-line + "\e[4~": end-of-line + "\e[3~": delete-char + $endif + $if term=rxvt + "\e[c": forward-word + "\e[d": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[3~": delete-char + "\e[7~": beginning-of-line + "\e[8~": end-of-line + $endif + $if term=Eterm + "\e[c": forward-word + "\e[d": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[3~": delete-char + "\e[7~": beginning-of-line + "\e[8~": end-of-line + $endif + $if term=aterm + "\e[c": forward-word + "\e[d": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[3~": delete-char + "\e[7~": beginning-of-line + "\e[8~": end-of-line + $endif + $if term=mrxvt + "\e[c": forward-word + "\e[d": backward-word + "\eOc": forward-word + "\eOd": backward-word + "\e[3~": delete-char + "\e[7~": beginning-of-line + "\e[8~": end-of-line + $endif + $if term=cons + "\e[H": beginning-of-line + "\e[F": end-of-line + $endif + $if term=interix + "\e[H": beginning-of-line + "\e[U": end-of-line + $endif + $if term=sun + "\e[214z": beginning-of-line + "\e[220z": end-of-line + "^?": delete-char + $endif + $if term=cygwin + "\e[1~": beginning-of-line + "\e[4~": end-of-line + $endif +$endif diff --git a/install.pl b/install.pl new file mode 100755 index 0000000..5ffdd93 --- /dev/null +++ b/install.pl @@ -0,0 +1,109 @@ +#! /usr/bin/env perl + +# install.pl +# script to create symlinks from the checkout of davesdots to the home directory + +use strict; +use warnings; + +use File::Path qw(mkpath rmtree); +use File::Glob ':glob'; +use Cwd 'cwd'; + +my $scriptdir = cwd() . '/' . $0; +$scriptdir =~ s{/ [^/]+ $}{}x; + +my $home = bsd_glob('~', GLOB_TILDE); + +if(grep /^(?:-h|--help|-\?)$/, @ARGV) { + print < '.screenrc', + toprc => '.toprc', + dircolors => '.dircolors', + gdircolors => '.gdircolors', + lessfilter => '.lessfilter', + + vim => '.vim', + vimrc => '.vimrc', + gvimrc => '.gvimrc', + + commonsh => '.commonsh', + + inputrc => '.inputrc', + + bash => '.bash', + bashrc => '.bashrc', + bash_profile => '.bash_profile', + + zsh => '.zsh', + zshrc => '.zshrc', + + ksh => '.ksh', + kshrc => '.kshrc', + mkshrc => '.mkshrc', + + sh => '.sh', + shinit => '.shinit', + + Xdefaults => '.Xdefaults', + Xresources => '.Xresources', + + 'uncrustify.cfg' => '.uncrustify.cfg', + 'indent.pro' => '.indent.pro', + + xmobarrc => '.xmobarrc', + 'xmonad.hs' => '.xmonad/xmonad.hs', + + gitconfig => '.gitconfig', + + lock => 'bin/lock', +); + +my $i = 0; # Keep track of how many links we added +for my $file (keys %links) { + # See if this file resides in a directory, and create it if needed. + my($path) = $links{$file} =~ m{^ (.+/)? [^/]+ $}x; + mkpath("$home/$path") if $path; + + my $src = "$scriptdir/$file"; + my $dest = "$home/$links{$file}"; + + # If a link already exists, see if it points to this file. If so, skip it. + # This prevents extra warnings caused by previous runs of install.pl. + if(-e $dest && -l $dest) { + next if readlink($dest) eq $src; + } + + # Remove the destination if it exists and we were told to force an overwrite + if($force && -f $dest) { + unlink($dest) || warn "Couldn't unlink '$dest': $!\n"; + } elsif($force && -d $dest) { + rmtree($dest) || warn "Couldn't rmtree '$dest': $!\n"; + } + + symlink($src => $dest) ? $i++ : warn "Couldn't link '$src' to '$dest': $!\n"; +} + +print "$i link"; +print 's' if $i != 1; +print " created\n"; diff --git a/ksh/.gitignore b/ksh/.gitignore new file mode 100644 index 0000000..8f5fd87 --- /dev/null +++ b/ksh/.gitignore @@ -0,0 +1 @@ +.history diff --git a/ksh/options b/ksh/options new file mode 100755 index 0000000..af0fea1 --- /dev/null +++ b/ksh/options @@ -0,0 +1,8 @@ +set -o emacs + +# put history in .ksh +HISTFILE="${HOME}/.ksh/.history" +export HISTFILE + +HISTSIZE=1000 +export HISTSIZE diff --git a/ksh/title_prompt b/ksh/title_prompt new file mode 100755 index 0000000..bf5f9e5 --- /dev/null +++ b/ksh/title_prompt @@ -0,0 +1,28 @@ +if [ -z "${USER}" ] ; then + USER=$LOGNAME +fi + +if [ -n "${USER}" ] && [ ${USER} = root ] ; then + BASE="#" +else + BASE="$" +fi + +case $TERM in + xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*) + if [ "${STY}" ] ; then + TITLE='k${USER}:${PWD}\\' + else + TITLE=']1;${USER}:${PWD}]2;${USER}:${PWD}' + fi + ;; + screen*) + TITLE='k${USER}:${PWD}\\' + ;; + *) + TITLE='' + ;; +esac + +PS1=$TITLE$'\E[01;32m'"${USER} "$'\E[01;34m''$PWD'" ${BASE} "$'\E[0m' +export PS1 diff --git a/kshrc b/kshrc new file mode 100644 index 0000000..68467b0 --- /dev/null +++ b/kshrc @@ -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 diff --git a/lessfilter b/lessfilter new file mode 100755 index 0000000..08b6b51 --- /dev/null +++ b/lessfilter @@ -0,0 +1,13 @@ +#! /bin/sh +# Decode file for less +case `echo "$1" | tr '[:upper:]' '[:lower:]'` in + # we don't handle archives, we let the big guy do it + *.arj|*.tar.bz2|*.bz|*.bz2|*.deb|*.udeb|*.doc|*.gif|*.jpeg|*.jpg|*.pcd|*.png|*.tga|*.tiff|*.tif|*.iso|*.bin|*.raw|*.lha|*.lzh|*.pdf|*.rar|*.r[0-9][0-9]*.rpm|*.tar.gz|*.tgz|*.tar.z|*.tar.dz|*.gz|*.z|*.dz|*.tar|*.jar|*.war|*.ear|*.xpi|*.zip*.7z|*.zoo) + exit 1;; + *changelog) + source-highlight --failsafe -f esc -s changelog -i "$1";; + *) + source-highlight --failsafe -f esc -i "$1";; +esac + +exit 0 diff --git a/lock b/lock new file mode 100755 index 0000000..ac5a571 --- /dev/null +++ b/lock @@ -0,0 +1,61 @@ +#! /bin/sh + +# Yell if they are trying to lock remotely. This won't work. +# Even if it does, it's wrong. +if [ "${SSH_TTY}" ] && [ -z "${STY}" ] ; then + echo "You're doing it wrong. Don't try to lock a remote computer." + exit 1 +fi + +# Graphically locking on Macs is simple. +# If we're not in screen, attempt to graphically lock it. +if [ `uname -s` = 'Darwin' ] && [ -z "${STY}" ] ; then + /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend + exit +fi + +# Handle non-graphical locking +if [ -z "${DISPLAY}" ] ; then + if [ -z "${STY}" ] ; then # not running screen + if ( command -v vlock >/dev/null 2>/dev/null ) ; then + vlock + exit + else + echo "You don't have vlock. Maybe try locking in screen." + fi + else + echo "You are in screen. Use 'C-a x' to lock" + fi + exit 1 +fi + +# Try to lock sanely on X11. +# Certain combinations of desktop managers and locking programs +# allow new sessions to be started. +KDE_LOCK='kdesktop_lock --forcelock || krunner_lock --forcelock || /usr/libexec/kde4/krunner_lock --forcelock || /usr/lib/kde4/libexec/krunner_lock --forcelock' +GNOME_LOCK='gnome-screensaver-command --lock' +XSCREEN_LOCK='xscreensaver-command -lock || xlock' + +if ( ps -e | grep gdm >/dev/null 2>/dev/null ) ; then + # looks like Gnome. They probably want gnome-screensaver. + # start gnome-screensaver to ensure it's running + gnome-screensaver >/dev/null 2>/dev/null + eval $GNOME_LOCK 2>/dev/null && exit +elif ( ps -e | grep kdm >/dev/null 2>/dev/null ) ; then + # looks like some version of KDE. They probably want kde's screensaver. + eval $KDE_LOCK 2>/dev/null && exit +elif ( ps -e | grep xdm >/dev/null 2>/dev/null ) ; then + xscreensaver & >/dev/null 2>/dev/null + eval $XSCREEN_LOCK 2>/dev/null && exit +fi + +echo "Could not decide what desktop manager you are using." +echo "Trying fallback locking." +eval $KDE_LOCK 2>/dev/null && exit +gnome-screensaver >/dev/null 2>/dev/null +eval $GNOME_LOCK 2>/dev/null +xscreensaver & >/dev/null 2>/dev/null +eval $XSCREEN_LOCK 2>/dev/null && exit + +echo "Could not lock your screen." +exit 1 diff --git a/manual_fetch.pl b/manual_fetch.pl new file mode 100755 index 0000000..4d03c62 --- /dev/null +++ b/manual_fetch.pl @@ -0,0 +1,41 @@ +#! /usr/bin/env perl + +use warnings; +use strict; + +### manual_fetch.pl +# a small Perl script to fetch the latest snapshot of a git repo from gitweb +# using minimal requirements (perl, tar, gzip, and (curl or wget)) + +# URL of this repo in gitweb +my $URL = 'http://majnematic.com/cgi-bin/gitweb.cgi?p=davesdots.git'; + +my $html = http_fetch($URL); +my($hash) = $html =~ m{ + gitweb\.cgi\?p=davesdots\.git;a=snapshot;h=([0-9a-fA-F]+);sf=tgz "> snapshot +}xi; + +print "fetching: $URL;a=snapshot;h=$hash;sf=tgz\n"; +my $tgz = http_fetch("$URL;a=snapshot;h=$hash;sf=tgz"); +extract_tgz($tgz); + +sub http_fetch { + my $url = shift; + + # See if we should use wget or curl + if(grep {-x "$_/curl"} split /:/, $ENV{'PATH'}) { + return qx{curl -s '$url'}; + } elsif(grep {-x "$_/wget"} split /:/, $ENV{'PATH'}) { + return qx{wget -O - '$url'}; + } else { + die "Could not find curl or wget, aborting!"; + } +} + +sub extract_tgz { + my $data = shift; + + open(my $pipe, '|-', 'tar', '-xzf', '-') || die "manual_fetch.pl: tar failed: $!"; + print $pipe $data; + close($pipe); +} diff --git a/mkshrc b/mkshrc new file mode 120000 index 0000000..68a689f --- /dev/null +++ b/mkshrc @@ -0,0 +1 @@ +shinit \ No newline at end of file diff --git a/screenrc b/screenrc new file mode 100644 index 0000000..1b50d9f --- /dev/null +++ b/screenrc @@ -0,0 +1,58 @@ +# 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" + +# erase background with current bg color +defbce on + +# turn on utf8 +defutf8 on + +# 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/sh/title b/sh/title new file mode 100644 index 0000000..a0d90df --- /dev/null +++ b/sh/title @@ -0,0 +1,8 @@ +if [ $USER = root ] ; then + BASE="#" +else + BASE="$" +fi + +PS1="${USER} ${BASE} " +export PS1 diff --git a/shinit b/shinit new file mode 100644 index 0000000..28cf231 --- /dev/null +++ b/shinit @@ -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 diff --git a/toprc b/toprc new file mode 100644 index 0000000..7bfc8a1 --- /dev/null +++ b/toprc @@ -0,0 +1,14 @@ +RCfile for "top with windows" # shameless braggin' +Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0 +Def fieldscur=AEHIOQTWKNMbcdfgjplrsuvyzX + winflags=65081, sortindx=10, maxtasks=0 + summclr=1, msgsclr=1, headclr=3, taskclr=1 +Job fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX + winflags=62777, sortindx=0, maxtasks=0 + summclr=6, msgsclr=6, headclr=7, taskclr=6 +Mem fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX + winflags=62777, sortindx=13, maxtasks=0 + summclr=5, msgsclr=5, headclr=4, taskclr=5 +Usr fieldscur=ABDECGfhijlopqrstuvyzMKNWX + winflags=62777, sortindx=4, maxtasks=0 + summclr=3, msgsclr=3, headclr=2, taskclr=3 diff --git a/uiwpa2.conf b/uiwpa2.conf new file mode 100644 index 0000000..b121fa9 --- /dev/null +++ b/uiwpa2.conf @@ -0,0 +1,32 @@ +# Supplicant Config File V1.3 +#Written for the Computer Science Department, University of Illinois. +#2004-08-05 +#Interface for separate control programs. Default value. +ctrl_interface=/var/run/wpa_supplicant + +#Sets which user groups can interact with the control interface. +# Set to Root only. +ctrl_interface_group=adm + +#Sets 802.1x EAPOL version. 1=v1 2=v2. +eapol_version=1 + +#Sets AP sellection to be handled by wpa_supplicant or the driver. +# 0=driver 1=wpa_supplicant +ap_scan=1 + +#Begin Network Block +#-------------------------------- + + +network={ + ssid="UIwpa2" + proto=WPA2 + key_mgmt=WPA-EAP + eap=PEAP + pairwise=CCMP TKIP + group=CCMP TKIP + scan_ssid=1 + identity="netid" + password="password" +} diff --git a/uncrustify.cfg b/uncrustify.cfg new file mode 100644 index 0000000..2a94676 --- /dev/null +++ b/uncrustify.cfg @@ -0,0 +1,112 @@ +align_func_params=false +align_keep_tabs=false +align_nl_cont=false +align_number_left=false +align_on_tabstop=false +align_right_cmt_mix=false +align_var_def_colon=false +align_var_def_inline=false +align_with_tabs=false +cmt_c_group=false +cmt_c_nl_end=false +cmt_c_nl_start=false +cmt_cpp_group=false +cmt_cpp_nl_end=false +cmt_cpp_nl_start=false +cmt_cpp_to_c=false +cmt_star_cont=false +eat_blanks_after_open_brace=false +eat_blanks_before_close_brace=false +indent_align_string=false +indent_bool_paren=false +indent_brace_parent=false +indent_braces=false +indent_braces_no_func=false +indent_class=true +indent_class_colon=false +indent_col1_comment=false +indent_comma_paren=false +indent_func_call_param=false +indent_func_class_param=false +indent_func_ctor_var_param=false +indent_func_def_param=false +indent_func_param_double=false +indent_func_proto_param=false +indent_namespace=true +indent_paren_nl=false +indent_preserve_sql=false +indent_square_nl=false +ls_for_split_full=false +ls_func_split_full=false +mod_full_paren_if_bool=false +mod_pawn_semicolon=false +mod_remove_extra_semicolon=false +mod_sort_import=false +mod_sort_include=false +mod_sort_using=false +nl_after_brace_open=false +nl_after_brace_open_cmt=false +nl_after_case=false +nl_after_multiline_comment=false +nl_after_return=false +nl_after_semicolon=false +nl_after_vbrace_open=false +nl_assign_leave_one_liners=false +nl_before_case=false +nl_class_leave_one_liners=false +nl_collapse_empty_body=false +nl_create_for_one_liner=false +nl_create_if_one_liner=false +nl_create_while_one_liner=false +nl_define_macro=false +nl_ds_struct_enum_close_brace=false +nl_ds_struct_enum_cmt=false +nl_enum_leave_one_liners=false +nl_func_leave_one_liners=false +nl_getset_leave_one_liners=false +nl_if_leave_one_liners=false +nl_multi_line_cond=false +nl_squeeze_ifdef=false +pp_define_at_level=false +pp_if_indent_code=false +pp_indent_at_level=false +pp_region_indent_code=false +sp_balance_nested_parens=false +indent_switch_case=8 +indent_with_tabs=2 +output_tab_size=8 +mod_full_brace_do=add +mod_full_brace_for=add +mod_full_brace_function=add +mod_full_brace_if=add +mod_full_brace_while=add +newlines=auto +nl_catch_brace=add +nl_class_brace=add +nl_class_colon=add +nl_class_init_args=remove +nl_do_brace=add +nl_else_brace=add +nl_elseif_brace=add +nl_fcall_brace=add +nl_fdef_brace=add +nl_finally_brace=add +nl_for_brace=add +nl_func_decl_args=remove +nl_if_brace=add +nl_namespace_brace=add +nl_struct_brace=add +nl_switch_brace=add +nl_template_class=add +nl_try_brace=add +nl_union_brace=add +nl_while_brace=add +pos_class_colon=trail +pos_class_comma=trail +pos_comma=trail +sp_before_sparen=add +sp_func_call_paren=remove +sp_inside_fparen=remove +sp_inside_fparens=remove +sp_inside_paren=remove +sp_inside_sparen=remove diff --git a/vim/colors/inkpot.vim b/vim/colors/inkpot.vim new file mode 100644 index 0000000..a062248 --- /dev/null +++ b/vim/colors/inkpot.vim @@ -0,0 +1,212 @@ +" Vim color file +" Name: inkpot.vim +" Maintainer: Ciaran McCreesh +" This should work in the GUI, rxvt-unicode (88 colour mode) and xterm (256 +" colour mode). It won't work in 8/16 colour terminals. +" +" To use a black background, :let g:inkpot_black_background = 1 + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "inkpot" + +" map a urxvt cube number to an xterm-256 cube number +fun! M(a) + return strpart("0135", a:a, 1) + 0 +endfun + +" map a urxvt colour to an xterm-256 colour +fun! X(a) + if &t_Co == 88 + return a:a + else + if a:a == 8 + return 237 + elseif a:a < 16 + return a:a + elseif a:a > 79 + return 232 + (3 * (a:a - 80)) + else + let l:b = a:a - 16 + let l:x = l:b % 4 + let l:y = (l:b / 4) % 4 + let l:z = (l:b / 16) + return 16 + M(l:x) + (6 * M(l:y)) + (36 * M(l:z)) + endif + endif +endfun + +if ! exists("g:inkpot_black_background") + let g:inkpot_black_background = 0 +endif + +if has("gui_running") + if ! g:inkpot_black_background + hi Normal gui=NONE guifg=#cfbfad guibg=#1e1e27 + else + hi Normal gui=NONE guifg=#cfbfad guibg=#000000 + endif + + hi IncSearch gui=BOLD guifg=#303030 guibg=#cd8b60 + hi Search gui=NONE guifg=#303030 guibg=#cd8b60 + hi ErrorMsg gui=BOLD guifg=#ffffff guibg=#ce4e4e + hi WarningMsg gui=BOLD guifg=#ffffff guibg=#ce8e4e + hi ModeMsg gui=BOLD guifg=#7e7eae guibg=NONE + hi MoreMsg gui=BOLD guifg=#7e7eae guibg=NONE + hi Question gui=BOLD guifg=#ffcd00 guibg=NONE + + hi StatusLine gui=BOLD guifg=#b9b9b9 guibg=#3e3e5e + hi User1 gui=BOLD guifg=#00ff8b guibg=#3e3e5e + hi User2 gui=BOLD guifg=#7070a0 guibg=#3e3e5e + hi StatusLineNC gui=NONE guifg=#b9b9b9 guibg=#3e3e5e + hi VertSplit gui=NONE guifg=#b9b9b9 guibg=#3e3e5e + + hi WildMenu gui=BOLD guifg=#eeeeee guibg=#6e6eaf + + hi MBENormal guifg=#cfbfad guibg=#2e2e3f + hi MBEChanged guifg=#eeeeee guibg=#2e2e3f + hi MBEVisibleNormal guifg=#cfcfcd guibg=#4e4e8f + hi MBEVisibleChanged guifg=#eeeeee guibg=#4e4e8f + + hi DiffText gui=NONE guifg=#ffffcd guibg=#4a2a4a + hi DiffChange gui=NONE guifg=#ffffcd guibg=#306b8f + hi DiffDelete gui=NONE guifg=#ffffcd guibg=#6d3030 + hi DiffAdd gui=NONE guifg=#ffffcd guibg=#306d30 + + hi Cursor gui=NONE guifg=#404040 guibg=#8b8bff + hi lCursor gui=NONE guifg=#404040 guibg=#8fff8b + hi CursorIM gui=NONE guifg=#404040 guibg=#8b8bff + + hi Folded gui=NONE guifg=#cfcfcd guibg=#4b208f + hi FoldColumn gui=NONE guifg=#8b8bcd guibg=#2e2e2e + + hi Directory gui=NONE guifg=#00ff8b guibg=NONE + hi LineNr gui=NONE guifg=#8b8bcd guibg=#2e2e2e + hi NonText gui=BOLD guifg=#8b8bcd guibg=NONE + hi SpecialKey gui=BOLD guifg=#ab60ed guibg=NONE + hi Title gui=BOLD guifg=#af4f4b guibg=NONE + hi Visual gui=NONE guifg=#eeeeee guibg=#4e4e8f + + hi Comment gui=NONE guifg=#cd8b00 guibg=NONE + hi Constant gui=NONE guifg=#ffcd8b guibg=NONE + hi String gui=NONE guifg=#ffcd8b guibg=#404040 + hi Error gui=NONE guifg=#ffffff guibg=#6e2e2e + hi Identifier gui=NONE guifg=#ff8bff guibg=NONE + hi Ignore gui=NONE + hi Number gui=NONE guifg=#f0ad6d guibg=NONE + hi PreProc gui=NONE guifg=#409090 guibg=NONE + hi Special gui=NONE guifg=#c080d0 guibg=NONE + hi SpecialChar gui=NONE guifg=#c080d0 guibg=#404040 + hi Statement gui=NONE guifg=#808bed guibg=NONE + hi Todo gui=BOLD guifg=#303030 guibg=#d0a060 + hi Type gui=NONE guifg=#ff8bff guibg=NONE + hi Underlined gui=BOLD guifg=#df9f2d guibg=NONE + hi TaglistTagName gui=BOLD guifg=#808bed guibg=NONE + + hi perlSpecialMatch gui=NONE guifg=#c080d0 guibg=#404040 + hi perlSpecialString gui=NONE guifg=#c080d0 guibg=#404040 + + hi cSpecialCharacter gui=NONE guifg=#c080d0 guibg=#404040 + hi cFormat gui=NONE guifg=#c080d0 guibg=#404040 + + hi doxygenBrief gui=NONE guifg=#fdab60 guibg=NONE + hi doxygenParam gui=NONE guifg=#fdd090 guibg=NONE + hi doxygenPrev gui=NONE guifg=#fdd090 guibg=NONE + hi doxygenSmallSpecial gui=NONE guifg=#fdd090 guibg=NONE + hi doxygenSpecial gui=NONE guifg=#fdd090 guibg=NONE + hi doxygenComment gui=NONE guifg=#ad7b20 guibg=NONE + hi doxygenSpecial gui=NONE guifg=#fdab60 guibg=NONE + hi doxygenSpecialMultilineDesc gui=NONE guifg=#ad600b guibg=NONE + hi doxygenSpecialOnelineDesc gui=NONE guifg=#ad600b guibg=NONE + + if v:version >= 700 + hi Pmenu gui=NONE guifg=#eeeeee guibg=#4e4e8f + hi PmenuSel gui=BOLD guifg=#eeeeee guibg=#2e2e3f + hi PmenuSbar gui=BOLD guifg=#eeeeee guibg=#6e6eaf + hi PmenuThumb gui=BOLD guifg=#eeeeee guibg=#6e6eaf + + hi SpellBad gui=undercurl guisp=#cc6666 + hi SpellRare gui=undercurl guisp=#cc66cc + hi SpellLocal gui=undercurl guisp=#cccc66 + hi SpellCap gui=undercurl guisp=#66cccc + + hi MatchParen gui=NONE guifg=#404040 guibg=#8fff8b + endif +else + if ! g:inkpot_black_background + exec "hi Normal cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(80) + else + exec "hi Normal cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(16) + endif + + exec "hi IncSearch cterm=BOLD ctermfg=" . X(80) . " ctermbg=" . X(73) + exec "hi Search cterm=NONE ctermfg=" . X(80) . " ctermbg=" . X(73) + exec "hi ErrorMsg cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(48) + exec "hi WarningMsg cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(68) + exec "hi ModeMsg cterm=BOLD ctermfg=" . X(38) . " ctermbg=" . "NONE" + exec "hi MoreMsg cterm=BOLD ctermfg=" . X(38) . " ctermbg=" . "NONE" + exec "hi Question cterm=BOLD ctermfg=" . X(52) . " ctermbg=" . "NONE" + + exec "hi StatusLine cterm=BOLD ctermfg=" . X(85) . " ctermbg=" . X(81) + exec "hi User1 cterm=BOLD ctermfg=" . X(28) . " ctermbg=" . X(81) + exec "hi User2 cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . X(81) + exec "hi StatusLineNC cterm=NONE ctermfg=" . X(84) . " ctermbg=" . X(81) + exec "hi VertSplit cterm=NONE ctermfg=" . X(84) . " ctermbg=" . X(81) + + exec "hi WildMenu cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(38) + + exec "hi MBENormal ctermfg=" . X(85) . " ctermbg=" . X(81) + exec "hi MBEChanged ctermfg=" . X(87) . " ctermbg=" . X(81) + exec "hi MBEVisibleNormal ctermfg=" . X(85) . " ctermbg=" . X(82) + exec "hi MBEVisibleChanged ctermfg=" . X(87) . " ctermbg=" . X(82) + + exec "hi DiffText cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(34) + exec "hi DiffChange cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(17) + exec "hi DiffDelete cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(32) + exec "hi DiffAdd cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(20) + + exec "hi Folded cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(35) + exec "hi FoldColumn cterm=NONE ctermfg=" . X(39) . " ctermbg=" . X(80) + + exec "hi Directory cterm=NONE ctermfg=" . X(28) . " ctermbg=" . "NONE" + exec "hi LineNr cterm=NONE ctermfg=" . X(39) . " ctermbg=" . X(80) + exec "hi NonText cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . "NONE" + exec "hi SpecialKey cterm=BOLD ctermfg=" . X(55) . " ctermbg=" . "NONE" + exec "hi Title cterm=BOLD ctermfg=" . X(48) . " ctermbg=" . "NONE" + exec "hi Visual cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(38) + + exec "hi Comment cterm=NONE ctermfg=" . X(52) . " ctermbg=" . "NONE" + exec "hi Constant cterm=NONE ctermfg=" . X(73) . " ctermbg=" . "NONE" + exec "hi String cterm=NONE ctermfg=" . X(73) . " ctermbg=" . X(81) + exec "hi Error cterm=NONE ctermfg=" . X(79) . " ctermbg=" . X(32) + exec "hi Identifier cterm=NONE ctermfg=" . X(53) . " ctermbg=" . "NONE" + exec "hi Ignore cterm=NONE" + exec "hi Number cterm=NONE ctermfg=" . X(69) . " ctermbg=" . "NONE" + exec "hi PreProc cterm=NONE ctermfg=" . X(25) . " ctermbg=" . "NONE" + exec "hi Special cterm=NONE ctermfg=" . X(55) . " ctermbg=" . "NONE" + exec "hi SpecialChar cterm=NONE ctermfg=" . X(55) . " ctermbg=" . X(81) + exec "hi Statement cterm=NONE ctermfg=" . X(27) . " ctermbg=" . "NONE" + exec "hi Todo cterm=BOLD ctermfg=" . X(16) . " ctermbg=" . X(57) + exec "hi Type cterm=NONE ctermfg=" . X(71) . " ctermbg=" . "NONE" + exec "hi Underlined cterm=BOLD ctermfg=" . X(77) . " ctermbg=" . "NONE" + exec "hi TaglistTagName cterm=BOLD ctermfg=" . X(39) . " ctermbg=" . "NONE" + + if v:version >= 700 + exec "hi Pmenu cterm=NONE ctermfg=" . X(87) . " ctermbg=" . X(82) + exec "hi PmenuSel cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(38) + exec "hi PmenuSbar cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(39) + exec "hi PmenuThumb cterm=BOLD ctermfg=" . X(87) . " ctermbg=" . X(39) + + exec "hi SpellBad cterm=NONE ctermbg=" . X(32) + exec "hi SpellRare cterm=NONE ctermbg=" . X(33) + exec "hi SpellLocal cterm=NONE ctermbg=" . X(36) + exec "hi SpellCap cterm=NONE ctermbg=" . X(21) + exec "hi MatchParen cterm=NONE ctermbg=" . X(14) . "ctermfg=" . X(25) + endif +endif + +" vim: set et : diff --git a/vim/colors/vividchalk.vim b/vim/colors/vividchalk.vim new file mode 100644 index 0000000..44488b4 --- /dev/null +++ b/vim/colors/vividchalk.vim @@ -0,0 +1,172 @@ +" Vim color scheme +" Name: vividchalk.vim +" Author: Tim Pope +" GetLatestVimScripts: 1891 1 :AutoInstall: vividchalk.vim +" $Id: vividchalk.vim,v 1.8 2007-07-11 18:50:16 tpope Exp $ + +" Based on the Vibrank Ink theme for TextMate +" Distributable under the same terms as Vim itself (see :help license) + +if has("gui_running") + set background=dark +endif +hi clear +if exists("syntax_on") + syntax reset +endif + +let colors_name = "vividchalk" + +" First two functions adapted from inkpot.vim + +" map a urxvt cube number to an xterm-256 cube number +fun! s:M(a) + return strpart("0245", a:a, 1) + 0 +endfun + +" map a urxvt colour to an xterm-256 colour +fun! s:X(a) + if &t_Co == 88 + return a:a + else + if a:a == 8 + return 237 + elseif a:a < 16 + return a:a + elseif a:a > 79 + return 232 + (3 * (a:a - 80)) + else + let l:b = a:a - 16 + let l:x = l:b % 4 + let l:y = (l:b / 4) % 4 + let l:z = (l:b / 16) + return 16 + s:M(l:x) + (6 * s:M(l:y)) + (36 * s:M(l:z)) + endif + endif +endfun + +function! E2T(a) + return s:X(a:a) +endfunction + +function! s:choose(mediocre,good) + if &t_Co != 88 && &t_Co != 256 + return a:mediocre + else + return s:X(a:good) + endif +endfunction + +function! s:hifg(group,guifg,first,second,...) + if a:0 && &t_Co == 256 + let ctermfg = a:1 + else + let ctermfg = s:choose(a:first,a:second) + endif + exe "highlight ".a:group." guifg=".a:guifg." ctermfg=".ctermfg +endfunction + +function! s:hibg(group,guibg,first,second) + let ctermbg = s:choose(a:first,a:second) + exe "highlight ".a:group." guibg=".a:guibg." ctermbg=".ctermbg +endfunction + +hi link railsMethod PreProc +hi link rubyDefine Keyword +hi link rubySymbol Constant +hi link rubyAccess rubyMethod +hi link rubyAttribute rubyMethod +hi link rubyEval rubyMethod +hi link rubyException rubyMethod +hi link rubyInclude rubyMethod +hi link rubyStringDelimiter rubyString +hi link rubyRegexp Regexp +hi link rubyRegexpDelimiter rubyRegexp +"hi link rubyConstant Variable +"hi link rubyGlobalVariable Variable +"hi link rubyClassVariable Variable +"hi link rubyInstanceVariable Variable +hi link javascriptRegexpString Regexp +hi link javascriptNumber Number +hi link javascriptNull Constant + +call s:hifg("Normal","#EEEEEE","White",87) +if &background == "light" || has("gui_running") + hi Normal guibg=Black ctermbg=Black +else + hi Normal guibg=Black ctermbg=NONE +endif +highlight StatusLine guifg=Black guibg=#aabbee gui=bold ctermfg=Black ctermbg=White cterm=bold +highlight StatusLineNC guifg=#444444 guibg=#aaaaaa gui=none ctermfg=Black ctermbg=Grey cterm=none +"if &t_Co == 256 + "highlight StatusLine ctermbg=117 +"else + "highlight StatusLine ctermbg=43 +"endif +highlight WildMenu guifg=Black guibg=#ffff00 gui=bold ctermfg=Black ctermbg=Yellow cterm=bold +highlight Cursor guifg=Black guibg=White ctermfg=Black ctermbg=White +highlight CursorLine guibg=#333333 guifg=NONE +highlight CursorColumn guibg=#333333 guifg=NONE +highlight NonText guifg=#404040 ctermfg=8 +highlight SpecialKey guifg=#404040 ctermfg=8 +highlight Directory none +high link Directory Identifier +highlight ErrorMsg guibg=Red ctermbg=DarkRed guifg=NONE ctermfg=NONE +highlight Search guifg=NONE ctermfg=NONE gui=none cterm=none +call s:hibg("Search" ,"#555555","Black",81) +highlight IncSearch guifg=White guibg=Black ctermfg=White ctermbg=Black +highlight MoreMsg guifg=#00AA00 ctermfg=Green +highlight LineNr guifg=#DDEEFF ctermfg=White +call s:hibg("LineNr" ,"#222222","DarkBlue",80) +highlight Question none +high link Question MoreMsg +highlight Title guifg=Magenta ctermfg=Magenta +highlight VisualNOS gui=none cterm=none +call s:hibg("Visual" ,"#555577","LightBlue",83) +call s:hibg("VisualNOS" ,"#444444","DarkBlue",81) +highlight WarningMsg guifg=Red ctermfg=Red +highlight Folded guibg=#1100aa ctermbg=DarkBlue +call s:hibg("Folded" ,"#110077","DarkBlue",17) +call s:hifg("Folded" ,"#aaddee","LightCyan",63) +highlight FoldColumn none +high link FoldColumn Folded +highlight Pmenu guifg=White ctermfg=White gui=bold cterm=bold +highlight PmenuSel guifg=White ctermfg=White gui=bold cterm=bold +call s:hibg("Pmenu" ,"#000099","Blue",18) +call s:hibg("PmenuSel" ,"#5555ff","DarkCyan",39) +highlight PmenuSbar guibg=Grey ctermbg=Grey +highlight PmenuThumb guibg=White ctermbg=White +highlight TabLine gui=underline cterm=underline +call s:hifg("TabLine" ,"#bbbbbb","LightGrey",85) +call s:hibg("TabLine" ,"#333333","DarkGrey",80) +highlight TabLineSel guifg=White guibg=Black ctermfg=White ctermbg=Black +highlight TabLineFill gui=underline cterm=underline +call s:hifg("TabLineFill","#bbbbbb","LightGrey",85) +call s:hibg("TabLineFill","#808080","Grey",83) + +hi Type gui=none +hi Statement gui=none +if !has("gui_mac") + " Mac GUI degrades italics to ugly underlining. + hi Comment gui=italic + hi railsUserClass gui=italic + hi railsUserMethod gui=italic +endif +hi Identifier cterm=none +" Commented numbers at the end are *old* 256 color values +"highlight PreProc guifg=#EDF8F9 +call s:hifg("Comment" ,"#9933CC","DarkMagenta",34) " 92 +" 26 instead? +call s:hifg("Constant" ,"#339999","DarkCyan",21) " 30 +call s:hifg("rubyNumber" ,"#CCFF33","Yellow",60) " 190 +call s:hifg("String" ,"#66FF00","LightGreen",44,82) " 82 +call s:hifg("Identifier" ,"#FFCC00","Yellow",72) " 220 +call s:hifg("Statement" ,"#FF6600","Brown",68) " 202 +call s:hifg("PreProc" ,"#AAFFFF","LightCyan",47) " 213 +call s:hifg("railsUserMethod","#AACCFF","LightCyan",27) +call s:hifg("Type" ,"#AAAA77","Grey",57) " 101 +call s:hifg("railsUserClass" ,"#AAAAAA","Grey",7) " 101 +call s:hifg("Special" ,"#33AA00","DarkGreen",24) " 7 +call s:hifg("Regexp" ,"#44B4CC","DarkCyan",21) " 74 +call s:hifg("rubyMethod" ,"#DDE93D","Yellow",77) " 191 +"highlight railsMethod guifg=#EE1122 ctermfg=1 diff --git a/vim/colors/wombat.vim b/vim/colors/wombat.vim new file mode 100644 index 0000000..da93563 --- /dev/null +++ b/vim/colors/wombat.vim @@ -0,0 +1,252 @@ +" This scheme was created by CSApproxSnapshot +" on Sat, 17 Jan 2009 + +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = 'wombat' + +if v:version < 700 + command! -nargs=+ CSAHi exe "hi" substitute(substitute(, "undercurl", "underline", "g"), "guisp\\S\\+", "", "g") +else + command! -nargs=+ CSAHi exe "hi" +endif + +if 0 +elseif has("gui_running") || (&t_Co == 256 && (&term ==# "xterm" || &term ==# "^screen") && exists("g:CSApprox_konsole") && g:CSApprox_konsole) || &term =~? "^konsole" + CSAHi Normal term=NONE cterm=NONE ctermbg=235 ctermfg=231 gui=NONE guibg=#242424 guifg=#f6f3e8 + CSAHi Underlined term=underline cterm=underline ctermbg=bg ctermfg=147 gui=underline guibg=bg guifg=#80a0ff + CSAHi Ignore term=NONE cterm=NONE ctermbg=bg ctermfg=235 gui=NONE guibg=bg guifg=#242424 + CSAHi Error term=reverse cterm=NONE ctermbg=196 ctermfg=231 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi Todo term=NONE cterm=NONE ctermbg=226 ctermfg=245 gui=italic guibg=#ffff00 guifg=#8f8f8f + CSAHi String term=NONE cterm=NONE ctermbg=bg ctermfg=150 gui=italic guibg=bg guifg=#95e454 + CSAHi Number term=NONE cterm=NONE ctermbg=bg ctermfg=174 gui=NONE guibg=bg guifg=#e5786d + CSAHi Function term=NONE cterm=NONE ctermbg=bg ctermfg=193 gui=NONE guibg=bg guifg=#cae682 + CSAHi SpecialKey term=bold cterm=NONE ctermbg=59 ctermfg=244 gui=NONE guibg=#343434 guifg=#808080 + CSAHi NonText term=bold cterm=NONE ctermbg=236 ctermfg=244 gui=NONE guibg=#303030 guifg=#808080 + CSAHi Directory term=bold cterm=NONE ctermbg=bg ctermfg=51 gui=NONE guibg=bg guifg=#00ffff + CSAHi ErrorMsg term=NONE cterm=NONE ctermbg=196 ctermfg=231 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi IncSearch term=reverse cterm=NONE ctermbg=231 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi Search term=reverse cterm=NONE ctermbg=226 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi MoreMsg term=bold cterm=bold ctermbg=bg ctermfg=72 gui=bold guibg=bg guifg=#2e8b57 + CSAHi ModeMsg term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi LineNr term=underline cterm=NONE ctermbg=16 ctermfg=138 gui=NONE guibg=#000000 guifg=#857b6f + CSAHi Pmenu term=NONE cterm=NONE ctermbg=238 ctermfg=231 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi PmenuSel term=NONE cterm=NONE ctermbg=193 ctermfg=16 gui=NONE guibg=#cae682 guifg=#000000 + CSAHi PmenuSbar term=NONE cterm=NONE ctermbg=250 ctermfg=fg gui=NONE guibg=#bebebe guifg=fg + CSAHi PmenuThumb term=NONE cterm=NONE ctermbg=231 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi TabLine term=underline cterm=underline ctermbg=248 ctermfg=fg gui=underline guibg=#a9a9a9 guifg=fg + CSAHi TabLineSel term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi TabLineFill term=reverse cterm=NONE ctermbg=231 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi CursorColumn term=reverse cterm=NONE ctermbg=236 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi CursorLine term=underline cterm=NONE ctermbg=236 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi Cursor term=NONE cterm=NONE ctermbg=102 ctermfg=fg gui=NONE guibg=#656565 guifg=fg + CSAHi Keyword term=NONE cterm=NONE ctermbg=bg ctermfg=153 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi Question term=NONE cterm=bold ctermbg=bg ctermfg=46 gui=bold guibg=bg guifg=#00ff00 + CSAHi StatusLine term=reverse,bold cterm=NONE ctermbg=238 ctermfg=231 gui=italic guibg=#444444 guifg=#f6f3e8 + CSAHi StatusLineNC term=reverse cterm=NONE ctermbg=238 ctermfg=138 gui=NONE guibg=#444444 guifg=#857b6f + CSAHi VertSplit term=reverse cterm=NONE ctermbg=238 ctermfg=238 gui=NONE guibg=#444444 guifg=#444444 + CSAHi Title term=bold cterm=bold ctermbg=bg ctermfg=231 gui=bold guibg=bg guifg=#f6f3e8 + CSAHi Visual term=reverse cterm=NONE ctermbg=238 ctermfg=231 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi VisualNOS term=bold,underline cterm=bold,underline ctermbg=bg ctermfg=fg gui=bold,underline guibg=bg guifg=fg + CSAHi WarningMsg term=NONE cterm=NONE ctermbg=bg ctermfg=196 gui=NONE guibg=bg guifg=#ff0000 + CSAHi WildMenu term=NONE cterm=NONE ctermbg=226 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi Folded term=NONE cterm=NONE ctermbg=59 ctermfg=145 gui=NONE guibg=#384048 guifg=#a0a8b0 + CSAHi lCursor term=NONE cterm=NONE ctermbg=231 ctermfg=235 gui=NONE guibg=#f6f3e8 guifg=#242424 + CSAHi MatchParen term=reverse cterm=bold ctermbg=138 ctermfg=231 gui=bold guibg=#857b6f guifg=#f6f3e8 + CSAHi Comment term=bold cterm=NONE ctermbg=bg ctermfg=145 gui=italic guibg=bg guifg=#99968b + CSAHi Constant term=underline cterm=NONE ctermbg=bg ctermfg=174 gui=NONE guibg=bg guifg=#e5786d + CSAHi Special term=bold cterm=NONE ctermbg=bg ctermfg=230 gui=NONE guibg=bg guifg=#e7f6da + CSAHi Identifier term=underline cterm=NONE ctermbg=bg ctermfg=193 gui=NONE guibg=bg guifg=#cae682 + CSAHi Statement term=bold cterm=NONE ctermbg=bg ctermfg=153 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi PreProc term=underline cterm=NONE ctermbg=bg ctermfg=174 gui=NONE guibg=bg guifg=#e5786d + CSAHi Type term=underline cterm=NONE ctermbg=bg ctermfg=193 gui=NONE guibg=bg guifg=#cae682 + CSAHi FoldColumn term=NONE cterm=NONE ctermbg=250 ctermfg=51 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi DiffAdd term=bold cterm=NONE ctermbg=19 ctermfg=fg gui=NONE guibg=#00008b guifg=fg + CSAHi DiffChange term=bold cterm=NONE ctermbg=127 ctermfg=fg gui=NONE guibg=#8b008b guifg=fg + CSAHi DiffDelete term=bold cterm=bold ctermbg=37 ctermfg=21 gui=bold guibg=#008b8b guifg=#0000ff + CSAHi DiffText term=reverse cterm=bold ctermbg=196 ctermfg=fg gui=bold guibg=#ff0000 guifg=fg + CSAHi SignColumn term=NONE cterm=NONE ctermbg=250 ctermfg=51 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi SpellBad term=reverse cterm=undercurl ctermbg=bg ctermfg=196 gui=undercurl guibg=bg guifg=fg guisp=#ff0000 + CSAHi SpellCap term=reverse cterm=undercurl ctermbg=bg ctermfg=21 gui=undercurl guibg=bg guifg=fg guisp=#0000ff + CSAHi SpellRare term=reverse cterm=undercurl ctermbg=bg ctermfg=201 gui=undercurl guibg=bg guifg=fg guisp=#ff00ff + CSAHi SpellLocal term=underline cterm=undercurl ctermbg=bg ctermfg=51 gui=undercurl guibg=bg guifg=fg guisp=#00ffff +elseif has("gui_running") || (&t_Co == 256 && (&term ==# "xterm" || &term ==# "^screen") && exists("g:CSApprox_eterm") && g:CSApprox_eterm) || &term =~? "^eterm" + CSAHi Normal term=NONE cterm=NONE ctermbg=235 ctermfg=231 gui=NONE guibg=#242424 guifg=#f6f3e8 + CSAHi Underlined term=underline cterm=underline ctermbg=bg ctermfg=147 gui=underline guibg=bg guifg=#80a0ff + CSAHi Ignore term=NONE cterm=NONE ctermbg=bg ctermfg=235 gui=NONE guibg=bg guifg=#242424 + CSAHi Error term=reverse cterm=NONE ctermbg=196 ctermfg=231 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi Todo term=NONE cterm=NONE ctermbg=226 ctermfg=245 gui=italic guibg=#ffff00 guifg=#8f8f8f + CSAHi String term=NONE cterm=NONE ctermbg=bg ctermfg=150 gui=italic guibg=bg guifg=#95e454 + CSAHi Number term=NONE cterm=NONE ctermbg=bg ctermfg=174 gui=NONE guibg=bg guifg=#e5786d + CSAHi Function term=NONE cterm=NONE ctermbg=bg ctermfg=193 gui=NONE guibg=bg guifg=#cae682 + CSAHi SpecialKey term=bold cterm=NONE ctermbg=59 ctermfg=244 gui=NONE guibg=#343434 guifg=#808080 + CSAHi NonText term=bold cterm=NONE ctermbg=236 ctermfg=244 gui=NONE guibg=#303030 guifg=#808080 + CSAHi Directory term=bold cterm=NONE ctermbg=bg ctermfg=51 gui=NONE guibg=bg guifg=#00ffff + CSAHi ErrorMsg term=NONE cterm=NONE ctermbg=196 ctermfg=231 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi IncSearch term=reverse cterm=NONE ctermbg=231 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi Search term=reverse cterm=NONE ctermbg=226 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi MoreMsg term=bold cterm=bold ctermbg=bg ctermfg=72 gui=bold guibg=bg guifg=#2e8b57 + CSAHi ModeMsg term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi LineNr term=underline cterm=NONE ctermbg=16 ctermfg=138 gui=NONE guibg=#000000 guifg=#857b6f + CSAHi Pmenu term=NONE cterm=NONE ctermbg=238 ctermfg=231 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi PmenuSel term=NONE cterm=NONE ctermbg=193 ctermfg=16 gui=NONE guibg=#cae682 guifg=#000000 + CSAHi PmenuSbar term=NONE cterm=NONE ctermbg=250 ctermfg=fg gui=NONE guibg=#bebebe guifg=fg + CSAHi PmenuThumb term=NONE cterm=NONE ctermbg=231 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi TabLine term=underline cterm=underline ctermbg=248 ctermfg=fg gui=underline guibg=#a9a9a9 guifg=fg + CSAHi TabLineSel term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi TabLineFill term=reverse cterm=NONE ctermbg=231 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi CursorColumn term=reverse cterm=NONE ctermbg=236 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi CursorLine term=underline cterm=NONE ctermbg=236 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi Cursor term=NONE cterm=NONE ctermbg=102 ctermfg=fg gui=NONE guibg=#656565 guifg=fg + CSAHi Keyword term=NONE cterm=NONE ctermbg=bg ctermfg=153 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi Question term=NONE cterm=bold ctermbg=bg ctermfg=46 gui=bold guibg=bg guifg=#00ff00 + CSAHi StatusLine term=reverse,bold cterm=NONE ctermbg=238 ctermfg=231 gui=italic guibg=#444444 guifg=#f6f3e8 + CSAHi StatusLineNC term=reverse cterm=NONE ctermbg=238 ctermfg=138 gui=NONE guibg=#444444 guifg=#857b6f + CSAHi VertSplit term=reverse cterm=NONE ctermbg=238 ctermfg=238 gui=NONE guibg=#444444 guifg=#444444 + CSAHi Title term=bold cterm=bold ctermbg=bg ctermfg=231 gui=bold guibg=bg guifg=#f6f3e8 + CSAHi Visual term=reverse cterm=NONE ctermbg=238 ctermfg=231 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi VisualNOS term=bold,underline cterm=bold,underline ctermbg=bg ctermfg=fg gui=bold,underline guibg=bg guifg=fg + CSAHi WarningMsg term=NONE cterm=NONE ctermbg=bg ctermfg=196 gui=NONE guibg=bg guifg=#ff0000 + CSAHi WildMenu term=NONE cterm=NONE ctermbg=226 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi Folded term=NONE cterm=NONE ctermbg=59 ctermfg=145 gui=NONE guibg=#384048 guifg=#a0a8b0 + CSAHi lCursor term=NONE cterm=NONE ctermbg=231 ctermfg=235 gui=NONE guibg=#f6f3e8 guifg=#242424 + CSAHi MatchParen term=reverse cterm=bold ctermbg=138 ctermfg=231 gui=bold guibg=#857b6f guifg=#f6f3e8 + CSAHi Comment term=bold cterm=NONE ctermbg=bg ctermfg=145 gui=italic guibg=bg guifg=#99968b + CSAHi Constant term=underline cterm=NONE ctermbg=bg ctermfg=174 gui=NONE guibg=bg guifg=#e5786d + CSAHi Special term=bold cterm=NONE ctermbg=bg ctermfg=230 gui=NONE guibg=bg guifg=#e7f6da + CSAHi Identifier term=underline cterm=NONE ctermbg=bg ctermfg=193 gui=NONE guibg=bg guifg=#cae682 + CSAHi Statement term=bold cterm=NONE ctermbg=bg ctermfg=153 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi PreProc term=underline cterm=NONE ctermbg=bg ctermfg=174 gui=NONE guibg=bg guifg=#e5786d + CSAHi Type term=underline cterm=NONE ctermbg=bg ctermfg=193 gui=NONE guibg=bg guifg=#cae682 + CSAHi FoldColumn term=NONE cterm=NONE ctermbg=250 ctermfg=51 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi DiffAdd term=bold cterm=NONE ctermbg=19 ctermfg=fg gui=NONE guibg=#00008b guifg=fg + CSAHi DiffChange term=bold cterm=NONE ctermbg=127 ctermfg=fg gui=NONE guibg=#8b008b guifg=fg + CSAHi DiffDelete term=bold cterm=bold ctermbg=37 ctermfg=21 gui=bold guibg=#008b8b guifg=#0000ff + CSAHi DiffText term=reverse cterm=bold ctermbg=196 ctermfg=fg gui=bold guibg=#ff0000 guifg=fg + CSAHi SignColumn term=NONE cterm=NONE ctermbg=250 ctermfg=51 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi SpellBad term=reverse cterm=undercurl ctermbg=bg ctermfg=196 gui=undercurl guibg=bg guifg=fg guisp=#ff0000 + CSAHi SpellCap term=reverse cterm=undercurl ctermbg=bg ctermfg=21 gui=undercurl guibg=bg guifg=fg guisp=#0000ff + CSAHi SpellRare term=reverse cterm=undercurl ctermbg=bg ctermfg=201 gui=undercurl guibg=bg guifg=fg guisp=#ff00ff + CSAHi SpellLocal term=underline cterm=undercurl ctermbg=bg ctermfg=51 gui=undercurl guibg=bg guifg=fg guisp=#00ffff +elseif has("gui_running") || &t_Co == 256 + CSAHi Normal term=NONE cterm=NONE ctermbg=235 ctermfg=230 gui=NONE guibg=#242424 guifg=#f6f3e8 + CSAHi Underlined term=underline cterm=underline ctermbg=bg ctermfg=111 gui=underline guibg=bg guifg=#80a0ff + CSAHi Ignore term=NONE cterm=NONE ctermbg=bg ctermfg=235 gui=NONE guibg=bg guifg=#242424 + CSAHi Error term=reverse cterm=NONE ctermbg=196 ctermfg=231 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi Todo term=NONE cterm=NONE ctermbg=226 ctermfg=245 gui=italic guibg=#ffff00 guifg=#8f8f8f + CSAHi String term=NONE cterm=NONE ctermbg=bg ctermfg=113 gui=italic guibg=bg guifg=#95e454 + CSAHi Number term=NONE cterm=NONE ctermbg=bg ctermfg=173 gui=NONE guibg=bg guifg=#e5786d + CSAHi Function term=NONE cterm=NONE ctermbg=bg ctermfg=186 gui=NONE guibg=bg guifg=#cae682 + CSAHi SpecialKey term=bold cterm=NONE ctermbg=236 ctermfg=244 gui=NONE guibg=#343434 guifg=#808080 + CSAHi NonText term=bold cterm=NONE ctermbg=236 ctermfg=244 gui=NONE guibg=#303030 guifg=#808080 + CSAHi Directory term=bold cterm=NONE ctermbg=bg ctermfg=51 gui=NONE guibg=bg guifg=#00ffff + CSAHi ErrorMsg term=NONE cterm=NONE ctermbg=196 ctermfg=231 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi IncSearch term=reverse cterm=NONE ctermbg=230 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi Search term=reverse cterm=NONE ctermbg=226 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi MoreMsg term=bold cterm=bold ctermbg=bg ctermfg=29 gui=bold guibg=bg guifg=#2e8b57 + CSAHi ModeMsg term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi LineNr term=underline cterm=NONE ctermbg=16 ctermfg=101 gui=NONE guibg=#000000 guifg=#857b6f + CSAHi Pmenu term=NONE cterm=NONE ctermbg=238 ctermfg=230 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi PmenuSel term=NONE cterm=NONE ctermbg=186 ctermfg=16 gui=NONE guibg=#cae682 guifg=#000000 + CSAHi PmenuSbar term=NONE cterm=NONE ctermbg=250 ctermfg=fg gui=NONE guibg=#bebebe guifg=fg + CSAHi PmenuThumb term=NONE cterm=NONE ctermbg=230 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi TabLine term=underline cterm=underline ctermbg=248 ctermfg=fg gui=underline guibg=#a9a9a9 guifg=fg + CSAHi TabLineSel term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi TabLineFill term=reverse cterm=NONE ctermbg=230 ctermfg=235 gui=reverse guibg=bg guifg=fg + CSAHi CursorColumn term=reverse cterm=NONE ctermbg=236 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi CursorLine term=underline cterm=NONE ctermbg=236 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi Cursor term=NONE cterm=NONE ctermbg=241 ctermfg=fg gui=NONE guibg=#656565 guifg=fg + CSAHi Keyword term=NONE cterm=NONE ctermbg=bg ctermfg=117 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi Question term=NONE cterm=bold ctermbg=bg ctermfg=46 gui=bold guibg=bg guifg=#00ff00 + CSAHi StatusLine term=reverse,bold cterm=NONE ctermbg=238 ctermfg=230 gui=italic guibg=#444444 guifg=#f6f3e8 + CSAHi StatusLineNC term=reverse cterm=NONE ctermbg=238 ctermfg=101 gui=NONE guibg=#444444 guifg=#857b6f + CSAHi VertSplit term=reverse cterm=NONE ctermbg=238 ctermfg=238 gui=NONE guibg=#444444 guifg=#444444 + CSAHi Title term=bold cterm=bold ctermbg=bg ctermfg=230 gui=bold guibg=bg guifg=#f6f3e8 + CSAHi Visual term=reverse cterm=NONE ctermbg=238 ctermfg=230 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi VisualNOS term=bold,underline cterm=bold,underline ctermbg=bg ctermfg=fg gui=bold,underline guibg=bg guifg=fg + CSAHi WarningMsg term=NONE cterm=NONE ctermbg=bg ctermfg=196 gui=NONE guibg=bg guifg=#ff0000 + CSAHi WildMenu term=NONE cterm=NONE ctermbg=226 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi Folded term=NONE cterm=NONE ctermbg=59 ctermfg=145 gui=NONE guibg=#384048 guifg=#a0a8b0 + CSAHi lCursor term=NONE cterm=NONE ctermbg=230 ctermfg=235 gui=NONE guibg=#f6f3e8 guifg=#242424 + CSAHi MatchParen term=reverse cterm=bold ctermbg=101 ctermfg=230 gui=bold guibg=#857b6f guifg=#f6f3e8 + CSAHi Comment term=bold cterm=NONE ctermbg=bg ctermfg=102 gui=italic guibg=bg guifg=#99968b + CSAHi Constant term=underline cterm=NONE ctermbg=bg ctermfg=173 gui=NONE guibg=bg guifg=#e5786d + CSAHi Special term=bold cterm=NONE ctermbg=bg ctermfg=194 gui=NONE guibg=bg guifg=#e7f6da + CSAHi Identifier term=underline cterm=NONE ctermbg=bg ctermfg=186 gui=NONE guibg=bg guifg=#cae682 + CSAHi Statement term=bold cterm=NONE ctermbg=bg ctermfg=117 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi PreProc term=underline cterm=NONE ctermbg=bg ctermfg=173 gui=NONE guibg=bg guifg=#e5786d + CSAHi Type term=underline cterm=NONE ctermbg=bg ctermfg=186 gui=NONE guibg=bg guifg=#cae682 + CSAHi FoldColumn term=NONE cterm=NONE ctermbg=250 ctermfg=51 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi DiffAdd term=bold cterm=NONE ctermbg=18 ctermfg=fg gui=NONE guibg=#00008b guifg=fg + CSAHi DiffChange term=bold cterm=NONE ctermbg=90 ctermfg=fg gui=NONE guibg=#8b008b guifg=fg + CSAHi DiffDelete term=bold cterm=bold ctermbg=30 ctermfg=21 gui=bold guibg=#008b8b guifg=#0000ff + CSAHi DiffText term=reverse cterm=bold ctermbg=196 ctermfg=fg gui=bold guibg=#ff0000 guifg=fg + CSAHi SignColumn term=NONE cterm=NONE ctermbg=250 ctermfg=51 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi SpellBad term=reverse cterm=undercurl ctermbg=bg ctermfg=196 gui=undercurl guibg=bg guifg=fg guisp=#ff0000 + CSAHi SpellCap term=reverse cterm=undercurl ctermbg=bg ctermfg=21 gui=undercurl guibg=bg guifg=fg guisp=#0000ff + CSAHi SpellRare term=reverse cterm=undercurl ctermbg=bg ctermfg=201 gui=undercurl guibg=bg guifg=fg guisp=#ff00ff + CSAHi SpellLocal term=underline cterm=undercurl ctermbg=bg ctermfg=51 gui=undercurl guibg=bg guifg=fg guisp=#00ffff +elseif has("gui_running") || &t_Co == 88 + CSAHi Normal term=NONE cterm=NONE ctermbg=16 ctermfg=79 gui=NONE guibg=#242424 guifg=#f6f3e8 + CSAHi Underlined term=underline cterm=underline ctermbg=bg ctermfg=39 gui=underline guibg=bg guifg=#80a0ff + CSAHi Ignore term=NONE cterm=NONE ctermbg=bg ctermfg=16 gui=NONE guibg=bg guifg=#242424 + CSAHi Error term=reverse cterm=NONE ctermbg=64 ctermfg=79 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi Todo term=NONE cterm=NONE ctermbg=76 ctermfg=83 gui=italic guibg=#ffff00 guifg=#8f8f8f + CSAHi String term=NONE cterm=NONE ctermbg=bg ctermfg=41 gui=italic guibg=bg guifg=#95e454 + CSAHi Number term=NONE cterm=NONE ctermbg=bg ctermfg=53 gui=NONE guibg=bg guifg=#e5786d + CSAHi Function term=NONE cterm=NONE ctermbg=bg ctermfg=57 gui=NONE guibg=bg guifg=#cae682 + CSAHi SpecialKey term=bold cterm=NONE ctermbg=16 ctermfg=83 gui=NONE guibg=#343434 guifg=#808080 + CSAHi NonText term=bold cterm=NONE ctermbg=16 ctermfg=83 gui=NONE guibg=#303030 guifg=#808080 + CSAHi Directory term=bold cterm=NONE ctermbg=bg ctermfg=31 gui=NONE guibg=bg guifg=#00ffff + CSAHi ErrorMsg term=NONE cterm=NONE ctermbg=64 ctermfg=79 gui=NONE guibg=#ff0000 guifg=#ffffff + CSAHi IncSearch term=reverse cterm=NONE ctermbg=79 ctermfg=16 gui=reverse guibg=bg guifg=fg + CSAHi Search term=reverse cterm=NONE ctermbg=76 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi MoreMsg term=bold cterm=bold ctermbg=bg ctermfg=21 gui=bold guibg=bg guifg=#2e8b57 + CSAHi ModeMsg term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi LineNr term=underline cterm=NONE ctermbg=16 ctermfg=37 gui=NONE guibg=#000000 guifg=#857b6f + CSAHi Pmenu term=NONE cterm=NONE ctermbg=16 ctermfg=79 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi PmenuSel term=NONE cterm=NONE ctermbg=57 ctermfg=16 gui=NONE guibg=#cae682 guifg=#000000 + CSAHi PmenuSbar term=NONE cterm=NONE ctermbg=85 ctermfg=fg gui=NONE guibg=#bebebe guifg=fg + CSAHi PmenuThumb term=NONE cterm=NONE ctermbg=79 ctermfg=16 gui=reverse guibg=bg guifg=fg + CSAHi TabLine term=underline cterm=underline ctermbg=84 ctermfg=fg gui=underline guibg=#a9a9a9 guifg=fg + CSAHi TabLineSel term=bold cterm=bold ctermbg=bg ctermfg=fg gui=bold guibg=bg guifg=fg + CSAHi TabLineFill term=reverse cterm=NONE ctermbg=79 ctermfg=16 gui=reverse guibg=bg guifg=fg + CSAHi CursorColumn term=reverse cterm=NONE ctermbg=16 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi CursorLine term=underline cterm=NONE ctermbg=16 ctermfg=fg gui=NONE guibg=#2d2d2d guifg=fg + CSAHi Cursor term=NONE cterm=NONE ctermbg=81 ctermfg=fg gui=NONE guibg=#656565 guifg=fg + CSAHi Keyword term=NONE cterm=NONE ctermbg=bg ctermfg=43 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi Question term=NONE cterm=bold ctermbg=bg ctermfg=28 gui=bold guibg=bg guifg=#00ff00 + CSAHi StatusLine term=reverse,bold cterm=NONE ctermbg=16 ctermfg=79 gui=italic guibg=#444444 guifg=#f6f3e8 + CSAHi StatusLineNC term=reverse cterm=NONE ctermbg=16 ctermfg=37 gui=NONE guibg=#444444 guifg=#857b6f + CSAHi VertSplit term=reverse cterm=NONE ctermbg=16 ctermfg=16 gui=NONE guibg=#444444 guifg=#444444 + CSAHi Title term=bold cterm=bold ctermbg=bg ctermfg=79 gui=bold guibg=bg guifg=#f6f3e8 + CSAHi Visual term=reverse cterm=NONE ctermbg=16 ctermfg=79 gui=NONE guibg=#444444 guifg=#f6f3e8 + CSAHi VisualNOS term=bold,underline cterm=bold,underline ctermbg=bg ctermfg=fg gui=bold,underline guibg=bg guifg=fg + CSAHi WarningMsg term=NONE cterm=NONE ctermbg=bg ctermfg=64 gui=NONE guibg=bg guifg=#ff0000 + CSAHi WildMenu term=NONE cterm=NONE ctermbg=76 ctermfg=16 gui=NONE guibg=#ffff00 guifg=#000000 + CSAHi Folded term=NONE cterm=NONE ctermbg=17 ctermfg=38 gui=NONE guibg=#384048 guifg=#a0a8b0 + CSAHi lCursor term=NONE cterm=NONE ctermbg=79 ctermfg=16 gui=NONE guibg=#f6f3e8 guifg=#242424 + CSAHi MatchParen term=reverse cterm=bold ctermbg=37 ctermfg=79 gui=bold guibg=#857b6f guifg=#f6f3e8 + CSAHi Comment term=bold cterm=NONE ctermbg=bg ctermfg=37 gui=italic guibg=bg guifg=#99968b + CSAHi Constant term=underline cterm=NONE ctermbg=bg ctermfg=53 gui=NONE guibg=bg guifg=#e5786d + CSAHi Special term=bold cterm=NONE ctermbg=bg ctermfg=78 gui=NONE guibg=bg guifg=#e7f6da + CSAHi Identifier term=underline cterm=NONE ctermbg=bg ctermfg=57 gui=NONE guibg=bg guifg=#cae682 + CSAHi Statement term=bold cterm=NONE ctermbg=bg ctermfg=43 gui=NONE guibg=bg guifg=#8ac6f2 + CSAHi PreProc term=underline cterm=NONE ctermbg=bg ctermfg=53 gui=NONE guibg=bg guifg=#e5786d + CSAHi Type term=underline cterm=NONE ctermbg=bg ctermfg=57 gui=NONE guibg=bg guifg=#cae682 + CSAHi FoldColumn term=NONE cterm=NONE ctermbg=85 ctermfg=31 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi DiffAdd term=bold cterm=NONE ctermbg=17 ctermfg=fg gui=NONE guibg=#00008b guifg=fg + CSAHi DiffChange term=bold cterm=NONE ctermbg=33 ctermfg=fg gui=NONE guibg=#8b008b guifg=fg + CSAHi DiffDelete term=bold cterm=bold ctermbg=21 ctermfg=19 gui=bold guibg=#008b8b guifg=#0000ff + CSAHi DiffText term=reverse cterm=bold ctermbg=64 ctermfg=fg gui=bold guibg=#ff0000 guifg=fg + CSAHi SignColumn term=NONE cterm=NONE ctermbg=85 ctermfg=31 gui=NONE guibg=#bebebe guifg=#00ffff + CSAHi SpellBad term=reverse cterm=undercurl ctermbg=bg ctermfg=64 gui=undercurl guibg=bg guifg=fg guisp=#ff0000 + CSAHi SpellCap term=reverse cterm=undercurl ctermbg=bg ctermfg=19 gui=undercurl guibg=bg guifg=fg guisp=#0000ff + CSAHi SpellRare term=reverse cterm=undercurl ctermbg=bg ctermfg=67 gui=undercurl guibg=bg guifg=fg guisp=#ff00ff + CSAHi SpellLocal term=underline cterm=undercurl ctermbg=bg ctermfg=31 gui=undercurl guibg=bg guifg=fg guisp=#00ffff +endif + +delcommand CSAHi diff --git a/vim/colors/zenburn.vim b/vim/colors/zenburn.vim new file mode 100644 index 0000000..a24ea1a --- /dev/null +++ b/vim/colors/zenburn.vim @@ -0,0 +1,299 @@ +" Vim color file +" Maintainer: Jani Nurminen +" Last Change: $Id: zenburn.vim,v 2.4 2008/11/18 20:43:18 slinky Exp $ +" URL: http://slinky.imukuppi.org/zenburnpage/ +" License: GPL +" +" Nothing too fancy, just some alien fruit salad to keep you in the zone. +" This syntax file was designed to be used with dark environments and +" low light situations. Of course, if it works during a daybright office, go +" ahead :) +" +" Owes heavily to other Vim color files! With special mentions +" to "BlackDust", "Camo" and "Desert". +" +" To install, copy to ~/.vim/colors directory. Then :colorscheme zenburn. +" See also :help syntax +" +" Credits: +" - Jani Nurminen - original Zenburn +" - Steve Hall & Cream posse - higher-contrast Visual selection +" - Kurt Maier - 256 color console coloring, low and high contrast toggle, +" bug fixing +" - Charlie - spotted too bright StatusLine in non-high contrast mode +" - Pablo Castellazzi - CursorLine fix for 256 color mode +" - Tim Smith - force dark background +" +" CONFIGURABLE PARAMETERS: +" +" You can use the default (don't set any parameters), or you can +" set some parameters to tweak the Zenburn colours. +" +" * You can now set a darker background for bright environments. To activate, use: +" contrast Zenburn, use: +" +" let g:zenburn_high_Contrast = 1 +" +" * To get more contrast to the Visual selection, use +" +" let g:zenburn_alternate_Visual = 1 +" +" * To use alternate colouring for Error message, use +" +" let g:zenburn_alternate_Error = 1 +" +" * The new default for Include is a duller orange. To use the original +" colouring for Include, use +" +" let g:zenburn_alternate_Include = 1 +" +" * Work-around to a Vim bug, it seems to misinterpret ctermfg and 234 and 237 +" as light values, and sets background to light for some people. If you have +" this problem, use: +" +" let g:zenburn_force_dark_Background = 1 +" +" * To turn the parameter(s) back to defaults, use UNLET: +" +" unlet g:zenburn_alternate_Include +" +" Setting to 0 won't work! +" +" That's it, enjoy! +" +" TODO +" - Visual alternate color is broken? Try GVim >= 7.0.66 if you have trouble +" - IME colouring (CursorIM) + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="zenburn" + +hi Boolean guifg=#dca3a3 +hi Character guifg=#dca3a3 gui=bold +hi Comment guifg=#7f9f7f gui=italic +hi Conditional guifg=#f0dfaf gui=bold +hi Constant guifg=#dca3a3 gui=bold +hi Cursor guifg=#000d18 guibg=#8faf9f gui=bold +hi Debug guifg=#bca3a3 gui=bold +hi Define guifg=#ffcfaf gui=bold +hi Delimiter guifg=#8f8f8f +hi DiffAdd guifg=#709080 guibg=#313c36 gui=bold +hi DiffChange guibg=#333333 +hi DiffDelete guifg=#333333 guibg=#464646 +hi DiffText guifg=#ecbcbc guibg=#41363c gui=bold +hi Directory guifg=#dcdccc gui=bold +hi ErrorMsg guifg=#80d4aa guibg=#2f2f2f gui=bold +hi Exception guifg=#c3bf9f gui=bold +hi Float guifg=#c0bed1 +hi FoldColumn guifg=#93b3a3 guibg=#3f4040 +hi Folded guifg=#93b3a3 guibg=#3f4040 +hi Function guifg=#efef8f +hi Identifier guifg=#efdcbc +hi IncSearch guibg=#f8f893 guifg=#385f38 +hi Keyword guifg=#f0dfaf gui=bold +hi Label guifg=#dfcfaf gui=underline +hi LineNr guifg=#9fafaf guibg=#262626 +hi Macro guifg=#ffcfaf gui=bold +hi ModeMsg guifg=#ffcfaf gui=none +hi MoreMsg guifg=#ffffff gui=bold +hi NonText guifg=#404040 +hi Number guifg=#8cd0d3 +hi Operator guifg=#f0efd0 +hi PreCondit guifg=#dfaf8f gui=bold +hi PreProc guifg=#ffcfaf gui=bold +hi Question guifg=#ffffff gui=bold +hi Repeat guifg=#ffd7a7 gui=bold +hi Search guifg=#ffffe0 guibg=#284f28 +hi SpecialChar guifg=#dca3a3 gui=bold +hi SpecialComment guifg=#82a282 gui=bold +hi Special guifg=#cfbfaf +hi SpecialKey guifg=#9ece9e +hi Statement guifg=#e3ceab gui=none +hi StatusLine guifg=#313633 guibg=#ccdc90 +hi StatusLineNC guifg=#2e3330 guibg=#88b090 +hi StorageClass guifg=#c3bf9f gui=bold +hi String guifg=#cc9393 +hi Structure guifg=#efefaf gui=bold +hi Tag guifg=#e89393 gui=bold +hi Title guifg=#efefef gui=bold +hi Todo guifg=#dfdfdf guibg=bg gui=bold +hi Typedef guifg=#dfe4cf gui=bold +hi Type guifg=#dfdfbf gui=bold +hi Underlined guifg=#dcdccc gui=underline +hi VertSplit guifg=#2e3330 guibg=#688060 +hi VisualNOS guifg=#333333 guibg=#f18c96 gui=bold,underline +hi WarningMsg guifg=#ffffff guibg=#333333 gui=bold +hi WildMenu guibg=#2c302d guifg=#cbecd0 gui=underline + +hi SpellBad guisp=#bc6c4c guifg=#dc8c6c +hi SpellCap guisp=#6c6c9c guifg=#8c8cbc +hi SpellRare guisp=#bc6c9c guifg=#bc8cbc +hi SpellLocal guisp=#7cac7c guifg=#9ccc9c + +" Entering Kurt zone +if &t_Co > 255 + hi Boolean ctermfg=181 + hi Character ctermfg=181 cterm=bold + hi Comment ctermfg=108 + hi Conditional ctermfg=223 cterm=bold + hi Constant ctermfg=181 cterm=bold + hi Cursor ctermfg=233 ctermbg=109 cterm=bold + hi Debug ctermfg=181 cterm=bold + hi Define ctermfg=223 cterm=bold + hi Delimiter ctermfg=245 + hi DiffAdd ctermfg=66 ctermbg=237 cterm=bold + hi DiffChange ctermbg=236 + hi DiffDelete ctermfg=236 ctermbg=238 + hi DiffText ctermfg=217 ctermbg=237 cterm=bold + hi Directory ctermfg=188 cterm=bold + hi ErrorMsg ctermfg=115 ctermbg=236 cterm=bold + hi Exception ctermfg=249 cterm=bold + hi Float ctermfg=251 + hi FoldColumn ctermfg=109 ctermbg=238 + hi Folded ctermfg=109 ctermbg=238 + hi Function ctermfg=228 + hi Identifier ctermfg=223 + hi IncSearch ctermbg=228 ctermfg=238 + hi Keyword ctermfg=223 cterm=bold + hi Label ctermfg=187 cterm=underline + hi LineNr ctermfg=248 ctermbg=235 + hi Macro ctermfg=223 cterm=bold + hi ModeMsg ctermfg=223 cterm=none + hi MoreMsg ctermfg=15 cterm=bold + hi NonText ctermfg=238 + hi Number ctermfg=116 + hi Operator ctermfg=230 + hi PreCondit ctermfg=180 cterm=bold + hi PreProc ctermfg=223 cterm=bold + hi Question ctermfg=15 cterm=bold + hi Repeat ctermfg=223 cterm=bold + hi Search ctermfg=230 ctermbg=236 + hi SpecialChar ctermfg=181 cterm=bold + hi SpecialComment ctermfg=108 cterm=bold + hi Special ctermfg=181 + hi SpecialKey ctermfg=151 + hi Statement ctermfg=187 ctermbg=234 cterm=none + hi StatusLine ctermfg=236 ctermbg=186 + hi StatusLineNC ctermfg=235 ctermbg=108 + hi StorageClass ctermfg=249 cterm=bold + hi String ctermfg=174 + hi Structure ctermfg=229 cterm=bold + hi Tag ctermfg=181 cterm=bold + hi Title ctermfg=7 ctermbg=234 cterm=bold + hi Todo ctermfg=108 ctermbg=234 cterm=bold + hi Typedef ctermfg=253 cterm=bold + hi Type ctermfg=187 cterm=bold + hi Underlined ctermfg=188 ctermbg=234 cterm=bold + hi VertSplit ctermfg=236 ctermbg=65 + hi VisualNOS ctermfg=236 ctermbg=210 cterm=bold + hi WarningMsg ctermfg=15 ctermbg=236 cterm=bold + hi WildMenu ctermbg=236 ctermfg=194 cterm=bold + hi CursorLine ctermbg=236 cterm=none + + " spellchecking, always "bright" background + hi SpellLocal ctermfg=14 ctermbg=237 + hi SpellBad ctermfg=9 ctermbg=237 + hi SpellCap ctermfg=12 ctermbg=237 + hi SpellRare ctermfg=13 ctermbg=237 + + " pmenu + hi PMenu ctermfg=248 ctermbg=0 + hi PMenuSel ctermfg=223 ctermbg=235 + + if exists("g:zenburn_high_Contrast") + hi Normal ctermfg=188 ctermbg=234 + else + hi Normal ctermfg=188 ctermbg=237 + hi Cursor ctermbg=109 + hi diffadd ctermbg=237 + hi diffdelete ctermbg=238 + hi difftext ctermbg=237 + hi errormsg ctermbg=237 + hi foldcolumn ctermbg=238 + hi folded ctermbg=238 + hi incsearch ctermbg=228 + hi linenr ctermbg=238 + hi search ctermbg=238 + hi statement ctermbg=237 + hi statusline ctermbg=144 + hi statuslinenc ctermbg=108 + hi title ctermbg=237 + hi todo ctermbg=237 + hi underlined ctermbg=237 + hi vertsplit ctermbg=65 + hi visualnos ctermbg=210 + hi warningmsg ctermbg=236 + hi wildmenu ctermbg=236 + endif +endif + +if exists("g:zenburn_force_dark_Background") + " Force dark background, because of a bug in VIM: VIM sets background + " automatically during "hi Normal ctermfg=X"; it misinterprets the high + " value (234 or 237 above) as a light color, and wrongly sets background to + " light. See ":help highlight" for details. + set background=dark +endif + +if exists("g:zenburn_high_Contrast") + " use new darker background + hi Normal guifg=#dcdccc guibg=#1f1f1f + hi CursorLine guibg=#121212 gui=bold + hi Pmenu guibg=#242424 guifg=#ccccbc + hi PMenuSel guibg=#353a37 guifg=#ccdc90 gui=bold + hi PmenuSbar guibg=#2e3330 guifg=#000000 + hi PMenuThumb guibg=#a0afa0 guifg=#040404 + hi MatchParen guifg=#f0f0c0 guibg=#383838 gui=bold + hi SignColumn guifg=#9fafaf guibg=#181818 gui=bold + hi TabLineFill guifg=#cfcfaf guibg=#181818 gui=bold + hi TabLineSel guifg=#efefef guibg=#1c1c1b gui=bold + hi TabLine guifg=#b6bf98 guibg=#181818 gui=bold + hi CursorColumn guifg=#dcdccc guibg=#2b2b2b +else + " Original, lighter background + hi Normal guifg=#dcdccc guibg=#3f3f3f + hi CursorLine guibg=#434443 + hi Pmenu guibg=#2c2e2e guifg=#9f9f9f + hi PMenuSel guibg=#242424 guifg=#d0d0a0 gui=bold + hi PmenuSbar guibg=#2e3330 guifg=#000000 + hi PMenuThumb guibg=#a0afa0 guifg=#040404 + hi MatchParen guifg=#b2b2a0 guibg=#2e2e2e gui=bold + hi SignColumn guifg=#9fafaf guibg=#343434 gui=bold + hi TabLineFill guifg=#cfcfaf guibg=#353535 gui=bold + hi TabLineSel guifg=#efefef guibg=#3a3a39 gui=bold + hi TabLine guifg=#b6bf98 guibg=#353535 gui=bold + hi CursorColumn guifg=#dcdccc guibg=#4f4f4f +endif + + +if exists("g:zenburn_alternate_Visual") + " Visual with more contrast, thanks to Steve Hall & Cream posse + " gui=none fixes weird highlight problem in at least GVim 7.0.66, thanks to Kurt Maier + hi Visual guifg=#000000 guibg=#71d3b4 gui=none + hi VisualNOS guifg=#000000 guibg=#71d3b4 gui=none +else + " use default visual + hi Visual guifg=#233323 guibg=#71d3b4 gui=none + hi VisualNOS guifg=#233323 guibg=#71d3b4 gui=none +endif + +if exists("g:zenburn_alternate_Error") + " use a bit different Error + hi Error guifg=#ef9f9f guibg=#201010 gui=bold +else + " default + hi Error guifg=#e37170 guibg=#332323 gui=none +endif + +if exists("g:zenburn_alternate_Include") + " original setting + hi Include guifg=#ffcfaf gui=bold +else + " new, less contrasted one + hi Include guifg=#dfaf8f gui=bold +endif + " TODO check for more obscure syntax groups that they're ok diff --git a/vim/doc/detectindent.txt b/vim/doc/detectindent.txt new file mode 100644 index 0000000..526e695 --- /dev/null +++ b/vim/doc/detectindent.txt @@ -0,0 +1,40 @@ +*detectindent.txt* The Detect Indent Plugin 1.0, Jan 04, 2005 + +Author: Ciaran McCreesh + +============================================================================== +1. Contents *detectindent* *detectindent-contents* + + 1. Contents |detectindent-contents| + 2. :DetectIndent Command |:DetectIndent| + Settings |detectindent-settings| + 3. Uptime ChangeLog |uptime-changelog| + +============================================================================== +2. :DetectIndent Command *:DetectIndent* + + The :DetectIndent command tries to intelligently set the 'shiftwidth', + 'expandtab' and 'tabstop' options based upon the existing settings in + use in the active file. + + Settings *detectindent-settings* + + When the correct value for 'expandtab' cannot be determined, it will + usually retain its existing value. To specify that 'expandtab' should + be used where autodetection is impossible, set: > + :let g:detectindent_preferred_expandtab = 1 +< in your |vimrc| file. + + To set a preferred value for 'shiftwidth' and 'tabstop' when they + cannot be automatically detected, set: > + :let g:detectindent_preferred_indent = 4 +< in your |vimrc| file. + +============================================================================== +3. DetectIndent ChangeLog *detectindent-changelog* + + v1.0 (20050105) + * initial release after discussion on irc.freenode.net:#vim + +============================================================================== +vim:tw=78:ts=8:ft=help diff --git a/vim/plugin/detectindent.vim b/vim/plugin/detectindent.vim new file mode 100644 index 0000000..266cb2e --- /dev/null +++ b/vim/plugin/detectindent.vim @@ -0,0 +1,135 @@ +" Name: detectindent (global plugin) +" Version: 1.0 +" Author: Ciaran McCreesh +" Updates: http://dev.gentoo.org/~ciaranm/vim/ +" Purpose: Detect file indent settings +" +" License: You may redistribute this plugin under the same terms as Vim +" itself. +" +" Usage: :DetectIndent +" +" " to prefer expandtab to noexpandtab when detection is +" " impossible: +" :let g:detectindent_preferred_expandtab = 1 +" +" " to set a preferred indent level when detection is +" " impossible: +" :let g:detectindent_preferred_indent = 4 +" +" Requirements: Untested on Vim versions below 6.2 + +fun! IsCommentStart(line) + " &comments isn't reliable + if &ft == "c" || &ft == "cpp" || &ft == "java" || &ft == "scala" + return -1 != match(a:line, '/\*') + elseif &ft == "perl" " catch POD in Perl + return -1 != match(a:line, '^=\w') + else + return 0 + endif +endfun + +fun! IsCommentEnd(line) + if &ft == "c" || &ft == "cpp" || &ft == "java" || &ft == "scala" + return -1 != match(a:line, '\*/') + elseif &ft == "perl" " catch POD + return -1 != match(a:line, '^=cut') + else + return 0 + endif +endfun + +fun! DetectIndent() + let l:has_leading_tabs = 0 + let l:has_leading_spaces = 0 + let l:shortest_leading_spaces_run = 0 + let l:longest_leading_spaces_run = 0 + + let l:idx_end = line("$") + let l:idx = 1 + while l:idx <= l:idx_end + let l:line = getline(l:idx) + + " try to skip over comment blocks, they can give really screwy indent + " settings in c/c++ files especially + if IsCommentStart(l:line) + while l:idx <= l:idx_end && ! IsCommentEnd(l:line) + let l:line = getline(l:idx) + let l:idx = l:idx + 1 + endwhile + let l:idx = l:idx + 1 + continue + endif + + let l:leading_char = strpart(l:line, 0, 1) + + if l:leading_char == "\t" + let l:has_leading_tabs = 1 + + elseif l:leading_char == " " + " only interested if we don't have a run of spaces followed by a + " tab. + if -1 == match(l:line, '^ \+\t') + let l:has_leading_spaces = 1 + let l:spaces = strlen(matchstr(l:line, '^ \+')) + if l:shortest_leading_spaces_run == 0 || + \ l:spaces < l:shortest_leading_spaces_run + let l:shortest_leading_spaces_run = l:spaces + endif + if l:spaces > l:longest_leading_spaces_run + let l:longest_leading_spaces_run = l:spaces + endif + endif + + endif + + let l:idx = l:idx + 1 + endwhile + + if l:has_leading_tabs && ! l:has_leading_spaces + " tabs only, no spaces + set noexpandtab + if exists("g:detectindent_preferred_tabsize") + let &shiftwidth = g:detectindent_preferred_indent + let &tabstop = g:detectindent_preferred_indent + endif + + elseif l:has_leading_spaces && ! l:has_leading_tabs + " spaces only, no tabs + set expandtab + let &shiftwidth = l:shortest_leading_spaces_run + let &softtabstop = l:shortest_leading_spaces_run + + elseif l:has_leading_spaces && l:has_leading_tabs + " spaces and tabs + set noexpandtab + let &shiftwidth = l:shortest_leading_spaces_run + + " mmmm, time to guess how big tabs are + if l:longest_leading_spaces_run < 2 + let &tabstop = 2 + elseif l:longest_leading_spaces_run < 4 + let &tabstop = 4 + else + let &tabstop = 8 + endif + + else + " no spaces, no tabs + if exists("g:detectindent_preferred_tabsize") + let &shiftwidth = g:detectindent_preferred_indent + let &tabstop = g:detectindent_preferred_indent + endif + if exists("g:detectindent_preferred_expandtab") + set expandtab + if exists("g:detectindent_preferred_tabsize") + let &softtabstop = l:shortest_leading_spaces_run + endif + endif + + endif +endfun + +command! -nargs=0 DetectIndent call DetectIndent() + diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..7033707 --- /dev/null +++ b/vimrc @@ -0,0 +1,288 @@ +" vimrc +" Main, Original author: Saleem Abdulrasool +" Trivial modifications: David Majnemer +" vim: set ts=3 sw=3 et nowrap: + +if has ('multi_byte') " Make sure we have unicode support + scriptencoding utf-8 " This file is in UTF-8 + + " ---- Terminal Setup ---- + if (&termencoding == "" && (&term =~ "xterm" || &term =~ "putty")) || (&term =~ "rxvt-unicode") + set termencoding=utf-8 + endif + set encoding=utf-8 " Default encoding should always be UTF-8 +endif + +" ---- General Setup ---- +set nocompatible " Don't emulate vi's limitations +set tabstop=4 " 4 spaces for tabs +set shiftwidth=4 " 4 spaces for indents +set smarttab " Tab next line based on current line +"set expandtab " Spaces for indentation +set autoindent " Automatically indent next line +set smartindent " Indent next line based on current line +"set linebreak " Display long lines wrapped at word boundaries +set incsearch " Enable incremental searching +set hlsearch " Highlight search matches +set ignorecase " Ignore case when searching +set infercase " Attempt to figure out the correct case +set showfulltag " Show full tags when doing completion +set virtualedit=block " Only allow virtual editing in block mode +set lazyredraw " Lazy Redraw (faster macro execution) +set wildmenu " Menu on completion please +set wildmode=longest,full " Match the longest substring, complete with first +set wildignore=*.o,*~ " Ignore temp files in wildmenu +set scrolloff=3 " Show 3 lines of context during scrolls +set sidescrolloff=2 " Show 2 columns of context during scrolls +set backspace=2 " Normal backspace behavior +"set textwidth=80 " Break lines at 80 characters +set hidden " Allow flipping of buffers without saving +set noerrorbells " Disable error bells +set visualbell " Turn visual bell on +set t_vb= " Make the visual bell emit nothing +set showcmd " Show the current command + +set diffopt+=iwhite + +" ---- Filetypes ---- +if has('syntax') + syntax on +endif + +if has('osfiletype') + filetype on " Detect filetype by extension + filetype indent on " Enable indents based on extensions + filetype plugin on " Load filetype plugins +endif + +" ---- Folding ---- +if has('eval') + fun! WideFold() + if winwidth(0) > 90 + setlocal foldcolumn=1 + else + setlocal foldcolumn=0 + endif + endfun + + let g:detectindent_preferred_expandtab = 0 + let g:detectindent_preferred_indent = 4 + + fun! DetectDetectIndent() + try + :DetectIndent + catch + endtry + endfun +endif + +if has('autocmd') + autocmd BufEnter * :call WideFold() + if has('eval') + autocmd BufReadPost * :call s:DetectDetectIndent() + endif + + autocmd BufReadPost * + \ if line("'\"") > 0 && line("'\"") <= line("$") | + \ exe "normal g`\"" | + \ endif +endif + +" ---- Spelling ---- +if (v:version >= 700) + set spelllang=en_us " US English Spelling please + + " Toggle spellchecking with F10 + nmap :silent set spell! + imap :silent set spell! +endif + +" Always display a pretty statusline +set title +set laststatus=2 +set shortmess=atI +set statusline=Editing:\ %r%t%m\ %=Location:\ Line\ %l/%L\ \ Col:\ %c\ (%p%%) + +" Enable modelines only on secure vim +if (v:version == 603 && has("patch045")) || (v:version > 603) + set modeline +else + set nomodeline +endif + +" Shamelessly stolen from Ciaran McCreesh +if has('eval') + fun! LoadColorScheme(schemes) + let l:schemes = a:schemes . ":" + + while l:schemes != "" + let l:scheme = strpart(l:schemes, 0, stridx(l:schemes, ":")) + let l:schemes = strpart(l:schemes, stridx(l:schemes, ":") + 1) + + try + exec "colorscheme" l:scheme + break + catch + endtry + endwhile + endfun + + if has("gui_running") + call LoadColorScheme("wombat:desert") + elseif &t_Co == 256 + call LoadColorScheme("wombat:inkpot") + elseif &t_Co == 88 + call LoadColorScheme("wombat:zellner") + else + call LoadColorScheme("zellner") + endif +endif + +" Show trailing whitespace visually +" Shamelessly stolen from Ciaran McCreesh +if (&termencoding == "utf-8") || has("gui_running") + if v:version >= 700 + set list listchars=tab:»·,trail:·,extends:…,nbsp:‗ + else + set list listchars=tab:»·,trail:·,extends:… + endif +else + if v:version >= 700 + set list listchars=tab:>-,trail:.,extends:>,nbsp:_ + else + set list listchars=tab:>-,trail:.,extends:> + endif +endif + +if has('mouse') + " Dont copy the listchars when copying + set mouse=nvi +endif + +if has('autocmd') + " always refresh syntax from the start + autocmd BufEnter * syntax sync fromstart + + " subversion commit messages need not be backed up + autocmd BufRead svn-commit.tmp :setlocal nobackup + + " mutt does not like UTF-8 + autocmd BufRead,BufNewFile * + \ if &ft == 'mail' | set fileencoding=iso8859-1 | endif + + " fix up procmail rule detection + autocmd BufRead procmailrc :setfiletype procmail +endif + +" ---- cscope/ctags setup ---- +if has('cscope') && executable('cscope') == 1 + " Search cscope and ctags, in that order + set cscopetag + set cscopetagorder=0 + + set nocsverb + if filereadable('cscope.out') + cs add cscope.out + endif + set csverb +endif + +" ---- Key Mappings ---- + +" improved lookup +if has('eval') + fun! GoDefinition() + let pos = getpos(".") + normal! gd + if getpos(".") == pos + exe "tag " . expand("") + endif + endfun +endif + +nmap :call GoDefinition() + +if has('autocmd') + " Shortcuts + if has('eval') + fun! cabbrev() + iab #i #include + iab #I #include + + iab #d #define + iab #D #define + + iab #e #endif + iab #E #endif + endfun + + autocmd FileType c,cpp :call cabbrev() + endif + + " make tab reindent in normal mode + autocmd FileType c,cpp,cs,java nmap =0 +endif + +" tab indents selection +vmap >gv + +" shift-tab unindents +vmap + +" shifted arrows are stupid +inoremap gk +noremap gk +inoremap gj +noremap gj + +" Y should yank to EOL +map Y y$ + +" vK is stupid +vmap K k + +" :W and :Q are annoying +command! -nargs=0 -bang X x +command! -nargs=0 -bang Q q +command! -nargs=0 -bang W w +command! -nargs=0 -bang WQ wq +command! -nargs=0 -bang Wq wq + +" just continue +nmap K K + +" Toggle numbers with F12 +nmap :silent set number! +imap :silent set number! +noremap :set hls! + +" Don't force column 0 for # +inoremap # X# + +" 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! + map  + map  +elseif (&term =~ "^sun") + map + map! +elseif (&term !~ "cons") + map + map! +endif + +" Python specific stuff +if has('eval') + let python_highlight_all = 1 + let python_slow_sync = 1 +endif diff --git a/xmobarrc b/xmobarrc new file mode 100644 index 0000000..7727e77 --- /dev/null +++ b/xmobarrc @@ -0,0 +1,17 @@ +Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" + , bgColor = "black" + , fgColor = "grey" + , position = Top + , lowerOnStart = True + , commands = [ Run Network "eth0" ["-L","0","-H","32","--normal","green","--high","red"] 10 + , Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10 + , Run Memory ["-t","Mem: %"] 10 + , Run Swap [] 10 + , Run Com "uname" ["-s","-r"] "" 36000 + , Run Date "%a %b %_d %Y %H:%M:%S" "date" 10 + , Run StdinReader + ] + , sepChar = "%" + , alignSep = "}{" + , template = "%StdinReader% | %cpu% | %memory% * %swap% | %eth0% }{ %date% | %uname%" + } diff --git a/xmonad.hs b/xmonad.hs new file mode 100644 index 0000000..fc0afad --- /dev/null +++ b/xmonad.hs @@ -0,0 +1,45 @@ +import XMonad + +import XMonad.Layout.Grid +import XMonad.Layout.NoBorders(smartBorders) + +import XMonad.Hooks.DynamicLog +import XMonad.Hooks.ManageDocks + +import XMonad.Util.Run(spawnPipe) +import XMonad.Util.EZConfig(additionalKeysP) + +import XMonad.Prompt +import XMonad.Prompt.Shell(shellPrompt) + +import System.IO(hPutStrLn) + +myLayoutHook = tiled ||| Mirror tiled ||| Grid ||| Full + where + -- default tiling algorithm partitions the screen into two panes + tiled = Tall nmaster delta ratio + + -- The default number of windows in the master pane + nmaster = 1 + + -- Default proportion of screen occupied by master pane + ratio = 1/2 + + -- Percent of screen to increment by when resizing panes + delta = 3/100 + +main = do + xmproc <- spawnPipe "xmobar" + xmonad $ defaultConfig + { manageHook = manageDocks <+> manageHook defaultConfig + , layoutHook = avoidStruts $ smartBorders $ myLayoutHook + , logHook = dynamicLogWithPP $ xmobarPP + { ppOutput = hPutStrLn xmproc + , ppTitle = xmobarColor "green" "" + } + } + `additionalKeysP` + [ ("M-p", shellPrompt defaultXPConfig { position = Top }) + , ("M-b", sendMessage ToggleStruts) + , ("M-S-l", spawn "~/bin/lock") + ] diff --git a/zsh/.gitignore b/zsh/.gitignore new file mode 100644 index 0000000..90e71a2 --- /dev/null +++ b/zsh/.gitignore @@ -0,0 +1,3 @@ +.history* +.zcompdump* +.*-cache diff --git a/zsh/00_options b/zsh/00_options new file mode 100755 index 0000000..f5b1bae --- /dev/null +++ b/zsh/00_options @@ -0,0 +1,43 @@ +# only alphanumeric chars for moving around +WORDCHARS='' + +# disable core dumps +limit coredumpsize 0 + +# clear on exit +trap clear 0 + +# shell options +setopt AUTO_CD # directoy command does cd +setopt CORRECT # correct spelling of commands +setopt AUTO_PUSHD # cd uses directory stack +setopt CHASE_DOTS # resolve .. in cd +setopt CHASE_LINKS # resolve symbolic links in cd +setopt CDABLE_VARS # cd var works if $var is a directory +setopt PUSHD_SILENT # make pushd quiet +setopt ALWAYS_TO_END # goto end of word on completion +setopt EXTENDED_GLOB # use zsh globbing extensions +setopt SH_WORD_SPLIT # split non-array variables +setopt BASH_AUTO_LIST # list completions on second tab +setopt LIST_ROWS_FIRST # list completions across +setopt COMPLETE_IN_WORD # completion works inside words +setopt MAGIC_EQUAL_SUBST # special expansion after all = + +unsetopt BEEP # stop beeping! +unsetopt LIST_BEEP # seriously, stop beeping! + +unsetopt NO_MATCH # dont error on no glob matches + +# history +export HISTSIZE=1000 +export SAVEHIST=1000 +export HISTFILE="${HOME}/.zsh/.history" + +setopt SHARE_HISTORY +setopt HIST_IGNORE_SPACE +setopt HIST_REDUCE_BLANKS +setopt INC_APPEND_HISTORY +setopt HIST_IGNORE_ALL_DUPS + +unsetopt HIST_BEEP +unsetopt EXTENDED_HISTORY diff --git a/zsh/alias b/zsh/alias new file mode 100755 index 0000000..edf2379 --- /dev/null +++ b/zsh/alias @@ -0,0 +1,6 @@ +alias cp='nocorrect cp' +alias mv='nocorrect mv' +alias rm='nocorrect rm -ir' +alias mkdir='nocorrect mkdir' +alias :q='exit' +alias :wq='exit' diff --git a/zsh/bindkey b/zsh/bindkey new file mode 100755 index 0000000..7edaea5 --- /dev/null +++ b/zsh/bindkey @@ -0,0 +1,74 @@ +# keybindings +bindkey -d +bindkey -e + +bindkey ' ' magic-space + +bindkey -M emacs '\ee' edit-command-line + +case $TERM in + screen|xterm*|putty*) + 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 + ;; + mlterm|kterm) + bindkey '\e[H' beginning-of-line + bindkey '\e[F' end-of-line + 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|vt100) + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + bindkey '\e[3~' delete-char + ;; + *rxvt*|Eterm|aterm) + 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 '\e[H' beginning-of-line + bindkey '\e[U' end-of-line + bindkey '^?' delete-char + ;; + sun*) + bindkey '\e[214z' beginning-of-line + bindkey '\e[220z' end-of-line + bindkey '^?' delete-char + ;; + cygwin*) + bindkey '\e[1~' beginning-of-line + bindkey '\e[4~' end-of-line + ;; +esac + diff --git a/zsh/completion b/zsh/completion new file mode 100755 index 0000000..4e49a82 --- /dev/null +++ b/zsh/completion @@ -0,0 +1,114 @@ +# completion menu +zstyle ':completion:*' menu select=1 + +# change the order up +zstyle ':completion:*:(cd|mv|cp):*' tag-order local-directories directory-stack named-directories path-directories + +# man page completion +zstyle ':completion:*:manuals' separate-sections true +zstyle ':completion:*:manuals.*' insert-sections true + +# neat-o new features +zstyle ':completion:*' completer _expand _complete _prefix _correct _match _approximate + +# don't complete commands that we do not have +zstyle ':completion:*:functions' ignored-patterns '_*' + +# group matches +zstyle ':completion:*' group-name '' +zstyle ':completion:*:matches' group 'yes' + +# colors on completions +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" + +# users are all useless, ignore them always +zstyle -e ':completion:*' users "reply=( root '${USERNAME}' )" + +# caching good +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path "${HOME}/.zsh/.${HOST}-cache" + +# descriptions +zstyle ':completion:*:messages' format $'%{\e[01;35m%} -- %d -- %{\e[00;00m%}' +zstyle ':completion:*:warnings' format $'%{\e[01;31m%} -- No Matches Found -- %{\e[00;00m%}' +zstyle ':completion:*:descriptions' format $'%{\e[01;33m%} -- %d -- %{\e[00;00m%}' + +# job numbers +zstyle ':completion:*:jobs' numbers true + +# kill/killall menu and general process listing +zstyle ':completion:*:*:kill:*' menu yes select +zstyle ':completion:*:*:kill:*' sort false +zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=31;31' + +zstyle ':completion:*:*:killall:*' menu yes select + +case `uname -s` in + Linux) + zstyle ':completion:*:processes-names' command 'ps -e --no-headers -o args' + ;; + FreeBSD|Interix|OpenBSD|SunOS) + zstyle ':completion:*:processes-names' command 'ps -e -o args | awk "NR != 1"' + ;; + Darwin) + if [[ `sw_vers -productVersion` = 10<5->.<-> ]] ; then + zstyle ':completion:*:processes-names' command 'ps -e -o command | awk "NR != 1"' + else + zstyle ':completion:*:processes-names' command 'ps -A -o command | awk "NR != 1"' + fi + ;; + CYGWIN*) + zstyle ':completion:*:processes-names' command 'ps -e -s | awk "NR != 1"' + ;; +esac + +case `uname -s` in + Linux) + zstyle ':completion:*:*:kill:*:processes' command 'ps --forest -U '${USERNAME}' -o pid,args | sed "/ps --forest -U '${USERNAME}' -o pid,args/d"' + ;; + Interix) + zstyle ':completion:*:*:kill:*:processes' command 'ps -i -U '${USERNAME}' -o pid,args | sed "/ps -i -U '${USERNAME}' -o pid,args/d"' + ;; + CYGWIN*) + zstyle ':completion:*:*:kill:*:processes' command 'ps -u '${USERNAME}' -s | sed "/ps -u '${USERNAME}' -s/d"' + ;; + SunOS|FreeBSD|OpenBSD) + 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/d"' + ;; +esac + +case `uname -s` in + Interix|SunOS|FreeBSD|Linux) + zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o comm" + ;; + CYGWIN*) + zstyle ':completion:*:*:killall:*:processes-names' command "ps -u '${USERNAME}' -s" + ;; + Darwin) + if [[ `sw_vers -productVersion` = 10<5->.<-> ]] ; then + zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o comm" + else + zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o command" + fi + ;; + OpenBSD) + zstyle ':completion:*:*:killall:*:processes-names' command "ps -U '${USERNAME}' -o command" + ;; +esac + +# case insensitivity, partial matching, substitution +zstyle ':completion:*' matcher-list 'm:{A-Z}={a-z}' 'm:{a-z}={A-Z}' 'r:|[-._]=* r:|=*' 'l:|=* r:|=*' '+l:|=*' + +# compctl should die +zstyle ':completion:*' use-compctl false + +# dont suggest the first parameter again +zstyle ':completion:*:ls:*' ignore-line yes +zstyle ':completion:*:rm:*' ignore-line yes +zstyle ':completion:*:scp:*' ignore-line yes +zstyle ':completion:*:diff:*' ignore-line yes +zstyle ':completion:*:kill:*' ignore-line yes + diff --git a/zsh/intel b/zsh/intel new file mode 100755 index 0000000..695e382 --- /dev/null +++ b/zsh/intel @@ -0,0 +1,78 @@ +local iccvars_path; +if [ -d "/opt/intel/Compiler" ] ; then + iccvars_path=$(echo /opt/intel/Compiler/11.*/*/bin/iccvars.sh(On[1])) + if [ -r $iccvars_path ] ; then + case `uname -m` in + x86_64) + . $iccvars_path intel64 + ;; + i*86) + . $iccvars_path ia32 + ;; + ia64) + . $iccvars_path ia64 + ;; + esac + fi +elif [ -d "/opt/intel" ] ; then + if [ -d "/opt/intel/cc" ] || [ -d "/opt/intel/cce" ] ; then + iccvars_path=$(echo /opt/intel/cc*/(10|9).*/bin/iccvars.sh(On[1])) + if [ -r $iccvars_path ] ; then + . $iccvars_path + fi + fi + if [ -d "/opt/intel/idb" ] || [ -d "/opt/intel/idbe" ] ; then + idbvars_path=$(echo /opt/intel/idb*/(10|9).*/bin/idbvars.sh(On[1])) + if [ -r $idbvars_path ] ; then + . $idbvars_path + fi + fi + if [ -d "/opt/intel/mkl" ] ; then + local mklvars_path; + for mkl_path in /opt/intel/mkl/* ; do + case `uname -m` in + ia64) + if [ -f "${mkl_paths}/tools/environment/mklvars64.sh" ] ; then + mklvars_path="${mkl_paths}/tools/environment/mklvars64.sh" + fi + ;; + i*86|x86_64) + if [ `uname -m` = "x86_64" ] && [ -f "${mkl_path}/tools/environment/mklvarsem64t.sh" ] ; then + mklvars_path="${mkl_path}/tools/environment/mklvarsem64t.sh" + elif [ -f "${mkl_path}/tools/environment/mklvars32.sh" ] ; then + mklvars_path="${mkl_path}/tools/environment/mklvars32.sh" + fi + ;; + esac + done + if [ -n "${mklvars_path}" ] ; then + . $mklvars_path + fi + fi + if [ -d "/opt/intel/ipp" ] ; then + local ippvars_path; + for ipp_paths in /opt/intel/ipp/* ; do + case `uname -m` in + ia64) + if [ -d "${ipp_paths}/ia64" ] ; then + ippvars_path="${ipp_paths}/ia64/tools/env/ippvarsia64.sh" + fi + ;; + i*86|x86_64) + if [ `uname -m` = "x86_64" ] && [ -d "${ipp_paths}/em64t" ] ; then + ippvars_path="${ipp_paths}/em64t/tools/env/ippvarsem64t.sh" + elif [ -d "${ipp_paths}/ia32" ] ; then + ippvars_path="${ipp_paths}/ia32/tools/env/ippvarsia32.sh" + fi + ;; + esac + done + if [ -n "${ippvars_path}" ] ; then + . $ippvars_path + fi + fi +fi + +if [ -f "/opt/intel/vtune/bin/vtunevars.sh" ] ; then + . /opt/intel/vtune/bin/vtunevars.sh +fi diff --git a/zsh/prompt b/zsh/prompt new file mode 100755 index 0000000..ffd604b --- /dev/null +++ b/zsh/prompt @@ -0,0 +1,9 @@ +# prompt +if [ -z "${SSH_TTY}" ] ; then + PROMPT=$'%{\e[00;00m%}%{\e[01;32m%}%n@%m %{\e[01;34m%}%~ %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}' + RPROMPT=$'%{\e[00;00m%}%1(j.%{\e[00;36m%}[%j].)%{\e[01;33m%}[%t]%{\e[00;00m%}' +else + PROMPT=$'%{\e[00;00m%}%{\e[01;36m%}%n %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}' + RPROMPT=$'%{\e[00;00m%}%{\e[01;33m%}%m %{\e[01;32m%}%~%{\e[00;00m%}' +fi + diff --git a/zsh/title b/zsh/title new file mode 100755 index 0000000..9f2e9d2 --- /dev/null +++ b/zsh/title @@ -0,0 +1,78 @@ +# terminal titles +precmd() +{ + local termtitle + + termtitle=`print -P "%n@%m"` + title zsh "$termtitle" +} + +preexec() +{ + # With bits from http://zshwiki.org/home/examples/hardstatus + # emulate -L zsh + local -a cmd; cmd=(${(z)1}) # Re-parse the command line + local termtitle + + # Prepend this string to the title. + termtitle=`print -P "%n@%m:"` + + case $cmd[1] in + fg) + if (( $#cmd == 1 )); then + # No arguments, must find the current job + # Old approach: cmd=(builtin jobs -l %+) + # weakness: shows a load of bs + title ${jobtexts[${(k)jobstates[(R)*+*]}]%% *} "$termtitle ${jobtexts[${(k)jobstates[(R)*+*]}]}" + elif (( $#cmd == 2 )); then + # Replace the command name, ignore extra args. + # Old approach: cmd=(builtin jobs -l ${(Q)cmd[2]}) + # weakness: shows all matching jobs on the title, not just one + title "${jobtexts[${cmd[2]#%}]%% *}" "$termtitle $jobtexts[${cmd[2]#%}]" + else + title "${cmd[2,-1]#%}" "$termtitle ${cmd[2,-1]#%}" + fi + ;; + %*) + title "${jobtexts[${cmd[1]#%}]% *}" "$termtitle $jobtexts[${cmd[1]#%}]" + ;; + *=*) + shift cmd + ;& + exec|sudo) + shift cmd + # If the command is 'exec', drop that, because + # we'd rather just see the command that is being + # exec'd. Note the ;& to fall through the next entry. + ;& + *) + title $cmd[1]:t "$termtitle $cmd[*]" # Starting a new job. + ;; + esac +} + +function title +{ + case $TERM in + screen*) + # Use this for GNU Screen: + print -nR $'\ek'$2$'\e'"\\" + ;; + interix) + # Use this for interix as "2" makes it upset + shift + print -nR $'\e]0;'$@$'\a' + ;; + xterm*|*rxvt*|cygwin|Eterm|mlterm|kterm|aterm|putty*) + if [ "${STY}" ] ; then + print -nR $'\ek'$2$'\e'"\\" + else + # Use this one instead for everybody else: + shift + print -nR $'\e]1;'$@$'\a' + print -nR $'\e]2;'$@$'\a' + fi + ;; + esac +} + diff --git a/zsh/utility b/zsh/utility new file mode 100755 index 0000000..efba731 --- /dev/null +++ b/zsh/utility @@ -0,0 +1,6 @@ +# utility.sh +# Miscellaneous Utility Functions + +zstyle ':completion:*:*:extract:*' file-patterns '*.(tar|tar.gz|tgz|tar.Z|tar.bz2|tbz2|zip|ZIP|jar|gz|Z|z|bz2|rar|RAR|LHa|LHA|lha|lzh|a|deb|tar.lzma|lzma|7z):Compressed\ Files *(-/):directories' + +# vim: set ft=sh ts=3 sw=3 et: diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..88a21a0 --- /dev/null +++ b/zshrc @@ -0,0 +1,49 @@ +# .zshrc +# Original, Main author: Saleem Abdulrasool +# Trivial modifications: David Majnemer +# vim:set nowrap: + +autoload compinit; compinit -d "${HOME}/.zsh/.zcompdump" + +autoload age +autoload zmv + +if [ ${ZSH_VERSION//.} -gt 420 ] ; then + autoload -U url-quote-magic + zle -N self-insert url-quote-magic +fi + +autoload -U edit-command-line +zle -N edit-command-line + +# Keep track of other people accessing the box +watch=( all ) +export LOGCHECK=30 +export WATCHFMT=$'\e[00;00m\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m' + +# directory hashes +if [ -d "${HOME}/sandbox" ] ; then + hash -d sandbox="${HOME}/sandbox" +fi + +if [ -d "${HOME}/work" ] ; then + hash -d work="${HOME}/work" + + for dir in "${HOME}"/work/*(N-/) ; do + hash -d $(basename "${dir}")="${dir}" + done +fi + +# common shell utils +if [ -d "${HOME}/.commonsh" ] ; then + for file in "${HOME}"/.commonsh/*(N.x:t) ; do + . "${HOME}/.commonsh/${file}" + done +fi + +# extras +if [ -d "${HOME}/.zsh" ] ; then + for file in "${HOME}"/.zsh/*(N.x:t) ; do + . "${HOME}/.zsh/${file}" + done +fi