Browse Source

Initial import from tre (bashrc from foor)

raylu 14 years ago
commit
cbfd69a84f
17 changed files with 1970 additions and 0 deletions
  1. 9 0
      astylerc
  2. 129 0
      bashrc
  3. 194 0
      dircolors
  4. 35 0
      gitconfig
  5. 10 0
      pentadactylrc
  6. 222 0
      vim/doc/surround.txt
  7. 1 0
      vim/ftdetect/gofiletype.vim
  8. 2 0
      vim/ftdetect/markdown.vim
  9. 63 0
      vim/indent/go.vim
  10. 165 0
      vim/plugin/cscope_maps.vim
  11. 625 0
      vim/plugin/surround.vim
  12. 2 0
      vim/spell/en.utf-8.add
  13. 265 0
      vim/syntax/glsl.vim
  14. 1 0
      vim/syntax/go.vim
  15. 104 0
      vim/syntax/markdown.vim
  16. 45 0
      vimrc
  17. 98 0
      zshrc

+ 9 - 0
astylerc

@@ -0,0 +1,9 @@
+indent=tab
+brackets=attach
+pad-header
+unpad-paren
+keep-one-line-statements
+convert-tabs
+align-pointer=name
+suffix=none #do not retain original file
+lineend=linux

+ 129 - 0
bashrc

@@ -0,0 +1,129 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
+# for examples
+
+# If not running interactively, don't do anything
+[ -z "$PS1" ] && return
+
+# 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
+
+# make less more friendly for non-text input files, see lesspipe(1)
+#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
+
+# set variable identifying the chroot you work in (used in the prompt below)
+if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
+    debian_chroot=$(cat /etc/debian_chroot)
+fi
+
+# set a fancy prompt (non-color, unless we know we "want" color)
+case "$TERM" in
+    xterm-color) color_prompt=yes;;
+esac
+
+# uncomment for a colored prompt, if the terminal has the capability; turned
+# off by default to not distract the user: the focus in a terminal window
+# should be on the output of commands, not on the prompt
+#force_color_prompt=yes
+
+#if [ -n "$force_color_prompt" ]; then
+#    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
+	# We have color support; assume it's compliant with Ecma-48
+	# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
+	# a case would tend to support setf rather than setaf.)
+#	color_prompt=yes
+#    else
+#	color_prompt=
+#    fi
+#fi
+
+#if [ "$color_prompt" = yes ]; then
+#    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
+#else
+#    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
+#fi
+#unset color_prompt force_color_prompt
+
+# If this is an xterm set the title to user@host:dir
+#case "$TERM" in
+#xterm*|rxvt*)
+#    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
+#    ;;
+#*)
+#    ;;
+#esac
+
+COLOR_RED="\[\e[0;31m\]"
+COLOR_GREEN="\[\e[0;32m\]"
+COLOR_YELLOW="\[\e[0;33m\]"
+COLOR_BLUE="\[\e[0;34m\]"
+COLOR_MAGENTA="\[\e[0;35m\]"
+COLOR_CYAN="\[\e[0;36m\]"
+
+COLOR_RED_BOLD="\[\e[31;1m\]"
+COLOR_GREEN_BOLD="\[\e[32;1m\]"
+COLOR_YELLOW_BOLD="\[\e[33;1m\]"
+COLOR_BLUE_BOLD="\[\e[34;1m\]"
+COLOR_MAGENTA_BOLD="\[\e[35;1m\]"
+COLOR_CYAN_BOLD="\[\e[36;1m\]"
+
+COLOR_NONE="\[\e[0m\]"
+
+export PS1="${COLOR_GREEN_BOLD}\h${COLOR_NONE}:${COLOR_BLUE_BOLD}\w${COLOR_NONE}\$ "
+
+# Alias definitions.
+# You may want to put all your additions into a separate file like
+# ~/.bash_aliases, instead of adding them here directly.
+# See /usr/share/doc/bash-doc/examples in the bash-doc package.
+
+#if [ -f ~/.bash_aliases ]; then
+#    . ~/.bash_aliases
+#fi
+
+# enable color support of ls and also add handy aliases
+if [ -x /usr/bin/dircolors ]; then
+    eval "`dircolors -b`"
+fi
+alias ls='ls --color=auto -hv'
+alias ll='ls -l'
+alias la='ls -A'
+alias l.='ls -d .*'
+alias df='df -hx tmpfs'
+alias du='du -h --max-depth=1'
+function cl () {
+    if [ $# = 0 ]; then
+        cd && ls
+    else
+        cd "$*" && ls
+    fi
+}
+alias sr='screen -r'
+alias grep='grep --color=auto'
+alias fgrep='fgrep --color=auto'
+alias egrep='egrep --color=auto'
+
+# enable programmable completion features (you don't need to enable
+# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
+# sources /etc/bash.bashrc).
+if [ -f /etc/bash_completion ]; then
+    . /etc/bash_completion
+fi
+
+export LESS_TERMCAP_mb=$'\E[01;31m'
+export LESS_TERMCAP_md=$'\E[01;31m'
+export LESS_TERMCAP_me=$'\E[0m'
+export LESS_TERMCAP_se=$'\E[0m'                           
+export LESS_TERMCAP_so=$'\E[01;44;33m'                                 
+export LESS_TERMCAP_ue=$'\E[0m'
+export LESS_TERMCAP_us=$'\E[01;32m'
+
+export EDITOR=vim

+ 194 - 0
dircolors

@@ -0,0 +1,194 @@
+# 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-2010 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-256color
+TERM rxvt-cygwin
+TERM rxvt-cygwin-native
+TERM rxvt-unicode
+TERM rxvt-unicode256
+TERM screen
+TERM screen-256color
+TERM screen-256color-bce
+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 # no color code at all
+#FILE 00 # regular file: use no color at all
+RESET 0 # reset to "normal" color
+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.)
+MULTIHARDLINK 00 # regular file with more than one link
+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)
+CAPABILITY 30;41 # file with capability
+STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w)
+OTHER_WRITABLE 34 # dir that is other-writable (o+w) and not sticky
+STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable
+# This is for files with execute permission:
+EXEC 01;32
+# List any file extensions like '.gz' or '.tar' that you would like ls
+# to colorize below. Put the extension, a space, and the color init string.
+# (and any comments you want to add after a '#')
+# If you use DOS-style suffixes, you may want to uncomment the following:
+#.cmd 01;32 # executables (bright green)
+#.exe 01;32
+#.com 01;32
+#.btm 01;32
+#.bat 01;32
+# Or if you want to colorize scripts even if they do not have the
+# executable bit actually set.
+#.sh 01;32
+#.csh 01;32
+ # archives or compressed (bright red)
+.tar 01;31
+.tgz 01;31
+.arj 01;31
+.taz 01;31
+.lzh 01;31
+.lzma 01;31
+.tlz 01;31
+.txz 01;31
+.zip 01;31
+.z 01;31
+.Z 01;31
+.dz 01;31
+.gz 01;31
+.lz 01;31
+.xz 01;31
+.bz2 01;31
+.bz 01;31
+.tbz 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
+.cgm 01;35
+.emf 01;35
+# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
+.axv 01;35
+.anx 01;35
+.ogv 01;35
+.ogx 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
+# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
+.axa 00;36
+.oga 00;36
+.spx 00;36
+.xspf 00;36

+ 35 - 0
gitconfig

@@ -0,0 +1,35 @@
+[user]
+	name = raylu
+	email = raylu@cmu.edu
+	signingkey = BA778D8B
+
+[color]
+	ui = true
+	interactive = true
+
+[color "status"]
+	added = green bold
+	changed = red bold
+	untracked = cyan
+
+[color "diff"]
+	meta = cyan bold
+	old = red bold
+	new = green bold
+	frag = blue
+	commit = yellow bold
+
+[color "branch"]
+	current = green bold
+	local = bold
+	remote = red bold
+
+[color "grep"]
+	match = cyan
+
+[pager]
+	color = true
+
+[core]
+	editor = vim
+	pager = less -i

+ 10 - 0
pentadactylrc

@@ -0,0 +1,10 @@
+"hg4966 (created: 2010/12/20 01:00:16)
+
+set complete=lfS
+set defsearch=g
+set runtimepath=/home/raylu/.pentadactyl
+set hlfind
+
+map gf -ex tab viewsource
+
+" vim: set ft=pentadactyl:

+ 222 - 0
vim/doc/surround.txt

@@ -0,0 +1,222 @@
+*surround.txt*  Plugin for deleting, changing, and adding "surroundings"
+
+Author:  Tim Pope <vimNOSPAM@tpope.info>        *surround-author*
+License: Same terms as Vim itself (see |license|)
+
+This plugin is only available if 'compatible' is not set.
+
+INTRODUCTION                                    *surround*
+
+This plugin is a tool for dealing with pairs of "surroundings."  Examples
+of surroundings include parentheses, quotes, and HTML tags.  They are
+closely related to what Vim refers to as |text-objects|.  Provided
+are mappings to allow for removing, changing, and adding surroundings.
+
+Details follow on the exact semantics, but first, consider the following
+examples.  An asterisk (*) is used to denote the cursor position.
+
+  Old text                  Command     New text ~
+  "Hello *world!"           ds"         Hello world!
+  [123+4*56]/2              cs])        (123+456)/2
+  "Look ma, I'm *HTML!"     cs"<q>      <q>Look ma, I'm HTML!</q>
+  if *x>3 {                 ysW(        if ( x>3 ) {
+  my $str = *whee!;         vlllls'     my $str = 'whee!';
+
+While a few features of this plugin will work in older versions of Vim,
+Vim 7 is recommended for full functionality.
+
+MAPPINGS                                        *surround-mappings*
+
+Delete surroundings is *ds* .  The next character given determines the target
+to delete.  The exact nature of the target is explained in |surround-targets|
+but essentially it is the last character of a |text-object|.  This mapping
+deletes the difference between the "i"nner object and "a"n object.  This is
+easiest to understand with some examples:
+
+  Old text                  Command     New text ~
+  "Hello *world!"           ds"         Hello world!
+  (123+4*56)/2              ds)         123+456/2
+  <div>Yo!*</div>           dst         Yo!
+
+Change surroundings is *cs* .  It takes two arguments, a target like with
+|ds|, and a replacement.  Details about the second argument can be found
+below in |surround-replacements|.  Once again, examples are in order.
+
+  Old text                  Command     New text ~
+  "Hello *world!"           cs"'        'Hello world!'
+  "Hello *world!"           cs"<q>      <q>Hello world!</q>
+  (123+4*56)/2              cs)]        [123+456]/2
+  (123+4*56)/2              cs)[        [ 123+456 ]/2
+  <div>Yo!*</div>           cst<p>      <p>Yo!</p>
+
+*ys* takes a valid Vim motion or text object as the first object, and wraps
+it using the second argument as with |cs|.  (Unfortunately there's no good
+mnemonic for "ys".)
+
+  Old text                  Command     New text ~
+  Hello w*orld!             ysiw)       Hello (world)!
+
+As a special case, *yss* operates on the current line, ignoring leading
+whitespace.
+
+  Old text                  Command     New text ~
+      Hello w*orld!         yssB            {Hello world!}
+
+There is also *yS* and *ySS* which indent the surrounded text and place it
+on a line of its own.
+
+In visual mode, a simple "s" with an argument wraps the selection.  This is
+referred to as the *vS* mapping, although ordinarily there will be
+additional keystrokes between the v and s.  In linewise visual mode, the
+surroundings are placed on separate lines and indented.  In blockwise visual
+mode, each line is surrounded.
+
+A "gS" in visual mode, known as *vgS* , behaves similarly.  In linewise visual
+mode, the automatic indenting is surpressed.  In blockwise visual mode, this
+enables surrounding past the end of the like with 'virtualedit' set (there
+seems to be no way in Vim Script to differentiate between a jagged end of line
+selection and a virtual block selected past the end of the line, so two maps
+were needed).
+
+Additionally, there is a legacy "s" or *vs* mapping which is basically the
+same as |vS|.  Due to popular demand of wanting to use "s" as Vim does to mean
+replacing the selection (also available as "c"), this mapping is going away.
+If you were one of these people and would like to disable "s" with the current
+release, indicate this to surround.vim by assigning the "s" mapping to
+something else.
+>
+  xmap <Leader>s <Plug>Vsurround
+<
+                                                *i_CTRL-G_s* *i_CTRL-G_S*
+Finally, there is an experimental insert mode mapping on <C-G>s and <C-S>.
+Beware that the latter won't work on terminals with flow control (if you
+accidentally freeze your terminal, use <C-Q> to unfreeze it).  The mapping
+inserts the specified surroundings and puts the cursor between them.  If,
+immediately after the mapping and before the replacement, a second <C-S> or
+carriage return is pressed, the prefix, cursor, and suffix will be placed on
+three separate lines.  <C-G>S (not <C-G>s) also exhibits this behavior.
+
+TARGETS                                         *surround-targets*
+
+The |ds| and |cs| commands both take a target as their first argument.  The
+possible targets are based closely on the |text-objects| provided by Vim.
+In order for a target to work, the corresponding text object must be
+supported in the version of Vim used (Vim 7 adds several text objects, and
+thus is highly recommended).  All targets are currently just one character.
+
+Eight punctuation marks, (, ), {, }, [, ], <, and >, represent themselves
+and their counterparts.  If the opening mark is used, contained whitespace is
+also trimmed.  The targets b, B, r, and a are aliases for ), }, ], and >
+(the first two mirror Vim; the second two are completely arbitrary and
+subject to change).
+
+Three quote marks, ', ", `, represent themselves, in pairs.  They are only
+searched for on the current line.
+
+A t is a pair of HTML or XML tags.  See |tag-blocks| for details.  Remember
+that you can specify a numerical argument if you want to get to a tag other
+than the innermost one.
+
+The letters w, W, and s correspond to a |word|, a |WORD|, and a |sentence|,
+respectively.  These are special in that they have nothing to delete, and
+used with |ds| they are a no-op.  With |cs|, one could consider them a
+slight shortcut for ysi (cswb == ysiwb, more or less).
+
+A p represents a |paragraph|.  This behaves similarly to w, W, and s above;
+however, newlines are sometimes added and/or removed.
+
+REPLACEMENTS                                    *surround-replacements*
+
+A replacement argument is a single character, and is required by |cs|, |ys|,
+and |vs|.  Undefined replacement characters (with the exception of alphabetic
+characters) default to placing themselves at the beginning and end of the
+destination, which can be useful for characters like / and |.
+
+If either ), }, ], or > is used, the text is wrapped in the appropriate pair
+of characters.  Similar behavior can be found with (, {, and [ (but not <),
+which append an additional space to the inside.  Like with the targets above,
+b, B, r, and a are aliases for ), }, ], and >.  To fulfill the common need for
+code blocks in C-style languages, <C-}> (which is really <C-]>) adds braces on
+lines separate from the content.
+
+If t or < is used, Vim prompts for an HTML/XML tag to insert.  You may specify
+attributes here and they will be stripped from the closing tag.  End your
+input by pressing <CR> or >.  If <C-T> is used, the tags will appear on lines
+by themselves.
+
+A deprecated replacement of a LaTeX environment is provided on \ and l.  The
+name of the environment and any arguments will be input from a prompt.  This
+will be removed once a more fully functional customization system is
+implemented.  The following shows the resulting environment from
+csp\tabular}{lc<CR>
+>
+  \begin{tabular}{lc}
+  \end{tabular}
+<
+CUSTOMIZING                                     *surround-customizing*
+
+The following adds a potential replacement on "-" (ASCII 45) in PHP files.
+(To determine the ASCII code to use, :echo char2nr("-")).  The carriage
+return will be replaced by the original text.
+>
+  autocmd FileType php let b:surround_45 = "<?php \r ?>"
+<
+This can be used in a PHP file as in the following example.
+
+  Old text                  Command     New text ~
+  print "Hello *world!"     yss-        <?php print "Hello world!" ?>
+
+Additionally, one can use a global variable for globally available
+replacements.
+>
+  let g:surround_45 = "<% \r %>"
+  let g:surround_61 = "<%= \r %>"
+<
+Advanced, experimental, and subject to change:  One can also prompt for
+replacement text.  The syntax for this is to surround the replacement in pairs
+of low numbered control characters.  If this sounds confusing, that's because
+it is (but it makes the parsing easy).  Consider the following example for a
+LaTeX environment on the "l" replacement.
+>
+  let g:surround_108 = "\\begin{\1environment: \1}\r\\end{\1\1}"
+<
+When this replacement is used,  the user is prompted with an "environment: "
+prompt for input.  This input is inserted between each set of \1's.
+Additional inputs up to \7 can be used.
+
+Furthermore, one can specify a regular expression substitution to apply.
+>
+  let g:surround_108 = "\\begin{\1environment: \1}\r\\end{\1\r}.*\r\1}"
+<
+This will remove anything after the first } in the input when the text is
+placed within the \end{} slot.  The first \r marks where the pattern begins,
+and the second where the replacement text begins.
+
+Here's a second example for creating an HTML <div>.  The substitution cleverly
+prompts for an id, but only adds id="" if it is non-blank.  You may have to
+read this one a few times slowly before you understand it.
+>
+  let g:surround_{char2nr("d")} = "<div\1id: \r..*\r id=\"&\"\1>\r</div>"
+<
+Inputting text replacements is a proof of concept at this point. The ugly,
+unintuitive interface and the brevity of the documentation reflect this.
+
+Finally, It is possible to always append a string to surroundings in insert
+mode (and only insert mode).  This is useful with certain plugins and mappings
+that allow you to jump to such markings.
+>
+  let g:surround_insert_tail = "<++>"
+<
+ISSUES                                          *surround-issues*
+
+Vim could potentially get confused when deleting/changing occurs at the very
+end of the line.  Please report any repeatable instances of this.
+
+Do we need to use |inputsave()|/|inputrestore()| with the tag replacement?
+
+Indenting is handled haphazardly.  Need to decide the most appropriate
+behavior and implement it.  Right now one can do :let b:surround_indent = 1
+(or the global equivalent) to enable automatic re-indenting by Vim via |=|;
+should this be the default?
+
+ vim:tw=78:ts=8:ft=help:norl:

+ 1 - 0
vim/ftdetect/gofiletype.vim

@@ -0,0 +1 @@
+/home/raylu/go/misc/vim/ftdetect/gofiletype.vim

+ 2 - 0
vim/ftdetect/markdown.vim

@@ -0,0 +1,2 @@
+" Markdown
+autocmd BufNewFile,BufRead *.{md,mkd,mkdn,mark*} set filetype=markdown

+ 63 - 0
vim/indent/go.vim

@@ -0,0 +1,63 @@
+" Vim indent file
+" Language:	Go
+" Author:	Alecs King <alecsk@gmail.com>
+"
+" inspired by indent/lua.vim
+"
+" very simple:
+" just indent common cases to avoid manually typing tab or backspace
+"
+" for better style, please use gofmt after done editing.
+"
+" since it just simply uses regex matches,
+" there might be some mis-indented corner cases.
+" 
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+  finish
+endif
+let b:did_indent = 1
+
+setlocal indentexpr=GetGoIndent()
+
+" To make Vim call GetLuaIndent() when it finds '\s*)', '\s*}', '\s*case', '\s*default'
+setlocal indentkeys+=0=),0=},0=case,0=default
+
+setlocal autoindent
+
+" Only define the function once.
+if exists("*GetGoIndent")
+  finish
+endif
+
+function! GetGoIndent()
+  " Find a non-blank line above the current line.
+  let prevlnum = prevnonblank(v:lnum - 1)
+
+  " Hit the start of the file, use zero indent.
+  if prevlnum == 0
+    return 0
+  endif
+
+  " Add a 'shiftwidth' after lines that start a block:
+  " 'case', 'default', '{', '('
+  let ind = indent(prevlnum)
+  let prevline = getline(prevlnum)
+  let midx = match(prevline, '^\s*\%(case\>\|default\>\)')
+  if midx == -1
+    let midx = match(prevline, '[({]\s*$')
+  endif
+  if midx != -1
+    let ind = ind + &shiftwidth
+  endif
+
+  " Subtract a 'shiftwidth' on 'case', 'default', '}', ')'.
+  " This is the part that requires 'indentkeys'.
+  let midx = match(getline(v:lnum), '^\s*\%(case\>\|default\>\|[)}]\)')
+  if midx != -1
+    let ind = ind - &shiftwidth
+  endif
+
+  return ind
+endfunction

+ 165 - 0
vim/plugin/cscope_maps.vim

@@ -0,0 +1,165 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" CSCOPE settings for vim           
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"
+" This file contains some boilerplate settings for vim's cscope interface,
+" plus some keyboard mappings that I've found useful.
+"
+" USAGE: 
+" -- vim 6:     Stick this file in your ~/.vim/plugin directory (or in a
+"               'plugin' directory in some other directory that is in your
+"               'runtimepath'.
+"
+" -- vim 5:     Stick this file somewhere and 'source cscope.vim' it from
+"               your ~/.vimrc file (or cut and paste it into your .vimrc).
+"
+" NOTE: 
+" These key maps use multiple keystrokes (2 or 3 keys).  If you find that vim
+" keeps timing you out before you can complete them, try changing your timeout
+" settings, as explained below.
+"
+" Happy cscoping,
+"
+" Jason Duell       jduell@alumni.princeton.edu     2002/3/7
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+" This tests to see if vim was configured with the '--enable-cscope' option
+" when it was compiled.  If it wasn't, time to recompile vim... 
+if has("cscope")
+
+    """"""""""""" Standard cscope/vim boilerplate
+
+    " use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
+    set cscopetag
+
+    " check cscope for definition of a symbol before checking ctags: set to 1
+    " if you want the reverse search order.
+    set csto=0
+
+    " add any cscope database in current directory
+    if filereadable("cscope.out")
+        cs add cscope.out  
+    " else add the database pointed to by environment variable 
+    elseif $CSCOPE_DB != ""
+        cs add $CSCOPE_DB
+    endif
+
+    " show msg when any other cscope db added
+    set cscopeverbose  
+
+
+    """"""""""""" My cscope/vim key mappings
+    "
+    " The following maps all invoke one of the following cscope search types:
+    "
+    "   's'   symbol: find all references to the token under cursor
+    "   'g'   global: find global definition(s) of the token under cursor
+    "   'c'   calls:  find all calls to the function name under cursor
+    "   't'   text:   find all instances of the text under cursor
+    "   'e'   egrep:  egrep search for the word under cursor
+    "   'f'   file:   open the filename under cursor
+    "   'i'   includes: find files that include the filename under cursor
+    "   'd'   called: find functions that function under cursor calls
+    "
+    " Below are three sets of the maps: one set that just jumps to your
+    " search result, one that splits the existing vim window horizontally and
+    " diplays your search result in the new window, and one that does the same
+    " thing, but does a vertical split instead (vim 6 only).
+    "
+    " I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's
+    " unlikely that you need their default mappings (CTRL-\'s default use is
+    " as part of CTRL-\ CTRL-N typemap, which basically just does the same
+    " thing as hitting 'escape': CTRL-@ doesn't seem to have any default use).
+    " If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all
+    " of these maps to use other keys.  One likely candidate is 'CTRL-_'
+    " (which also maps to CTRL-/, which is easier to type).  By default it is
+    " used to switch between Hebrew and English keyboard mode.
+    "
+    " All of the maps involving the <cfile> macro use '^<cfile>$': this is so
+    " that searches over '#include <time.h>" return only references to
+    " 'time.h', and not 'sys/time.h', etc. (by default cscope will return all
+    " files that contain 'time.h' as part of their name).
+
+
+    " To do the first type of search, hit 'CTRL-\', followed by one of the
+    " cscope search types above (s,g,c,t,e,f,i,d).  The result of your cscope
+    " search will be displayed in the current window.  You can use CTRL-T to
+    " go back to where you were before the search.  
+    "
+
+    nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>	
+    nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+    nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>	
+
+
+    " Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type
+    " makes the vim window split horizontally, with search result displayed in
+    " the new window.
+    "
+    " (Note: earlier versions of vim may not have the :scs command, but it
+    " can be simulated roughly via:
+    "    nmap <C-@>s <C-W><C-S> :cs find s <C-R>=expand("<cword>")<CR><CR>	
+
+    nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>	
+    nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>	
+    nmap <C-@>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>	
+    nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>	
+
+
+    " Hitting CTRL-space *twice* before the search type does a vertical 
+    " split instead of a horizontal one (vim 6 and up only)
+    "
+    " (Note: you may wish to put a 'set splitright' in your .vimrc
+    " if you prefer the new window on the right instead of the left
+
+    nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
+    nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
+    nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
+    nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
+    nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
+    nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>	
+    nmap <C-@><C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>	
+    nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
+
+
+    """"""""""""" key map timeouts
+    "
+    " By default Vim will only wait 1 second for each keystroke in a mapping.
+    " You may find that too short with the above typemaps.  If so, you should
+    " either turn off mapping timeouts via 'notimeout'.
+    "
+    "set notimeout 
+    "
+    " Or, you can keep timeouts, by uncommenting the timeoutlen line below,
+    " with your own personal favorite value (in milliseconds):
+    "
+    "set timeoutlen=4000
+    "
+    " Either way, since mapping timeout settings by default also set the
+    " timeouts for multicharacter 'keys codes' (like <F1>), you should also
+    " set ttimeout and ttimeoutlen: otherwise, you will experience strange
+    " delays as vim waits for a keystroke after you hit ESC (it will be
+    " waiting to see if the ESC is actually part of a key code like <F1>).
+    "
+    "set ttimeout 
+    "
+    " personally, I find a tenth of a second to work well for key code
+    " timeouts. If you experience problems and have a slow terminal or network
+    " connection, set it higher.  If you don't set ttimeoutlen, the value for
+    " timeoutlent (default: 1000 = 1 second, which is sluggish) is used.
+    "
+    "set ttimeoutlen=100
+
+endif
+
+

+ 625 - 0
vim/plugin/surround.vim

@@ -0,0 +1,625 @@
+" surround.vim - Surroundings
+" Author:       Tim Pope <vimNOSPAM@tpope.org>
+" Version:      1.90
+" GetLatestVimScripts: 1697 1 :AutoInstall: surround.vim
+"
+" See surround.txt for help.  This can be accessed by doing
+"
+" :helptags ~/.vim/doc
+" :help surround
+"
+" Licensed under the same terms as Vim itself.
+
+" ============================================================================
+
+" Exit quickly when:
+" - this plugin was already loaded or disabled
+" - when 'compatible' is set
+if (exists("g:loaded_surround") && g:loaded_surround) || &cp
+  finish
+endif
+let g:loaded_surround = 1
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Input functions {{{1
+
+function! s:getchar()
+  let c = getchar()
+  if c =~ '^\d\+$'
+    let c = nr2char(c)
+  endif
+  return c
+endfunction
+
+function! s:inputtarget()
+  let c = s:getchar()
+  while c =~ '^\d\+$'
+    let c = c . s:getchar()
+  endwhile
+  if c == " "
+    let c = c . s:getchar()
+  endif
+  if c =~ "\<Esc>\|\<C-C>\|\0"
+    return ""
+  else
+    return c
+  endif
+endfunction
+
+function! s:inputreplacement()
+  "echo '-- SURROUND --'
+  let c = s:getchar()
+  if c == " "
+    let c = c . s:getchar()
+  endif
+  if c =~ "\<Esc>" || c =~ "\<C-C>"
+    return ""
+  else
+    return c
+  endif
+endfunction
+
+function! s:beep()
+  exe "norm! \<Esc>"
+  return ""
+endfunction
+
+function! s:redraw()
+  redraw
+  return ""
+endfunction
+
+" }}}1
+
+" Wrapping functions {{{1
+
+function! s:extractbefore(str)
+  if a:str =~ '\r'
+    return matchstr(a:str,'.*\ze\r')
+  else
+    return matchstr(a:str,'.*\ze\n')
+  endif
+endfunction
+
+function! s:extractafter(str)
+  if a:str =~ '\r'
+    return matchstr(a:str,'\r\zs.*')
+  else
+    return matchstr(a:str,'\n\zs.*')
+  endif
+endfunction
+
+function! s:repeat(str,count)
+  let cnt = a:count
+  let str = ""
+  while cnt > 0
+    let str = str . a:str
+    let cnt = cnt - 1
+  endwhile
+  return str
+endfunction
+
+function! s:fixindent(str,spc)
+  let str = substitute(a:str,'\t',s:repeat(' ',&sw),'g')
+  let spc = substitute(a:spc,'\t',s:repeat(' ',&sw),'g')
+  let str = substitute(str,'\(\n\|\%^\).\@=','\1'.spc,'g')
+  if ! &et
+    let str = substitute(str,'\s\{'.&ts.'\}',"\t",'g')
+  endif
+  return str
+endfunction
+
+function! s:process(string)
+  let i = 0
+  while i < 7
+    let i = i + 1
+    let repl_{i} = ''
+    let m = matchstr(a:string,nr2char(i).'.\{-\}\ze'.nr2char(i))
+    if m != ''
+      let m = substitute(strpart(m,1),'\r.*','','')
+      let repl_{i} = input(substitute(m,':\s*$','','').': ')
+    endif
+  endwhile
+  let s = ""
+  let i = 0
+  while i < strlen(a:string)
+    let char = strpart(a:string,i,1)
+    if char2nr(char) < 8
+      let next = stridx(a:string,char,i+1)
+      if next == -1
+        let s = s . char
+      else
+        let insertion = repl_{char2nr(char)}
+        let subs = strpart(a:string,i+1,next-i-1)
+        let subs = matchstr(subs,'\r.*')
+        while subs =~ '^\r.*\r'
+          let sub = matchstr(subs,"^\r\\zs[^\r]*\r[^\r]*")
+          let subs = strpart(subs,strlen(sub)+1)
+          let r = stridx(sub,"\r")
+          let insertion = substitute(insertion,strpart(sub,0,r),strpart(sub,r+1),'')
+        endwhile
+        let s = s . insertion
+        let i = next
+      endif
+    else
+      let s = s . char
+    endif
+    let i = i + 1
+  endwhile
+  return s
+endfunction
+
+function! s:wrap(string,char,type,...)
+  let keeper = a:string
+  let newchar = a:char
+  let type = a:type
+  let linemode = type ==# 'V' ? 1 : 0
+  let special = a:0 ? a:1 : 0
+  let before = ""
+  let after  = ""
+  if type ==# "V"
+    let initspaces = matchstr(keeper,'\%^\s*')
+  else
+    let initspaces = matchstr(getline('.'),'\%^\s*')
+  endif
+  " Duplicate b's are just placeholders (removed)
+  let pairs = "b()B{}r[]a<>"
+  let extraspace = ""
+  if newchar =~ '^ '
+    let newchar = strpart(newchar,1)
+    let extraspace = ' '
+  endif
+  let idx = stridx(pairs,newchar)
+  if newchar == ' '
+    let before = ''
+    let after  = ''
+  elseif exists("b:surround_".char2nr(newchar))
+    let all    = s:process(b:surround_{char2nr(newchar)})
+    let before = s:extractbefore(all)
+    let after  =  s:extractafter(all)
+  elseif exists("g:surround_".char2nr(newchar))
+    let all    = s:process(g:surround_{char2nr(newchar)})
+    let before = s:extractbefore(all)
+    let after  =  s:extractafter(all)
+  elseif newchar ==# "p"
+    let before = "\n"
+    let after  = "\n\n"
+  elseif newchar =~# "[tT\<C-T><,]"
+    let dounmapp = 0
+    let dounmapb = 0
+    if !maparg(">","c")
+      let dounmapb= 1
+      " Hide from AsNeeded
+      exe "cn"."oremap > <CR>"
+    endif
+    let default = ""
+    if newchar ==# "T"
+      if !exists("s:lastdel")
+        let s:lastdel = ""
+      endif
+      let default = matchstr(s:lastdel,'<\zs.\{-\}\ze>')
+    endif
+    let tag = input("<",default)
+    echo "<".substitute(tag,'>*$','>','')
+    if dounmapb
+      silent! cunmap >
+    endif
+    if tag != ""
+      let tag = substitute(tag,'>*$','','')
+      let before = '<'.tag.'>'
+      if tag =~ '/$'
+        let after = ''
+      else
+        let after  = '</'.substitute(tag,' .*','','').'>'
+      endif
+      if newchar == "\<C-T>" || newchar == ","
+        if type ==# "v" || type ==# "V"
+          let before = before . "\n\t"
+        endif
+        if type ==# "v"
+          let after  = "\n". after
+        endif
+      endif
+    endif
+  elseif newchar ==# 'l' || newchar == '\'
+    " LaTeX
+    let env = input('\begin{')
+    let env = '{' . env
+    let env = env . s:closematch(env)
+    echo '\begin'.env
+    if env != ""
+      let before = '\begin'.env
+      let after  = '\end'.matchstr(env,'[^}]*').'}'
+    endif
+    "if type ==# 'v' || type ==# 'V'
+    "let before = before ."\n\t"
+    "endif
+    "if type ==# 'v'
+    "let after  = "\n".initspaces.after
+    "endif
+  elseif newchar ==# 'f' || newchar ==# 'F'
+    let fnc = input('function: ')
+    if fnc != ""
+      let before = substitute(fnc,'($','','').'('
+      let after  = ')'
+      if newchar ==# 'F'
+        let before = before . ' '
+        let after  = ' ' . after
+      endif
+    endif
+  elseif idx >= 0
+    let spc = (idx % 3) == 1 ? " " : ""
+    let idx = idx / 3 * 3
+    let before = strpart(pairs,idx+1,1) . spc
+    let after  = spc . strpart(pairs,idx+2,1)
+  elseif newchar == "\<C-[>" || newchar == "\<C-]>"
+    let before = "{\n\t"
+    let after  = "\n}"
+  elseif newchar !~ '\a'
+    let before = newchar
+    let after  = newchar
+  else
+    let before = ''
+    let after  = ''
+  endif
+  "let before = substitute(before,'\n','\n'.initspaces,'g')
+  let after  = substitute(after ,'\n','\n'.initspaces,'g')
+  "let after  = substitute(after,"\n\\s*\<C-U>\\s*",'\n','g')
+  if type ==# 'V' || (special && type ==# "v")
+    let before = substitute(before,' \+$','','')
+    let after  = substitute(after ,'^ \+','','')
+    if after !~ '^\n'
+      let after  = initspaces.after
+    endif
+    if keeper !~ '\n$' && after !~ '^\n'
+      let keeper = keeper . "\n"
+    elseif keeper =~ '\n$' && after =~ '^\n'
+      let after = strpart(after,1)
+    endif
+    if before !~ '\n\s*$'
+      let before = before . "\n"
+      if special
+        let before = before . "\t"
+      endif
+    endif
+  endif
+  if type ==# 'V'
+    let before = initspaces.before
+  endif
+  if before =~ '\n\s*\%$'
+    if type ==# 'v'
+      let keeper = initspaces.keeper
+    endif
+    let padding = matchstr(before,'\n\zs\s\+\%$')
+    let before  = substitute(before,'\n\s\+\%$','\n','')
+    let keeper = s:fixindent(keeper,padding)
+  endif
+  if type ==# 'V'
+    let keeper = before.keeper.after
+  elseif type =~ "^\<C-V>"
+    " Really we should be iterating over the buffer
+    let repl = substitute(before,'[\\~]','\\&','g').'\1'.substitute(after,'[\\~]','\\&','g')
+    let repl = substitute(repl,'\n',' ','g')
+    let keeper = substitute(keeper."\n",'\(.\{-\}\)\(\n\)',repl.'\n','g')
+    let keeper = substitute(keeper,'\n\%$','','')
+  else
+    let keeper = before.extraspace.keeper.extraspace.after
+  endif
+  return keeper
+endfunction
+
+function! s:wrapreg(reg,char,...)
+  let orig = getreg(a:reg)
+  let type = substitute(getregtype(a:reg),'\d\+$','','')
+  let special = a:0 ? a:1 : 0
+  let new = s:wrap(orig,a:char,type,special)
+  call setreg(a:reg,new,type)
+endfunction
+" }}}1
+
+function! s:insert(...) " {{{1
+  " Optional argument causes the result to appear on 3 lines, not 1
+  "call inputsave()
+  let linemode = a:0 ? a:1 : 0
+  let char = s:inputreplacement()
+  while char == "\<CR>" || char == "\<C-S>"
+    " TODO: use total count for additional blank lines
+    let linemode = linemode + 1
+    let char = s:inputreplacement()
+  endwhile
+  "call inputrestore()
+  if char == ""
+    return ""
+  endif
+  "call inputsave()
+  let cb_save = &clipboard
+  set clipboard-=unnamed
+  let reg_save = @@
+  call setreg('"',"\r",'v')
+  call s:wrapreg('"',char,linemode)
+  " If line mode is used and the surrounding consists solely of a suffix,
+  " remove the initial newline.  This fits a use case of mine but is a
+  " little inconsistent.  Is there anyone that would prefer the simpler
+  " behavior of just inserting the newline?
+  if linemode && match(getreg('"'),'^\n\s*\zs.*') == 0
+    call setreg('"',matchstr(getreg('"'),'^\n\s*\zs.*'),getregtype('"'))
+  endif
+  " This can be used to append a placeholder to the end
+  if exists("g:surround_insert_tail")
+    call setreg('"',g:surround_insert_tail,"a".getregtype('"'))
+  endif
+  "if linemode
+  "call setreg('"',substitute(getreg('"'),'^\s\+','',''),'c')
+  "endif
+  if col('.') >= col('$')
+    norm! ""p
+  else
+    norm! ""P
+  endif
+  if linemode
+    call s:reindent()
+  endif
+  norm! `]
+  call search('\r','bW')
+  let @@ = reg_save
+  let &clipboard = cb_save
+  return "\<Del>"
+endfunction " }}}1
+
+function! s:reindent() " {{{1
+  if exists("b:surround_indent") ? b:surround_indent : (exists("g:surround_indent") && g:surround_indent)
+    silent norm! '[=']
+  endif
+endfunction " }}}1
+
+function! s:dosurround(...) " {{{1
+  let scount = v:count1
+  let char = (a:0 ? a:1 : s:inputtarget())
+  let spc = ""
+  if char =~ '^\d\+'
+    let scount = scount * matchstr(char,'^\d\+')
+    let char = substitute(char,'^\d\+','','')
+  endif
+  if char =~ '^ '
+    let char = strpart(char,1)
+    let spc = 1
+  endif
+  if char == 'a'
+    let char = '>'
+  endif
+  if char == 'r'
+    let char = ']'
+  endif
+  let newchar = ""
+  if a:0 > 1
+    let newchar = a:2
+    if newchar == "\<Esc>" || newchar == "\<C-C>" || newchar == ""
+      return s:beep()
+    endif
+  endif
+  let cb_save = &clipboard
+  set clipboard-=unnamed
+  let append = ""
+  let original = getreg('"')
+  let otype = getregtype('"')
+  call setreg('"',"")
+  let strcount = (scount == 1 ? "" : scount)
+  if char == '/'
+    exe 'norm! '.strcount.'[/d'.strcount.']/'
+  else
+    exe 'norm! d'.strcount.'i'.char
+  endif
+  let keeper = getreg('"')
+  let okeeper = keeper " for reindent below
+  if keeper == ""
+    call setreg('"',original,otype)
+    let &clipboard = cb_save
+    return ""
+  endif
+  let oldline = getline('.')
+  let oldlnum = line('.')
+  if char ==# "p"
+    call setreg('"','','V')
+  elseif char ==# "s" || char ==# "w" || char ==# "W"
+    " Do nothing
+    call setreg('"','')
+  elseif char =~ "[\"'`]"
+    exe "norm! i \<Esc>d2i".char
+    call setreg('"',substitute(getreg('"'),' ','',''))
+  elseif char == '/'
+    norm! "_x
+    call setreg('"','/**/',"c")
+    let keeper = substitute(substitute(keeper,'^/\*\s\=','',''),'\s\=\*$','','')
+  else
+    " One character backwards
+    call search('.','bW')
+    exe "norm! da".char
+  endif
+  let removed = getreg('"')
+  let rem2 = substitute(removed,'\n.*','','')
+  let oldhead = strpart(oldline,0,strlen(oldline)-strlen(rem2))
+  let oldtail = strpart(oldline,  strlen(oldline)-strlen(rem2))
+  let regtype = getregtype('"')
+  if char =~# '[\[({<T]' || spc
+    let keeper = substitute(keeper,'^\s\+','','')
+    let keeper = substitute(keeper,'\s\+$','','')
+  endif
+  if col("']") == col("$") && col('.') + 1 == col('$')
+    if oldhead =~# '^\s*$' && a:0 < 2
+      let keeper = substitute(keeper,'\%^\n'.oldhead.'\(\s*.\{-\}\)\n\s*\%$','\1','')
+    endif
+    let pcmd = "p"
+  else
+    let pcmd = "P"
+  endif
+  if line('.') < oldlnum && regtype ==# "V"
+    let pcmd = "p"
+  endif
+  call setreg('"',keeper,regtype)
+  if newchar != ""
+    call s:wrapreg('"',newchar)
+  endif
+  silent exe 'norm! ""'.pcmd.'`['
+  if removed =~ '\n' || okeeper =~ '\n' || getreg('"') =~ '\n'
+    call s:reindent()
+  endif
+  if getline('.') =~ '^\s\+$' && keeper =~ '^\s*\n'
+    silent norm! cc
+  endif
+  call setreg('"',removed,regtype)
+  let s:lastdel = removed
+  let &clipboard = cb_save
+  if newchar == ""
+    silent! call repeat#set("\<Plug>Dsurround".char,scount)
+  else
+    silent! call repeat#set("\<Plug>Csurround".char.newchar,scount)
+  endif
+endfunction " }}}1
+
+function! s:changesurround() " {{{1
+  let a = s:inputtarget()
+  if a == ""
+    return s:beep()
+  endif
+  let b = s:inputreplacement()
+  if b == ""
+    return s:beep()
+  endif
+  call s:dosurround(a,b)
+endfunction " }}}1
+
+function! s:opfunc(type,...) " {{{1
+  let char = s:inputreplacement()
+  if char == ""
+    return s:beep()
+  endif
+  let reg = '"'
+  let sel_save = &selection
+  let &selection = "inclusive"
+  let cb_save  = &clipboard
+  set clipboard-=unnamed
+  let reg_save = getreg(reg)
+  let reg_type = getregtype(reg)
+  "call setreg(reg,"\n","c")
+  let type = a:type
+  if a:type == "char"
+    silent exe 'norm! v`[o`]"'.reg.'y'
+    let type = 'v'
+  elseif a:type == "line"
+    silent exe 'norm! `[V`]"'.reg.'y'
+    let type = 'V'
+  elseif a:type ==# "v" || a:type ==# "V" || a:type ==# "\<C-V>"
+    let ve = &virtualedit
+    if !(a:0 && a:1)
+      set virtualedit=
+    endif
+    silent exe 'norm! gv"'.reg.'y'
+    let &virtualedit = ve
+  elseif a:type =~ '^\d\+$'
+    let type = 'v'
+    silent exe 'norm! ^v'.a:type.'$h"'.reg.'y'
+    if mode() ==# 'v'
+      norm! v
+      return s:beep()
+    endif
+  else
+    let &selection = sel_save
+    let &clipboard = cb_save
+    return s:beep()
+  endif
+  let keeper = getreg(reg)
+  if type ==# "v" && a:type !=# "v"
+    let append = matchstr(keeper,'\_s\@<!\s*$')
+    let keeper = substitute(keeper,'\_s\@<!\s*$','','')
+  endif
+  call setreg(reg,keeper,type)
+  call s:wrapreg(reg,char,a:0 && a:1)
+  if type ==# "v" && a:type !=# "v" && append != ""
+    call setreg(reg,append,"ac")
+  endif
+  silent exe 'norm! gv'.(reg == '"' ? '' : '"' . reg).'p`['
+  if type ==# 'V' || (getreg(reg) =~ '\n' && type ==# 'v')
+    call s:reindent()
+  endif
+  call setreg(reg,reg_save,reg_type)
+  let &selection = sel_save
+  let &clipboard = cb_save
+  if a:type =~ '^\d\+$'
+    silent! call repeat#set("\<Plug>Y".(a:0 && a:1 ? "S" : "s")."surround".char,a:type)
+  endif
+endfunction
+
+function! s:opfunc2(arg)
+  call s:opfunc(a:arg,1)
+endfunction " }}}1
+
+function! s:closematch(str) " {{{1
+  " Close an open (, {, [, or < on the command line.
+  let tail = matchstr(a:str,'.[^\[\](){}<>]*$')
+  if tail =~ '^\[.\+'
+    return "]"
+  elseif tail =~ '^(.\+'
+    return ")"
+  elseif tail =~ '^{.\+'
+    return "}"
+  elseif tail =~ '^<.+'
+    return ">"
+  else
+    return ""
+  endif
+endfunction " }}}1
+
+nnoremap <silent> <Plug>Dsurround  :<C-U>call <SID>dosurround(<SID>inputtarget())<CR>
+nnoremap <silent> <Plug>Csurround  :<C-U>call <SID>changesurround()<CR>
+nnoremap <silent> <Plug>Yssurround :<C-U>call <SID>opfunc(v:count1)<CR>
+nnoremap <silent> <Plug>YSsurround :<C-U>call <SID>opfunc2(v:count1)<CR>
+" <C-U> discards the numerical argument but there's not much we can do with it
+nnoremap <silent> <Plug>Ysurround  :<C-U>set opfunc=<SID>opfunc<CR>g@
+nnoremap <silent> <Plug>YSurround  :<C-U>set opfunc=<SID>opfunc2<CR>g@
+vnoremap <silent> <Plug>Vsurround  :<C-U>call <SID>opfunc(visualmode())<CR>
+vnoremap <silent> <Plug>VSurround  :<C-U>call <SID>opfunc(visualmode(),visualmode() ==# 'V' ? 1 : 0)<CR>
+vnoremap <silent> <Plug>VgSurround :<C-U>call <SID>opfunc(visualmode(),visualmode() ==# 'V' ? 0 : 1)<CR>
+inoremap <silent> <Plug>Isurround  <C-R>=<SID>insert()<CR>
+inoremap <silent> <Plug>ISurround  <C-R>=<SID>insert(1)<CR>
+
+if !exists("g:surround_no_mappings") || ! g:surround_no_mappings
+  nmap      ds   <Plug>Dsurround
+  nmap      cs   <Plug>Csurround
+  nmap      ys   <Plug>Ysurround
+  nmap      yS   <Plug>YSurround
+  nmap      yss  <Plug>Yssurround
+  nmap      ySs  <Plug>YSsurround
+  nmap      ySS  <Plug>YSsurround
+  if !hasmapto("<Plug>Vsurround","v") && !hasmapto("<Plug>VSurround","v")
+    if exists(":xmap")
+      xmap  s    <Plug>Vsurround
+    else
+      vmap  s    <Plug>Vsurround
+    endif
+  endif
+  if !hasmapto("<Plug>VSurround","v")
+    if exists(":xmap")
+      xmap  S    <Plug>VSurround
+    else
+      vmap  S    <Plug>VSurround
+    endif
+  endif
+  if exists(":xmap")
+    xmap    gS   <Plug>VgSurround
+  else
+    vmap    gS   <Plug>VgSurround
+  endif
+  if !hasmapto("<Plug>Isurround","i") && "" == mapcheck("<C-S>","i")
+    imap    <C-S> <Plug>Isurround
+  endif
+  imap      <C-G>s <Plug>Isurround
+  imap      <C-G>S <Plug>ISurround
+  "Implemented internally instead
+  "imap      <C-S><C-S> <Plug>ISurround
+endif
+
+let &cpo = s:cpo_save
+
+" vim:set ft=vim sw=2 sts=2 et:

+ 2 - 0
vim/spell/en.utf-8.add

@@ -0,0 +1,2 @@
+vertices
+automata

+ 265 - 0
vim/syntax/glsl.vim

@@ -0,0 +1,265 @@
+" Vim syntax file the OpenGL Shading Language
+" Language:     GLSL
+" Author:       Nathan Cournia <nathan@cournia.com>
+" Date:         June 30, 2004
+" File Types:   .frag .vert .glsl .fp .vp
+" Version:      1.10.00
+" Notes:        Adapted from c.vim - Bram Moolenaar <bram.vim.org>
+"               Adapted from cg.vim - Kevin Bjorke <kbjorke@nvidia.com>
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+" a bunch of useful keywords
+syn keyword         glslConditional     if else
+syn keyword         glslStatement       break return continue discard
+syn keyword         glslRepeat          while for do
+syn keyword         glslTodo            contained TODO FIXME XXX
+
+" glslCommentGroup allows adding matches for special things in comments
+syn cluster         glslCommentGroup    contains=glslTodo
+
+"catch errors caused by wrong parenthesis and brackets
+syn cluster         glslParenGroup      contains=glslParenError,glslIncluded,glslSpecial,glslCommentSkip,glslCommentString,glslComment2String,@glslCommentGroup,glslCommentStartError,glslUserCont,glslUserLabel,glslBitField,glslCommentSkip,glslOctalZero,glslCppOut,glslCppOut2,glslCppSkip,glslFormat,glslNumber,glslFloat,glslOctal,glslOctalError,glslNumbersCom
+if exists("c_no_bracket_error")
+  syn region        glslParen           transparent start='(' end=')' contains=ALLBUT,@glslParenGroup,glslCppParen,glslCppString
+  " glslCppParen: same as glslParen but ends at end-of-line; used in glslDefine
+  syn region        glslCppParen        transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@glslParenGroup,glslParen,glslString
+  syn match         glslParenError      display ")"
+  syn match         glslErrInParen      display contained "[{}]"
+else
+  syn region        glslParen           transparent start='(' end=')' contains=ALLBUT,@glslParenGroup,glslCppParen,glslErrInBracket,glslCppBracket,glslCppString
+  " glslCppParen: same as glslParen but ends at end-of-line; used in glslDefine
+  syn region        glslCppParen        transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@glslParenGroup,glslErrInBracket,glslParen,glslBracket,glslString
+  syn match         glslParenError      display "[\])]"
+  syn match         glslErrInParen      display contained "[\]{}]"
+  syn region        glslBracket         transparent start='\[' end=']' contains=ALLBUT,@glslParenGroup,glslErrInParen,glslCppParen,glslCppBracket,glslCppString
+  " glslCppBracket: same as glslParen but ends at end-of-line; used in glslDefine
+  syn region        glslCppBracket      transparent start='\[' skip='\\$' excludenl end=']' end='$' contained contains=ALLBUT,@glslParenGroup,glslErrInParen,glslParen,glslBracket,glslString
+  syn match         glslErrInBracket    display contained "[);{}]"
+endif
+
+"integer number, or floating point number without a dot and with "f".
+syn case ignore
+syn match           glslNumbers         display transparent "\<\d\|\.\d" contains=glslNumber,glslFloat,glslOctalError,glslOctal
+" Same, but without octal error (for comments)
+syn match           glslNumbersCom      display contained transparent "\<\d\|\.\d" contains=glslNumber,glslFloat,glslOctal
+syn match           glslNumber          display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
+"hex number
+syn match           glslNumber          display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
+" Flag the first zero of an octal number as something special
+syn match           glslOctal           display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=glslOctalZero
+syn match           glslOctalZero       display contained "\<0"
+syn match           glslFloat           display contained "\d\+f"
+"floating point number, with dot, optional exponent
+syn match           glslFloat           display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
+"floating point number, starting with a dot, optional exponent
+syn match           glslFloat           display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
+"floating point number, without dot, with exponent
+syn match           glslFloat           display contained "\d\+e[-+]\=\d\+[fl]\=\>"
+" flag an octal number with wrong digits
+syn match           glslOctalError      display contained "0\o*[89]\d*"
+syn case match
+
+if exists("c_comment_strings")
+  " A comment can contain glslString, glslCharacter and glslNumber.
+  " But a "*/" inside a glslString in a glslComment DOES end the comment!  So we
+  " need to use a special type of glslString: glslCommentString, which also ends on
+  " "*/", and sees a "*" at the start of the line as glslomment again.
+  " Unfortunately this doesn't very well work for // type of comments :-(
+  syntax match      glslCommentSkip     contained "^\s*\*\($\|\s\+\)"
+  syntax region     glslCommentString   contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=glslSpecial,glslCommentSkip
+  syntax region     glslComment2String  contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=glslSpecial
+  syntax region     glslCommentL        start="//" skip="\\$" end="$" keepend contains=@glslCommentGroup,glslComment2String,glslCharacter,glslNumbersCom,glslSpaceError
+  syntax region     glslComment         matchgroup=glslCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@glslCommentGroup,glslCommentStartError,glslCommentString,glslCharacter,glslNumbersCom,glslSpaceError
+else
+  syn region        glslCommentL        start="//" skip="\\$" end="$" keepend contains=@glslCommentGroup,glslSpaceError
+  syn region        glslComment         matchgroup=glslCommentStart start="/\*" matchgroup=NONE end="\*/" contains=@glslCommentGroup,glslCommentStartError,glslSpaceError
+endif
+" keep a // comment separately, it terminates a preproc. conditional
+syntax match        glslCommentError        display "\*/"
+syntax match        glslCommentStartError   display "/\*"me=e-1 contained
+
+syn keyword        glslType                void
+syn keyword        glslType                bool  bvec2 bvec3 bvec4
+syn keyword        glslType                int   ivec2 ivec3 ivec4
+syn keyword        glslType                float vec2  vec3  vec4
+syn keyword        glslType                mat2  mat3  mat4
+syn keyword        glslType                sampler1D sampler2D sampler3D samplerCUBE sampler1DShadow sampler2DShadow
+
+syn keyword        glslStructure           struct
+
+syn keyword        glslStorageClass        const attribute varying uniform
+syn keyword        glslStorageClass        in out inout
+
+syn keyword        glslConstant            __LINE__ __FILE__ __VERSION__
+
+syn keyword        glslConstant            true false
+
+syn region         glslPreCondit           start="^\s*#\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" end="//"me=s-1 contains=glslComment,glslCppString,glslCharacter,glslCppParen,glslParenError,glslNumbers,glslCommentError,glslSpaceError
+syn match          glslPreCondit           display "^\s*#\s*\(else\|endif\)\>"
+syn region         glslCppOut              start="^\s*#\s*if\s\+0\+\>" end=".\|$" contains=glslCppOut2
+syn region         glslCppOut2             contained start="0" end="^\s*#\s*\(endif\>\|else\>\|elif\>\)" contains=glslSpaceError,glslCppSkip
+syn region         glslCppSkip             contained start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*#\s*endif\>" contains=glslSpaceError,glslCppSkip
+"syn match glslLineSkip        "\\$"
+syn cluster        glslPreProglslGroup     contains=glslPreCondit,glslIncluded,glslInclude,glslDefine,glslErrInParen,glslErrInBracket,glslUserLabel,glslSpecial,glslOctalZero,glslCppOut,glslCppOut2,glslCppSkip,glslFormat,glslNumber,glslFloat,glslOctal,glslOctalError,glslNumbersCom,glslString,glslCommentSkip,glslCommentString,glslComment2String,@glslCommentGroup,glslCommentStartError,glslParen,glslBracket,glslMulti
+syn region         glslDefine              start="^\s*#\s*\(define\|undef\)\>" skip="\\$" end="$" end="//"me=s-1 contains=ALLBUT,@glslPreProglslGroup
+syn region         glslPreProc             start="^\s*#\s*\(pragma\>\|line\>\|error\>\|version\>\|extension\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@glslPreProglslGroup
+
+" Highlight User Labels
+syn cluster        glslMultiGroup          contains=glslIncluded,glslSpecial,glslCommentSkip,glslCommentString,glslComment2String,@glslCommentGroup,glslCommentStartError,glslUserCont,glslUserLabel,glslBitField,glslOctalZero,glslCppOut,glslCppOut2,glslCppSkip,glslFormat,glslNumber,glslFloat,glslOctal,glslOctalError,glslNumbersCom,glslCppParen,glslCppBracket,glslCppString
+syn region         glslMulti               transparent start='?' skip='::' end=':' contains=ALLBUT,@glslMultiGroup
+" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
+syn cluster        glslLabelGroup          contains=glslUserLabel
+syn match          glslUserCont            display "^\s*\I\i*\s*:$" contains=@glslLabelGroup
+syn match          glslUserCont            display ";\s*\I\i*\s*:$" contains=@glslLabelGroup
+syn match          glslUserCont            display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@glslLabelGroup
+syn match          glslUserCont            display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@glslLabelGroup
+
+syn match          glslUserLabel           display "\I\i*" contained
+
+" Avoid recognizing most bitfields as labels
+syn match          glslBitField            display "^\s*\I\i*\s*:\s*[1-9]"me=e-1
+syn match          glslBitField            display ";\s*\I\i*\s*:\s*[1-9]"me=e-1
+
+syn keyword        glslState               gl_Position gl_PointSize gl_ClipVertex
+syn keyword        glslState               gl_FragCoord gl_FrontFacing gl_FragColor gl_FragData gl_FragDepth
+
+" vertex attributes
+syn keyword        glslState               gl_Color gl_SecondaryColor gl_Normal gl_Vertex gl_FogCoord
+syn match          glslState               display "gl_MultiTexCoord\d\+"
+
+" varying variables
+syn keyword        glslState               gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord
+
+" uniforms
+syn keyword        glslUniform             gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_NormalMatrix gl_TextureMatrix
+syn keyword        glslUniform             gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial
+syn keyword        glslUniform             gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct
+syn keyword        glslUniform             gl_FrontLightProduct gl_BackLightProduct glTextureEnvColor
+syn keyword        glslUniform             gl_TextureEnvColor gl_Fog
+syn match          glslUniform             display "gl_EyePlane[STRQ]"
+syn match          glslUniform             display "gl_ObjectPlane[STRQ]"
+syn keyword        glslUniform             gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse 
+syn keyword        glslUniform             gl_TextureMatrixInverse gl_ModelViewMatrixTranspose gl_ProjectionMatrixTranspose
+syn keyword        glslUniform             gl_ModelViewProjectionMatrixTranspose gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose
+syn keyword        glslUniform             gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose
+
+" uniform types
+syn keyword        glslType                gl_DepthRangeParameters gl_PointParameters gl_MaterialParameters
+syn keyword        glslType                gl_LightSourceParameters gl_LightModelParameters gl_LightModelProducts
+syn keyword        glslType                gl_LightProducts gl_FogParameters
+
+" constants
+syn keyword        glslConstant            gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs
+syn keyword        glslConstant            gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits
+syn keyword        glslConstant            gl_MaxCombinedTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents 
+syn keyword        glslConstant            gl_MaxDrawBuffers
+
+" swizzling
+syn match          glslSwizzle             /\.[xyzw]\{1,4\}\>/
+syn match          glslSwizzle             /\.[rgba]\{1,4\}\>/
+syn match          glslSwizzle             /\.[stpq]\{1,4\}\>/
+
+" built in functions
+syn keyword        glslFunc                radians degrees sin cos tan asin acos atan pow exp2 log2 sqrt inversesqrt
+syn keyword        glslFunc                abs sign floor ceil fract mod min max clamp mix step smoothstep 
+syn keyword        glslFunc                length distance dot cross normalize ftransform faceforward reflect
+syn keyword        glslFunc                matrixcompmult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not
+syn keyword        glslFunc                texture1D texture1DProj texture1DLod texture1DProjLod
+syn keyword        glslFunc                texture2D texture2DProj texture2DLod texture2DProjLod
+syn keyword        glslFunc                texture3D texture3DProj texture3DLod texture3DProjLod
+syn keyword        glslFunc                textureCube textureCubeLod
+syn keyword        glslFunc                shadow1D shadow1DProj shadow1DLod shadow1DProjLod
+syn keyword        glslFunc                shadow2D shadow2DProj shadow2DLod shadow2DProjLod
+syn keyword        glslFunc                dFdx dFdy fwidth noise1 noise2 noise3 noise4
+syn keyword        glslFunc                refract exp log
+
+" highlight unsupported keywords
+syn keyword        glslUnsupported         asm
+syn keyword        glslUnsupported         class union enum typedef template this packed
+syn keyword        glslUnsupported         goto switch default
+syn keyword        glslUnsupported         inline noinline volatile public static extern external interface
+syn keyword        glslUnsupported         long short double half fixed unsigned
+syn keyword        glslUnsupported         input output
+syn keyword        glslUnsupported         hvec2 hvec3 hvec4 dvec2 dvec3 dvec4 fvec2 fvec3 fvec4 
+syn keyword        glslUnsupported         sampler2DRect sampler3DRect sampler2DRectShadow
+syn keyword        glslUnsupported         sizeof cast
+syn keyword        glslUnsupported         namespace using
+
+"wtf?
+"let b:c_minlines = 50        " #if 0 constructs can be long
+"exec "syn sync ccomment glslComment minlines=" . b:c_minlines
+
+" Define the default highlighting.
+" For version 5.7 and earlier: only when not done already
+" For version 5.8 and later: only when an item doesn't have highlighting yet
+if version >= 508 || !exists("did_glsl_syn_inits")
+  if version < 508
+    let did_glsl_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink glslFormat                   glslSpecial
+  HiLink glslCppString                glslString
+  HiLink glslCommentL                 glslComment
+  HiLink glslCommentStart             glslComment
+  HiLink glslLabel                    Label
+  HiLink glslUserLabel                Label
+  HiLink glslConditional              Conditional
+  HiLink glslRepeat                   Repeat
+  HiLink glslCharacter                Character
+  HiLink glslSpecialCharacter         glslSpecial
+  HiLink glslNumber                   Number
+  HiLink glslOctal                    Number
+  HiLink glslOctalZero                PreProc         " link this to Error if you want
+  HiLink glslFloat                    Float
+  HiLink glslOctalError               glslError
+  HiLink glslParenError               glslError
+  HiLink glslErrInParen               glslError
+  HiLink glslErrInBracket             glslError
+  HiLink glslCommentError             glslError
+  HiLink glslCommentStartError        glslError
+  HiLink glslSpaceError               glslError
+  HiLink glslSpecialError             glslError
+  HiLink glslOperator                 Operator
+  HiLink glslStructure                Structure
+  HiLink glslStorageClass             StorageClass
+  HiLink glslInclude                  Include
+  HiLink glslPreProc                  PreProc
+  HiLink glslDefine                   Macro
+  HiLink glslIncluded                 glslString
+  HiLink glslError                    Error
+  HiLink glslStatement                Statement
+  HiLink glslPreCondit                PreCondit
+  HiLink glslType                     Type
+  HiLink glslConstant                 Constant
+  HiLink glslCommentString            glslString
+  HiLink glslComment2String           glslString
+  HiLink glslCommentSkip              glslComment
+  HiLink glslString                   String
+  HiLink glslComment                  Comment
+  HiLink glslSpecial                  SpecialChar
+  HiLink glslSwizzle                  SpecialChar
+  HiLink glslTodo                     Todo
+  HiLink glslCppSkip                  glslCppOut
+  HiLink glslCppOut2                  glslCppOut
+  HiLink glslCppOut                   Comment
+  HiLink glslUniform                  glslType
+  HiLink glslState                    glslType
+  HiLink glslFunc                     glslStatement
+  HiLink glslUnsupported              glslError
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "glsl"
+
+" vim: ts=8

+ 1 - 0
vim/syntax/go.vim

@@ -0,0 +1 @@
+/home/raylu/go/misc/vim/syntax/go.vim

+ 104 - 0
vim/syntax/markdown.vim

@@ -0,0 +1,104 @@
+" Vim syntax file
+" Language:     Markdown
+" Author:       Ben Williams <benw@plasticboy.com>
+" Maintainer:   Hallison Batista <email@hallisonbatista.com>
+" URL:          http://plasticboy.com/markdown-vim-mode/
+" Version:      1.0.1
+" Last Change:  Fri Dec  4 08:36:48 AMT 2009
+" Remark:       Uses HTML syntax file
+" Remark:       I don't do anything with angle brackets (<>) because that would too easily
+"               easily conflict with HTML syntax
+" TODO: Handle stuff contained within stuff (e.g. headings within blockquotes)
+
+" Read the HTML syntax to start with
+if version < 600
+  so <sfile>:p:h/html.vim
+else
+  runtime! syntax/html.vim
+  unlet b:current_syntax
+endif
+
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+" Don't use standard HiLink, it will not work with included syntax files
+if version < 508
+  command! -nargs=+ HtmlHiLink hi link <args>
+else
+  command! -nargs=+ HtmlHiLink hi def link <args>
+endif
+
+syntax spell toplevel
+syntax case ignore
+syntax sync linebreaks=1
+
+" Additions to HTML groups
+syntax region htmlBold    start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\*\@!/  end=/\\\@<!\*\@<!\*\*\*\@!\($\|\A\)\@=/  contains=htmlItalic,@Spell
+syntax region htmlItalic  start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\@!/    end=/\\\@<!\*\@<!\*\*\@!\($\|\A\)\@=/    contains=htmlBold,@Spell
+syntax region htmlBold    start=/\\\@<!\(^\|\A\)\@=_\@<!___\@!/      end=/\\\@<!_\@<!___\@!\($\|\A\)\@=/      contains=htmlItalic,@Spell
+syntax region htmlItalic  start=/\\\@<!\(^\|\A\)\@=_\@<!__\@!/       end=/\\\@<!_\@<!__\@!\($\|\A\)\@=/       contains=htmlBold,@Spell
+
+" [link](URL) | [link][id] | [link][]
+syntax region mkdLink matchgroup=mkdDelimiter start="\!\?\["  end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite oneline
+syntax region mkdID   matchgroup=mkdDelimiter start="\["      end="\]" contained
+syntax region mkdURL  matchgroup=mkdDelimiter start="("       end=")"  contained
+
+" Link definitions: [id]: URL (Optional Title)
+" TODO handle automatic links without colliding with htmlTag (<URL>)
+syntax region mkdLinkDef matchgroup=mkdDelimiter   start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite
+syntax region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]"   contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline
+syntax region mkdLinkTitle matchgroup=mkdDelimiter start=+"+     end=+"+  contained
+syntax region mkdLinkTitle matchgroup=mkdDelimiter start=+'+     end=+'+  contained
+syntax region mkdLinkTitle matchgroup=mkdDelimiter start=+(+     end=+)+  contained
+
+" Define Markdown groups
+syntax match  mkdLineContinue ".$" contained
+syntax match  mkdRule      /^\s*\*\s\{0,1}\*\s\{0,1}\*$/
+syntax match  mkdRule      /^\s*-\s\{0,1}-\s\{0,1}-$/
+syntax match  mkdRule      /^\s*_\s\{0,1}_\s\{0,1}_$/
+syntax match  mkdRule      /^\s*-\{3,}$/
+syntax match  mkdRule      /^\s*\*\{3,5}$/
+syntax match  mkdListItem  "^\s*[-*+]\s\+"
+syntax match  mkdListItem  "^\s*\d\+\.\s\+"
+syntax match  mkdCode      /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/
+syntax match  mkdLineBreak /  \+$/
+syntax region mkdCode       start=/\\\@<!`/     end=/\\\@<!`/
+syntax region mkdCode       start=/\s*``[^`]*/  end=/[^`]*``\s*/
+syntax region mkdBlockquote start=/^\s*>/       end=/$/           contains=mkdLineBreak,mkdLineContinue,@Spell
+syntax region mkdCode       start="<pre[^>]*>"  end="</pre>"
+syntax region mkdCode       start="<code[^>]*>" end="</code>"
+
+" HTML headings
+syntax region htmlH1       start="^\s*#"                   end="\($\|#\+\)" contains=@Spell
+syntax region htmlH2       start="^\s*##"                  end="\($\|#\+\)" contains=@Spell
+syntax region htmlH3       start="^\s*###"                 end="\($\|#\+\)" contains=@Spell
+syntax region htmlH4       start="^\s*####"                end="\($\|#\+\)" contains=@Spell
+syntax region htmlH5       start="^\s*#####"               end="\($\|#\+\)" contains=@Spell
+syntax region htmlH6       start="^\s*######"              end="\($\|#\+\)" contains=@Spell
+syntax match  htmlH1       /^.\+\n=\+$/ contains=@Spell
+syntax match  htmlH2       /^.\+\n-\+$/ contains=@Spell
+
+"highlighting for Markdown groups
+HtmlHiLink mkdString        String
+HtmlHiLink mkdCode          String
+HtmlHiLink mkdBlockquote    Comment
+HtmlHiLink mkdLineContinue  Comment
+HtmlHiLink mkdListItem      Identifier
+HtmlHiLink mkdRule          Identifier
+HtmlHiLink mkdLineBreak     Todo
+HtmlHiLink mkdLink          htmlLink
+HtmlHiLink mkdURL           htmlString
+HtmlHiLink mkdID            Identifier
+HtmlHiLink mkdLinkDef       mkdID
+HtmlHiLink mkdLinkDefTarget mkdURL
+HtmlHiLink mkdLinkTitle     htmlString
+
+HtmlHiLink mkdDelimiter     Delimiter
+
+let b:current_syntax = "markdown"
+
+delcommand HtmlHiLink
+" vim: tabstop=2

+ 45 - 0
vimrc

@@ -0,0 +1,45 @@
+set vb t_vb=
+set backspace=indent,eol,start
+set incsearch
+set smartcase
+set ignorecase
+set hlsearch
+set nowrap
+set scrolloff=5
+set tabstop=4
+set shiftwidth=4
+set wildmode=longest,list
+set background=dark
+set spelllang=en_us
+set foldminlines=2
+set foldnestmax=1
+set modeline
+set keywordprg=man\ -s
+set mouse=
+set linebreak
+set t_Co=256
+
+set backupdir=$HOME/.vim_swap//,/tmp
+set directory=$HOME/.vim_swap//,/tmp
+
+map <ESC>u :nohlsearch<CR>
+map j gj
+map k gk
+map Q ZQ
+map \l :w<CR>:make<CR>
+map - $
+map <C-n> gt
+map <C-p> gT
+vmap P "_dp
+
+filetype plugin indent on
+syntax on
+
+au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl
+
+autocmd FileType c,perl,php,java,glsl set cindent foldmethod=syntax
+autocmd FileType cpp set cindent foldmethod=syntax foldnestmax=0
+autocmd FileType python,sh set autoindent foldmethod=syntax
+autocmd FileType tex,latex set wrap showbreak=+ spell makeprg=pdflatex\ -interaction=nonstopmode\ %
+autocmd FileType sml set autoindent
+autocmd FileType java set foldmethod=syntax foldnestmax=2

+ 98 - 0
zshrc

@@ -0,0 +1,98 @@
+eval "$(dircolors -b ~/.dircolors)"
+
+autoload -Uz compinit
+compinit
+zmodload -a complist
+zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
+zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
+zstyle ':completion:*' use-compctl false
+zstyle :compinstall filename '/home/raylu/.zshrc'
+
+HISTFILE=~/.histfile
+HISTSIZE=1000
+SAVEHIST=5000
+
+setopt no_beep
+setopt extendedglob
+#setopt print_exit_value
+setopt prompt_subst
+setopt complete_in_word
+setopt no_auto_menu
+setopt no_always_last_prompt
+setopt share_history
+setopt hist_ignore_dups
+setopt hist_ignore_space
+setopt extended_history
+setopt promptsubst
+
+autoload -U edit-command-line
+zle -N edit-command-line
+bindkey -e
+bindkey '^[[3~' delete-char
+bindkey '\C-v' edit-command-line
+bindkey '^[[1;5C' forward-word
+bindkey '^[[1;5D' backward-word
+
+autoload colors
+colors
+bright_cyan='%{%}' # not provided by colors
+PROMPT="%{${fg_bold[green]}%}%m%{${reset_color}%}:%{${fg_bold[blue]}%}%30<...<%~%<<%{${reset_color}%}%(!.#.\$) "
+# exit status
+RPROMPT="%(?..%{$fg_bold[red]%}%? %{$reset_color%})"
+# suspended jobs
+RPROMPT+="%1(j.%{$fg[green]%}%j .)"
+# git branch
+autoload -Uz vcs_info
+zstyle ':vcs_info:*' unstagedstr "%{$fg[red]%}*"
+zstyle ':vcs_info:*' stagedstr "%{$fg[red]%}+"
+zstyle ':vcs_info:*' formats "$bright_cyan%b%u%c"
+zstyle ':vcs_info:*' actionformats "$bright_cyan%b%u%c|%a"
+zstyle ':vcs_info:git:*' check-for-changes true
+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b:%r'
+zstyle ':vcs_info:bzr:*' use-simple true
+zstyle ':vcs_info:*' enable git hg bzr svn cvs
+precmd () { vcs_info }
+RPROMPT+='${vcs_info_msg_0_}'
+RPROMPT+="%{$reset_color%}"
+
+export EDITOR=vim
+export MANPAGER="/bin/sh -c \"col -bx | vim -R -c 'set ft=man nomod nolist' -c 'map q :q<CR>' -\""
+export GREP_COLORS='ms=01;36:mc=01;31:sl=:cx=:fn=35:ln=33:bn=33:se=01;34'
+
+alias ls='ls --color=auto -hv'
+alias ll='ls -l'
+alias l.='ls -Ad .*'
+alias la='ls -A'
+alias grep='grep --color -nTs'
+alias df='df -hx tmpfs'
+alias du='du --max-depth=1'
+alias mp='~/mplayer/mplayer/mplayer'
+alias manmp='man -l ~/mplayer/mplayer/DOCS/man/en/mplayer.1'
+alias mencoder='~/mplayer/mplayer/mencoder'
+alias x264='~/x264/x264'
+alias gil='git log --graph --abbrev-commit --stat --decorate --patience'
+alias gib='git branch -a'
+alias gis='git status'
+alias gid='git diff --patience'
+alias giw='git show --patience'
+alias gic='git checkout'
+alias class='xprop -notype WM_CLASS'
+alias tree='tree -AvL 10'
+alias vil='vi *(.om[1])'
+alias dt='gnome-terminal --hide-menubar'
+alias archvm='kvm -hda arch.qcow -net nic -net user,hostfwd=tcp::8080-:80,hostfwd=tcp::2222-:22'
+function cl() {
+	if [ $# = 0 ]; then
+		cd && ls
+	else
+		cd "$*" && ls
+	fi
+}
+function pdf() {
+	evince "$*" &> /dev/null &!
+}
+
+export GOROOT=$HOME/go
+
+PATH=/usr/lib/ccache:$PATH:/home/raylu/go/bin:/sbin:/usr/sbin
+export XLISPPATH=~/nyquist/runtime:~/nyquist/lib