import all my dotfiles, awesome included.
authorPierre Habouzit <madcoder@debian.org>
Wed, 18 Mar 2009 11:46:32 +0000 (12:46 +0100)
committerPierre Habouzit <madcoder@debian.org>
Wed, 18 Mar 2009 12:28:31 +0000 (13:28 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
70 files changed:
+bin/git-new-workdir [new file with mode: 0755]
+bin/git-up [new file with mode: 0755]
+bin/gitk [new file with mode: 0755]
+bin/madconf [new file with mode: 0755]
XCompose [new file with mode: 0644]
Xkeyboard [new file with mode: 0644]
Xresources [new file with mode: 0644]
Xsession [new file with mode: 0755]
bash_profile [new file with mode: 0644]
caffrc [new file with mode: 0644]
config/awesome/rc.lua [new file with mode: 0644]
config/terminfo/r/rxvt-unicode [new file with mode: 0644]
config/zsh/10_zshopts [new file with mode: 0644]
config/zsh/20_environment [new file with mode: 0644]
config/zsh/30_binds [new file with mode: 0644]
config/zsh/40_completion [new file with mode: 0644]
config/zsh/50_aliases [new file with mode: 0644]
config/zsh/60_prompt [new file with mode: 0644]
devscripts [new file with mode: 0644]
gitconfig [new file with mode: 0644]
gnupg/gpg.conf [new file with mode: 0644]
gtkrc [new file with mode: 0644]
gtkrc-2.0 [new symlink]
pbuilder/B90_list_missing [new file with mode: 0755]
pbuilder/B91_lintian [new file with mode: 0755]
pbuilder/C10_launch_shell [new file with mode: 0755]
pbuilder/D10_use_result [new file with mode: 0755]
pbuilderrc [new file with mode: 0644]
quiltrc [new file with mode: 0644]
reportbugrc [new file with mode: 0644]
screenrc [new file with mode: 0644]
signature [new file with mode: 0644]
signature.is [new file with mode: 0644]
signature.pv [new file with mode: 0644]
ssh/authorized_keys [new file with mode: 0644]
ssh/config [new file with mode: 0644]
ssh/environment [new file with mode: 0644]
toprc [new file with mode: 0644]
vim/filetype.vim [new file with mode: 0644]
vim/ftplugin/debhints.vim [new file with mode: 0644]
vim/ftplugin/dosini.vim [new file with mode: 0644]
vim/ftplugin/gitcommit.vim [new file with mode: 0644]
vim/ftplugin/html.vim [new symlink]
vim/ftplugin/mail/Mail_Re_set.vim [new file with mode: 0644]
vim/ftplugin/man.vim [new file with mode: 0644]
vim/ftplugin/smarty.vim [new symlink]
vim/ftplugin/tex.vim [new file with mode: 0644]
vim/ftplugin/xhtml.vim [new symlink]
vim/ftplugin/xml.vim [new symlink]
vim/indent/mail.vim [new file with mode: 0644]
vim/jptemplate/c/inc [new file with mode: 0644]
vim/jptemplate/c/main [new file with mode: 0644]
vim/jptemplate/cpp [new symlink]
vim/jptemplate/tex/frame [new file with mode: 0644]
vim/jptemplate/tex/itemize [new file with mode: 0644]
vim/plugin/BlockComment.vim [new file with mode: 0644]
vim/plugin/ZoomWin.vim [new file with mode: 0644]
vim/plugin/file:line.vim [new file with mode: 0644]
vim/plugin/jptemplate.vim [new file with mode: 0644]
vim/plugin/vis.vim [new file with mode: 0644]
vim/syntax/actionscript.vim [new file with mode: 0644]
vim/syntax/c.vim [new file with mode: 0644]
vim/syntax/debhints.vim [new file with mode: 0644]
vim/syntax/javascript.vim [new file with mode: 0644]
vim/syntax/mail.vim [new file with mode: 0644]
vim/syntax/make.vim [new file with mode: 0644]
vim/syntax/massif.vim [new file with mode: 0644]
vimrc [new file with mode: 0644]
zshenv [new file with mode: 0644]
zshrc [new file with mode: 0644]

diff --git a/+bin/git-new-workdir b/+bin/git-new-workdir
new file mode 100755 (executable)
index 0000000..2838546
--- /dev/null
@@ -0,0 +1,82 @@
+#!/bin/sh
+
+usage () {
+       echo "usage:" $@
+       exit 127
+}
+
+die () {
+       echo $@
+       exit 128
+}
+
+if test $# -lt 2 || test $# -gt 3
+then
+       usage "$0 <repository> <new_workdir> [<branch>]"
+fi
+
+orig_git=$1
+new_workdir=$2
+branch=$3
+
+# want to make sure that what is pointed to has a .git directory ...
+git_dir=$(cd "$orig_git" 2>/dev/null &&
+  git rev-parse --git-dir 2>/dev/null) ||
+  die "\"$orig_git\" is not a git repository!"
+
+case "$git_dir" in
+.git)
+       git_dir="$orig_git/.git"
+       ;;
+.)
+       git_dir=$orig_git
+       ;;
+esac
+
+# don't link to a configured bare repository
+isbare=$(git --git-dir="$git_dir" config --bool --get core.bare)
+if test ztrue = z$isbare
+then
+       die "\"$git_dir\" has core.bare set to true," \
+               " remove from \"$git_dir/config\" to use $0"
+fi
+
+# don't link to a workdir
+if test -L "$git_dir/config"
+then
+       die "\"$orig_git\" is a working directory only, please specify" \
+               "a complete repository."
+fi
+
+# don't recreate a workdir over an existing repository
+if test -e "$new_workdir"
+then
+       die "destination directory '$new_workdir' already exists."
+fi
+
+# make sure the the links use full paths
+git_dir=$(cd "$git_dir"; pwd)
+
+# create the workdir
+mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!"
+
+# create the links to the original repo.  explictly exclude index, HEAD and
+# logs/HEAD from the list since they are purely related to the current working
+# directory, and should not be shared.
+for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache
+do
+       case $x in
+       */*)
+               mkdir -p "$(dirname "$new_workdir/.git/$x")"
+               ;;
+       esac
+       ln -s "$git_dir/$x" "$new_workdir/.git/$x"
+done
+
+# now setup the workdir
+cd "$new_workdir"
+# copy the HEAD from the original repository as a default branch
+cp "$git_dir/HEAD" .git/HEAD
+# checkout the branch (either the same as HEAD from the original repository, or
+# the one that was asked for)
+git checkout -f $branch
diff --git a/+bin/git-up b/+bin/git-up
new file mode 100755 (executable)
index 0000000..06a2c71
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+OPTIONS_SPEC="\
+$(basename $0) [options] [<remote> [<branch>]]
+--
+k,gitk      visualize unmerged differences
+r,rebase    perform a rebase
+m,merge     perform a merge
+"
+SUBDIRECTORY_OK=t
+. git-sh-setup
+require_work_tree
+
+lbranch=$(git symbolic-ref HEAD | sed -e s~refs/heads/~~)
+remote=$(git config --get "branch.$lbranch.remote" || echo origin)
+branch=$(git config --get "branch.$lbranch.merge" || echo "refs/heads/$lbranch")
+
+case "$(git config --bool --get madcoder.up-gitk)" in
+    true) gitk=gitk;;
+    *)    gitk=:
+esac
+case "$(git config --bool --get "branch.$lbranch.rebase")" in
+    true) action=rebase;;
+    *)    action=;;
+esac
+
+while test $# != 0; do
+    case "$1" in
+        -k|--gitk)
+            shift; gitk=gitk;;
+        --no-gitk)
+            shift; gitk=:;;
+        -r|--rebase)
+            shift; action=rebase;;
+        --no-rebase)
+            shift; rebase=${rebase#rebase};;
+        -m|--merge)
+            shift; action=merge;;
+        --no-merge)
+            shift; rebase=${rebase#merge};;
+        --)
+            shift; break;;
+        *)
+            usage;;
+    esac
+done
+
+case $# in
+    0) ;;
+    1) remote="$1";;
+    2) remote="$1"; branch="$2";;
+    *) usage;;
+esac
+
+git fetch "${remote}"
+if test `git rev-list .."${remote}/${branch#refs/heads/}" -- | wc -l` = 0; then
+    echo "Current branch $lbranch is up to date."
+    exit 0
+fi
+
+$gitk HEAD..."${remote}/${branch#refs/heads/}" --
+if test -z "$action"; then
+    echo -n "(r)ebase/(m)erge/(q)uit ? "
+    read ans
+    case "$ans" in
+        r*) action=rebase;;
+        m*) action=merge;;
+        *)  exit 0;;
+    esac
+fi
+
+unclean=
+git rev-parse --verify HEAD > /dev/null && \
+    git update-index --refresh && \
+    git diff-files --quiet && \
+    git diff-index --cached --quiet HEAD -- || unclean=t
+
+case "$action" in
+    rebase)
+        test -z "$unclean" || git stash save "git-up stash"
+        git rebase "${remote}/${branch#refs/heads/}"
+        ;;
+    merge)
+        test -z "$unclean" || git stash save "git-up stash"
+        git merge "${remote}/${branch#refs/heads/}"
+        ;;
+    *)
+        echo 1>&2 "no action specified"
+        exit 1
+        ;;
+esac
+
+if test -n "$unclean"; then
+    if test  -d "$(git rev-parse --git-dir)/../.dotest"; then
+        echo ""
+        echo "run 'git stash apply' when rebase is finished"
+    else
+        git stash apply
+    fi
+fi
diff --git a/+bin/gitk b/+bin/gitk
new file mode 100755 (executable)
index 0000000..ed958e6
--- /dev/null
+++ b/+bin/gitk
@@ -0,0 +1,4 @@
+#!/bin/sh
+gitk=~/dev/scm/git/gitk-git/gitk-wish
+test -x $gitk && exec $gitk "$@"
+/usr/bin/gitk "$@"
diff --git a/+bin/madconf b/+bin/madconf
new file mode 100755 (executable)
index 0000000..1e35d64
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+dotfiles="$(dirname "$(dirname "$(readlink -f "$0")")")"
+
+dot_ln() {
+    rel="$(echo "${1#$dotfiles/}" | sed -e 's~[^/]\+~..~g')/"
+    ln -s "${rel#../}${1#$HOME/}" "$HOME/$2"
+}
+
+find $dotfiles -mindepth 1 -type d \( -name '[+.]*' -prune -o -print \) | while read d; do
+    mkdir -p "$HOME/.${d#$dotfiles/}"
+done
+
+find $dotfiles -mindepth 1 -maxdepth 1 -type d -name '+*' | while read d; do
+    rm -f "$HOME/${d#$dotfiles/+}"
+    dot_ln "$d" "${d#$dotfiles/+}"
+done
+
+find $dotfiles -mindepth 1 \( -name '[+.]*' -prune -o -not -type d -print \) | while read f; do
+    rm -f "$HOME/.${f#$dotfiles/}"
+    dot_ln "$f" ".${f#$dotfiles/}"
+done
+
+for cache in zsh rlwrap ccache; do
+    mkdir -p "$HOME/.cache/$cache"
+done
diff --git a/XCompose b/XCompose
new file mode 100644 (file)
index 0000000..c412a9b
--- /dev/null
+++ b/XCompose
@@ -0,0 +1,12 @@
+include "%L"
+
+<Multi_key> <3> <period>        : "…" U2026 # HORIZONTAL ELLIPSIS
+<Multi_key> <i> <j>             : "ij" U0133 # LATIN SMALL LIGATURE IJ
+<Multi_key> <question> <exclam> : "‽" U203D # INTERROBANG
+<Multi_key> <exclam> <question> : "‽" U203D # INTERROBANG
+<Multi_key> <8> <8>             : "∞"
+<Multi_key> <less> <3>          : "❤"
+<Multi_key> <less> <minus>      : "←"
+<Multi_key> <minus> <greater>   : "→"
+<Multi_key> <bar> <asciicircum> : "↑"
+<Multi_key> <bar> <V>           : "↓"
diff --git a/Xkeyboard b/Xkeyboard
new file mode 100644 (file)
index 0000000..cf78dba
--- /dev/null
+++ b/Xkeyboard
@@ -0,0 +1,25 @@
+default xkb_keymap "mad_fr" {
+    xkb_keycodes  { include "xfree86+aliases(qwerty)" };
+    xkb_types     { include "complete" };
+    xkb_compat    { include "complete" };
+    xkb_symbols   {
+        include "pc(pc105)+us+inet(logiaccess)"
+        key <CAPS> { [ Super_L,   Super_L   ] };
+        key <LWIN> { [ Super_L,   Super_L   ] };
+
+        key <RALT> { [ Multi_key, Multi_key ] };
+        key <RWIN> { [ Multi_key, Multi_key ] };
+        key <RCTL> { [ Insert,    Insert    ] };
+        key <MENU> { [ Multi_key, Multi_key ] };
+        modifier_map Lock    { <foo> };
+        modifier_map Control { <LCTL>, Control_L };
+        modifier_map Mod1    { <LALT>, Alt_L };
+        modifier_map Mod2    { Num_Lock };
+        modifier_map Mod3    { <foo3> };
+        modifier_map Mod4    { <LWIN>, <CAPS>, Super_L };
+        modifier_map Mod5    { <foo5> };
+    };
+    xkb_geometry  { include "pc(pc105)" };
+};
+
+// vim:set ft=xkb:
diff --git a/Xresources b/Xresources
new file mode 100644 (file)
index 0000000..df3bffd
--- /dev/null
@@ -0,0 +1,79 @@
+Xft.dpi: 75
+
+/* XTerm */
+*VT100*font:   -xos4-terminus-medium-r-normal-*-*-*-*-*-c-*-iso10646-1
+*VT100*font2:  -xos4-terminus-medium-r-normal-*-*-*-*-*-c-*-iso10646-1
+*VT100*font3:  -xos4-terminus-medium-r-normal-*-*-*-*-*-c-*-iso10646-1
+*VT100*font4:  -xos4-terminus-medium-r-normal-*-*-*-*-*-c-*-iso10646-1
+*VT100*font5:  -xos4-terminus-medium-r-normal-*-*-*-*-*-c-*-iso10646-1
+*VT100*font6:  -xos4-terminus-medium-r-normal-*-*-*-*-*-c-*-iso10646-1
+
+*metaSendsEscape: true
+
+*VT100*boldColors: true
+*VT100*boldMode: false
+*VT100*colorBDMode: true
+
+*VT100*foreground: rgb:bb/bb/bb
+*VT100*background: rgb:0/0/0f
+
+*VT100*color0: rgb:0/0/0
+*VT100*color1: rgb:b2/18/18
+*VT100*color2: rgb:18/b2/18
+*VT100*color3: rgb:b2/68/18
+*VT100*color4: rgb:30/30/b0
+*VT100*color5: rgb:b2/18/b2
+*VT100*color6: rgb:18/b2/b2
+*VT100*color7: rgb:b2/b2/b2
+*VT100*color8: rgb:68/68/68
+*VT100*color9: rgb:ff/54/54
+*VT100*color10: rgb:54/ff/54
+*VT100*color11: rgb:ff/ff/54
+*VT100*color12: rgb:5c/80/ff
+*VT100*color13: rgb:ff/54/ff
+*VT100*color14: rgb:54/ff/ff
+*VT100*color15: rgb:ff/ff/ff
+
+*charClass: 33:48,35:48,37-38:48,43-47:48,58:48,61:48,63-64:48,95:48,126:48
+
+URxvt.cutchars: "`\"'()*,;<>[]{|}"
+URxvt.font:            -xos4-terminus-*-r-*-*-*-*-*-*-*-*-iso10646-*
+URxvt.boldFfont:       -xos4-terminus-*-r-*-*-*-*-*-*-*-*-iso10646-*
+URxvt.color0: rgb:0/0/0
+URxvt.color1: rgb:b2/18/18
+URxvt.color2: rgb:18/b2/18
+URxvt.color3: rgb:b2/68/18
+URxvt.color4: rgb:30/30/b0
+URxvt.color5: rgb:b2/18/b2
+URxvt.color6: rgb:18/b2/b2
+URxvt.color7: rgb:b2/b2/b2
+URxvt.color8: rgb:68/68/68
+URxvt.color9: rgb:ff/54/54
+URxvt.color10: rgb:54/ff/54
+URxvt.color11: rgb:ff/ff/54
+URxvt.color12: rgb:5c/80/ff
+URxvt.color13: rgb:ff/54/ff
+URxvt.color14: rgb:54/ff/ff
+URxvt.color15: rgb:ff/ff/ff
+URxvt.foreground: rgb:bb/bb/bb
+URxvt.background: rgb:0/0/0f
+URxvt.colorBD: white
+URxvt.intensityStyles: true
+
+URxvt.borderLess: true
+URxvt.perl-ext: default
+
+URxvt.reverseVideo: false
+URxvt.scrollstyle: plain
+URxvt.scrollBar: false
+URxvt.scrollTtyOutput: false
+URxvt.scrollWithBuffer: false
+URxvt.scrollTtyKeypress: true
+URxvt.saveLines: 20000
+URxvt.insecure: true
+URxvt.meta8: false
+URxvt.mouseWheelScrollPage: false
+
+URxvt.cursorColor:  rgb:bb/bb/bb
+URxvt.pointerColor: rgb:bb/bb/bb
+URxvt.secondaryScroll: true
diff --git a/Xsession b/Xsession
new file mode 100755 (executable)
index 0000000..467207d
--- /dev/null
+++ b/Xsession
@@ -0,0 +1,13 @@
+#! /bin/zsh
+
+. ~/.zsh/20_environment
+
+xkbcomp -w 0 -R/usr/share/X11/xkb ~/.Xkeyboard :0
+
+for applet in kerneloops-applet nm-applet klipper unclutter; do
+    which $applet 1>/dev/null 2>&1 && (sleep 3 && $applet)&
+done
+
+xsetroot -solid rgb:00/00/0f
+xscreensaver -nosplash &!
+exec awesome
diff --git a/bash_profile b/bash_profile
new file mode 100644 (file)
index 0000000..404c346
--- /dev/null
@@ -0,0 +1,18 @@
+# ~/.bash_profile: executed by bash(1) for login shells.
+# see /usr/share/doc/bash/examples/startup-files for examples.
+# the files are located in the bash-doc package.
+
+# the default umask is set in /etc/login.defs
+#umask 022
+
+[ -x /bin/zsh ] && exec zsh -i
+
+# include .bashrc if it exists
+if [ -f ~/.bashrc ]; then
+    . ~/.bashrc
+fi
+
+# set PATH so it includes user's private bin if it exists
+if [ -d ~/bin ] ; then
+    PATH=~/bin:"${PATH}"
+fi
diff --git a/caffrc b/caffrc
new file mode 100644 (file)
index 0000000..e0f5221
--- /dev/null
+++ b/caffrc
@@ -0,0 +1,7 @@
+# .caffrc -- vim:syntax=perl:
+# This file is in perl(1) format - see caff(1) for details.
+
+$CONFIG{'owner'}       = 'Pierre habouzit';
+$CONFIG{'email'}       = 'madcoder@debian.org';
+$CONFIG{'keyid'}       = [ qw{BC6AFB5BA1EE761C} ];
+$CONFIG{'keyserver'}   = 'pgpkeys.mit.edu';
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua
new file mode 100644 (file)
index 0000000..cccf459
--- /dev/null
@@ -0,0 +1,479 @@
+-- awesome 3 configuration file
+
+-- Include awesome library, with lots of useful function!
+require("awful")
+require("eminent")
+require("wicked")
+require("beautiful")
+
+function table.append(t, ...)
+    for _, v in ipairs({...}) do
+        table.insert(t, v)
+    end
+end
+
+terminal = "x-terminal-emulator"
+lock     = 'xscreensaver-command -lock'
+beautiful.init(awful.util.getdir("config").."/theme")
+
+-- {{{ Modkeys
+modkey = "Mod4"
+shift = "Shift"
+alt = "Mod1"
+control = "Control"
+
+k_n  = {}
+k_m  = {modkey}
+k_ms = {modkey, shift}
+k_ma = {modkey, alt}
+k_mc = {modkey, control}
+k_a  = {alt}
+k_ac = {alt, control}
+k_c  = {control}
+k_cs = {control, shift}
+k_s = {shift}
+
+-- }}}
+
+-- {{{ Markup helper functions
+-- Inline markup is a tad ugly, so use these functions
+-- to dynamically create markup.
+function fg(color, text)
+    return '<span color="'..color..'">'..text..'</span>'
+end
+
+function heading(text)
+    return fg(beautiful.fg_focus, text)
+end
+
+-- }}}
+-- {{{ Functions
+-- Toggle whether we're viewing a tag
+function tag_toggleview(tag)
+    tag:view(not tag:isselected())
+end
+
+-- Get the screen number we're on
+function getscreen()
+    local sel = client.focus
+    return (sel and sel.screen) or mouse.screen
+end
+
+-- Move current client to a specific screen
+function client_movetoscreen(i)
+    client.focus.screen = i
+end
+
+-- }}}
+-- {{{ Set tag names
+
+for s = 1, screen.count() do
+    eminent.newtag(s, 5)
+    for i = 1, 10 do
+        eminent.tag.name(i, s, 'work-'..i)
+    end
+end
+
+-- }}}
+-- {{{ Taglist
+
+maintaglist = {}
+maintaglist.buttons = {
+    button(k_n, 1, awful.tag.viewonly),
+    button(k_s, 1, awful.client.toggletag)
+}
+
+-- }}}
+-- {{{ Widgets
+
+-- {{{ Load Averages Widget
+
+loadwidget = widget({
+    type = 'textbox',
+    name = 'gpuwidget',
+    align = 'right'
+})
+
+wicked.register(loadwidget, 'function', function (widget, args)
+    -- Use /proc/loadavg to get the average system load on 1, 5 and 15 minute intervals
+    local f = io.open('/proc/loadavg')
+    local n = f:read()
+    f:close()
+
+    -- Find the third space
+    local pos = n:find(' ', n:find(' ', n:find(' ')+1)+1)
+
+    return heading('Load')..': '..n:sub(1,pos-1)
+
+end, 2)
+
+-- }}}
+-- {{{ CPU Usage Widget
+
+cputextwidget = widget({
+    type = 'textbox',
+    name = 'cputextwidget',
+    align = 'right'
+})
+
+cputextwidget.text = heading('CPU')..': 00% '
+wicked.register(cputextwidget, 'cpu', function (widget, args)
+    local r = tonumber(args[1])
+    local percent = args[1]..'%'
+    if r < 10 then
+        percent = '0'..percent
+    end
+    if r < 25 then
+        percent = fg('green', percent)
+    elseif r < 50 then
+        percent = fg('yellow', percent)
+    elseif r < 75 then
+        percent = fg('orange', percent)
+    else
+        percent = fg('red', percent)
+    end
+    return heading('CPU')..': '..percent..' '
+end, 2)
+
+-- }}}
+-- {{{ CPU Graph Widget
+
+cpugraphwidget = widget({
+    type = 'graph',
+    name = 'cpugraphwidget',
+    align = 'right'
+})
+
+cpugraphwidget.height = 0.85
+cpugraphwidget.width = 45
+cpugraphwidget.bg = '#333333'
+cpugraphwidget.border_color = '#0a0a0a'
+cpugraphwidget.grow = 'right'
+
+cpugraphwidget:plot_properties_set('cpu', {
+    fg = '#AEC6D8',
+    fg_center = '#285577',
+    fg_end = '#285577',
+    vertical_gradient = false
+})
+
+wicked.register(cpugraphwidget, 'cpu', '$1', 2, 'cpu')
+
+-- }}}
+-- {{{ Memory Usage Widget
+
+memtextwidget = widget({
+    type = 'textbox',
+    name = 'memtextwidget',
+    align = 'right'
+})
+
+memtextwidget.text = heading('MEM')..': '
+wicked.register(memtextwidget, 'mem', function (widget, args)
+    -- Add extra preceding zeroes when needed
+    local r = tonumber(args[1])
+    local percent = args[1]..'%'
+    if r < 10 then
+        percent = '0'..percent
+    end
+    if r < 50 then
+        percent = fg('green', percent)
+    elseif r < 80 then
+        percent = fg('orange', percent)
+    else
+        percent = fg('red', percent)
+    end
+    return heading('MEM')..': '..percent..' '..args[2]..'M'
+end, 2)
+
+-- }}}
+-- {{{ Battery widget
+--[[
+batterywidget = widget({
+    type = 'textbox',
+    name = 'batterywidget',
+    align = 'right'
+})
+
+function batterywidget_update()
+    local v = io.popen("powersave -b|sed -ne 's/.*Remaining percent: \\(.*\\)/\\1/p'"):read()
+    local r = tonumber(v)
+
+    percent = v
+    if r < 10 then
+        percent = fg('red', percent)
+    elseif r < 25 then
+        percent = fg('orange', percent)
+    else
+        percent = fg('green', percent)
+    end
+    batterywidget.text = heading('BAT')..': '..percent
+end
+batterywidget_update()
+awful.hooks.timer.register(30, batterywidget_update)
+--]]
+-- }}}
+-- {{{ spacers
+
+rspacer = widget({ type = 'textbox', name = 'rspacer', align = 'right' })
+rspacer.text = " │ "
+
+-- }}}
+-- {{{ Clock
+clockwidget = widget({ type = "textbox", name = "clockwidget", align = "right" })
+clock_update = function()
+    clockwidget.text = fg("#dddddd", os.date("%a %d %b - %H:%M"))
+end
+clock_update()
+awful.hooks.timer.register(10, clock_update)
+
+-- }}}
+
+mymenubox = widget{ type = "textbox", name = "mytextbox", align = "left" }
+mysystray = widget{ type = "systray", name = "mysystray", align = "right" }
+
+-- {{{ Statusbar
+
+mainstatusbar = {}
+
+for s = 1, screen.count() do
+    mainstatusbar[s] = wibox{
+        position = "top",
+        height = 18,
+        name = "mainstatusbar" .. s,
+    }
+
+    mainstatusbar[s].widgets = {
+        awful.widget.taglist.new(s, awful.widget.taglist.label.noempty, maintaglist.buttons),
+        maintaglist,
+        mymenubox,
+
+        rspacer, loadwidget,
+        rspacer, cputextwidget, cpugraphwidget,
+        rspacer, memtextwidget,
+        rspacer, clockwidget,
+        s == 1 and rspacer or nil,
+        s == 1 and mysystray or nil,
+    }
+    mainstatusbar[s].screen = s
+end
+
+-- }}}
+-- }}}
+
+-- {{{ Keys
+---- {{{ Global keys
+
+local hist = os.getenv("HOME") .. "/.cache/awesome/history"
+globalkeys = {
+    -- Mod+{A/S}: Switch to prev/next tag
+    key(k_m, "Left",  eminent.tag.prev),
+    key(k_m, "Right", eminent.tag.next),
+
+    -- Mod+Shift+{A/S}: Move window to Prev/Next tag
+    key(k_ms, "Left", function()
+        awful.client.movetotag(eminent.tag.getprev())
+        eminent.tag.prev()
+    end),
+    key(k_ms, "Right", function()
+        awful.client.movetotag(eminent.tag.getnext())
+        eminent.tag.next()
+    end),
+
+    -- Mod+Shift_{E/D}: move window to next/prev screen
+    key(k_mc, "Right", function()
+       local s = getscreen() + 1
+       while s > screen.count() do
+           s = s-screen.count()
+       end
+       client_movetoscreen(s)
+    end),
+    key(k_mc, "Left", function()
+       local s = getscreen() - 1
+       while s < 1 do
+           s = s+screen.count()
+       end
+       client_movetoscreen(s)
+    end),
+
+
+    -- Focus Prev/Next window
+    key(k_m, "j",
+        function ()
+            awful.client.focus.byidx(1)
+            if client.focus then client.focus:raise() end
+        end),
+    key(k_m, "k",
+        function ()
+            awful.client.focus.byidx(-1)
+            if client.focus then client.focus:raise() end
+        end),
+
+    -- Swap window with the Prev/Next one
+    key(k_ms, "j", function () awful.client.swap.byidx(1) end),
+    key(k_ms, "k", function () awful.client.swap.byidx(-1) end),
+
+    -- Mod+{E/D}: Switch to next/previous screen
+    key(k_m, "Tab",  function () awful.screen.focus(1) end),
+    key(k_ms, "Tab", function () awful.screen.focus(-1) end),
+
+    -- Mod+Enter: Launch a new terminal
+    key(k_m,  "Return", function() awful.util.spawn(terminal) end),
+    key(k_ac, "Delete", awesome.restart),
+    key(k_m, "F12", function() awful.util.spawn(lock) end),
+
+    -- Layout manipulation
+    key(k_m,  "l", function () awful.tag.incmwfact(0.05) end),
+    key(k_m,  "h", function () awful.tag.incmwfact(-0.05) end),
+    key(k_ms, "h", function () awful.tag.incnmaster(1) end),
+    key(k_ms, "l", function () awful.tag.incnmaster(-1) end),
+    key(k_mc, "h", function () awful.tag.incncol(1) end),
+    key(k_mc, "l", function () awful.tag.incncol(-1) end),
+
+    -- Menu
+    key(k_m, "r",
+        function ()
+            awful.prompt.run({ prompt = "Run: " },
+                             mymenubox,
+                             awful.util.spawn,
+                             awful.completion.bash,
+                             awful.util.getdir("cache").."/commands")
+        end),
+    key(k_m, "F4",
+        function ()
+            awful.prompt.run({ prompt = "Run Lua code: " },
+                             mymenubox,
+                             awful.util.eval,
+                             awful.prompt.bash,
+                             awful.util.getdir("cache").."/lua_commands")
+    end),
+}
+
+-- Mod+#: Switch to tag
+-- Mod+Shift+#: Toggle tag display
+-- Mod+Control+#: Move client to tag
+-- Mod+Alt+#: Toggle client on tag
+
+for i = 1, 10 do
+    table.append(globalkeys,
+                 key(k_m, i % 10,
+                     function()
+                         eminent.tag.goto(i, nil, true)
+                     end),
+
+                 key(k_ms, i % 10,
+                     function ()
+                         local t = eminent.tag.getn(i, nil, true)
+                         if t ~= nil then t.selected = not t.selected end
+                     end),
+                 key(k_mc, i % 10,
+                     function ()
+                         local t = eminent.tag.getn(i, nil, true)
+                         if t ~= nil then awful.client.movetotag(t) end
+                     end)
+                 )
+end
+
+---- }}}
+---- {{{ Client hotkeys
+
+clientkeys = {
+    key(k_m, "i", function (c)
+        if mymenubox.text then
+            mymenubox.text = ""
+        else
+            mymenubox.text = "Class: " .. c.class .. " Instance: ".. c.instance
+        end
+    end),
+
+    -- Client manipulation
+    key(k_m, "c", function (c) c:kill() end),
+    key(k_m, "o", awful.client.floating.toggle),
+    key(k_m, "t", awful.client.togglemarked),
+    key(k_m, "F11", function (c) c.fullscreen = not c.fullscreen end)
+}
+
+---- }}}
+
+root.keys(globalkeys)
+-- }}}
+-- {{{ Hooks
+
+awful.hooks.focus.register(function (c)
+    if not awful.client.ismarked(c) then
+        c.border_color = beautiful.border_focus
+    end
+end)
+
+awful.hooks.unfocus.register(function (c)
+    if not awful.client.ismarked(c) then
+        c.border_color = beautiful.border_normal
+    end
+end)
+
+awful.hooks.marked.register(function (c)
+    c.border_color = beautiful.border_marked
+end)
+
+awful.hooks.unmarked.register(function (c)
+    c.border_color = beautiful.border_focus
+end)
+
+-- Hook function to execute when the mouse enters a client.
+awful.hooks.mouse_enter.register(function (c)
+    -- Sloppy focus
+    client.focus = c
+end)
+
+awful.hooks.manage.register(function (c, startup)
+    if not startup and awful.client.focus.filter(c) then
+        c.screen = mouse.screen
+    end
+
+    -- Add mouse bindings
+    c:buttons{
+        button({ }, 1, function (c) client.focus = c; c:raise() end),
+        button(k_a, 1, awful.mouse.client.move),
+        button(k_a, 3, awful.mouse.client.resize)
+    }
+
+    -- Create border
+    c.border_width = beautiful.border_width
+    c.border_color = beautiful.border_normal
+
+    -- Make certain windows floating
+    local name = c.name:lower()
+    if name:find('pinentry')
+    then
+        c.floating = true
+    end
+
+    -- Focus new clients
+    client.focus = c
+    c:keys(clientkeys)
+    c.size_hints_honor = false
+end)
+
+-- Hook function to execute when arranging the screen
+-- (tag switch, new client, etc)
+awful.hooks.arrange.register(function (screen)
+    local sel = client.focus
+    if not sel then
+        sel = awful.client.focus.history.get(screen, 0)
+        if sel then client.focus = sel end
+    end
+    --[[
+    if sel then
+        local m_c = mouse.coords()
+
+        if m_c.x < sel.x - 1 or m_c.x > sel.x + sel.width + 1 or
+            m_c.y < sel.y - 1 or m_c.y > sel.y + sel.height + 1 then
+            if #m_c.buttons == 0 then
+                mouse.coords{x = sel.x + 5, y = sel.y + 5}
+            end
+        end
+    end
+    ]]--
+end)
+
+-- }}}
diff --git a/config/terminfo/r/rxvt-unicode b/config/terminfo/r/rxvt-unicode
new file mode 100644 (file)
index 0000000..dd651dc
Binary files /dev/null and b/config/terminfo/r/rxvt-unicode differ
diff --git a/config/zsh/10_zshopts b/config/zsh/10_zshopts
new file mode 100644 (file)
index 0000000..a367d09
--- /dev/null
@@ -0,0 +1,182 @@
+#! /bin/zsh
+
+if test -x =dircolors; then
+    eval "`dircolors`"
+    export LS_COLORS="*.ogm=01;35:${LS_COLORS}"
+    export ZLS_COLORS=$LS_COLORS
+fi
+
+autoload -U is-at-least
+
+#[ a ]##########################################################################
+setopt aliases              # expand aliases
+setopt all_export           # define = export
+#setopt always_last_prompt   #
+setopt always_to_end        # always go to end of word after completion
+setopt append_history       # append to history, dont truncate it
+setopt auto_cd              # do cd path if only 'path' is given as command
+setopt auto_continue        # send SIGCONT to jobs disowned
+setopt auto_list            # list choice on ambiguous command
+setopt auto_menu            # show menu for completion
+setopt no_autoname_dirs     # after foo=/absolute/path, ~foo may expand to
+                            # /absolute/path, but `%~' in prompt won't give
+                            # `~foo' until `~foo' has been used (rtfm closely)
+setopt auto_param_keys      # remove trailing spaces after completion if needed
+setopt auto_param_slash     # add slash for directories
+setopt auto_pushd           # cd = pushd
+setopt auto_remove_slash    # remove slash on dirs if word separator added
+setopt auto_resume          # simgle word resume if possible
+
+#[ b ]##########################################################################
+setopt bad_pattern          # warn on bad file patterns
+setopt bang_hist            # yeah ! expansion
+setopt bare_glob_qual       # () is quaifier list
+setopt no_bash_auto_list    # auto_list is sufficient, i want it on first tab
+setopt beep                 # beep me o yeah
+setopt no_bg_nice           # don't renice jobs in bg
+setopt no_brace_ccl         # don't expand of {adasd}
+setopt no_bsd_echo          # dont want BSD echo compat
+
+#[ c ]##########################################################################
+setopt case_glob            # case sensitive globbing
+setopt c_bases              # understand 12#120 as 120 in base 12
+setopt no_cdable_vars       # dont add ~ automagically
+setopt no_chase_dots        # foo/bar/.. is foo/ even if bar is a symlink
+setopt chase_links          # cd to a symlink is in fact cd to the true dir
+setopt check_jobs           # check jobs on exit
+setopt clobber              # redirection can create files
+setopt complete_aliases     # dont replace alias before completion
+setopt complete_in_word     # we want completion to be done from cursor in word
+setopt correct              # try to correct command line
+setopt no_correct_all       # don't coorect args
+setopt no_csh_junkiehistory # csh sucks
+setopt no_csh_junkie_loops  # want do /list/; done
+setopt no_csh_junkie_quotes # csh quote rules sucks too
+setopt no_csh_nullcmd       # want to keep my (READ)?NULLCMD settings
+setopt no_csh_null_glob     # don't erase not matched globs silently
+
+#[ d-g ]########################################################################
+setopt no_dvorak            # use only regular (qw|az)erty
+setopt no_emacs             # use rather bindkeys that builtin
+setopt equals               # perform = file expansions
+setopt no_err_exit          # don't weant to see exit status even if nonzero
+setopt no_err_return        # no return from a function with non 0 ending cmds
+setopt exec                 # sure we want to exec commands
+setopt extended_glob        # #,~,^ expansion
+setopt no_extended_history  # regular history
+setopt no_flow_control      # ignore ^S/^Q
+setopt function_argzero     # $0 == name of script
+setopt glob                 # sure i want globbing
+setopt no_global_export     # local vars are not globals one
+setopt global_rcs           # use global rcs
+setopt no_glob_assign       # no globbing on foo=*, use foo=(*)
+setopt no_glob_complete     # don't generate matches and cycle through them
+setopt no_glob_dots         # not require . in filename to be match explicitely
+setopt no_glob_subst        # no recursive expansion
+
+#[ h-j ]########################################################################
+setopt hash_cmds            # do not always search through path, hash cmds
+setopt hash_dirs            # hash directories holding commands too
+setopt hash_list_all        # verify path hash on completion
+setopt hist_allow_clobber   # add | to redirections in history
+setopt no_hist_beep         # don't beep on history expansion errors
+#setopt hist_expire_dups_first
+setopt hist_find_no_dups    # don't show dups even if not contiguous
+setopt hist_ignore_all_dups # ignore all -- even non contiguous -- dups
+#setopt hist_ignore_dups     # ignore contiguous dups
+setopt no_hist_ignore_space # historify commands with spaces too
+setopt hist_no_functions    # don't save functions defs in history
+setopt hist_no_store        # remove hists access cmds from hist
+setopt hist_reduce_blanks   # remove superfluous blanks
+setopt hist_save_no_dups    # no dups on history saving
+setopt hist_verify          # some expansion gadget
+setopt no_hup               # don't SIGHUP bg cmds on logout
+setopt no_ignore_braces     # do braces expansion
+setopt no_ignore_eof        # don't ignore ^D
+setopt no_inc_appendhistory # dont' append incrementally
+#setopt interactive
+setopt interactive_comments # allow comments in interactive shell
+
+#[ k-o ]########################################################################
+setopt no_ksh_arrays        # don't emulate ksh arrays
+setopt no_ksh_autoload      # don't do some dark autoload on function call
+setopt no_ksh_glob          # ignore @ before ()
+setopt ksh_option_print     # modify setopt output
+setopt no_ksh_typeset       # use zsh typeset
+setopt list_ambiguous       # unambiguous prefix completion is done silently
+setopt no_list_beep         # don't beep for completion
+setopt list_packed          # different width for completion
+setopt no_list_rows_first   # sort by colums
+setopt list_types           # show types of listing files
+#setopt local_*              # used in functions RTFM
+#setopt login                # don't have to do it myself
+setopt long_list_jobs       # list jobs in long format
+setopt magic_equal_subst    # foo= is file expanded
+setopt no_mail_warning      # auto-explained
+setopt mark_dirs            # adds / on dirs in filename completion
+setopt no_menu_complete     # don't show menu on ambiguous completion
+setopt monitor              # job control
+setopt multios              # multi redirection allowed
+setopt nonomatch            # do not print error on non matched patterns
+setopt notify               # notify immediately, not on next prompt
+setopt no_null_glob         # don't delete not matched globs
+setopt numeric_glob_sort    # sort in numeric order rather than lexicographic
+setopt no_octal_zeroes      # 010 = 9 sucks
+setopt no_overstrike        # dont start le in overstrike mode
+
+#[ p-r ]########################################################################
+setopt path_dirs            # search in path even if cmd has '/' in it
+setopt no_posix_builtins    # yeah don't like posix, i'm a rebel
+setopt print_eight_bit      # just to be sure
+#setopt privileged           #
+setopt no_prompt_bang       # dont perform history expansion in prompt
+setopt no_prompt_cr         # don'tprint <cr> before prompt ---> see precmd !
+setopt prompt_percent       # expand % escapes in prompt
+setopt prompt_subst         # subts in prompt
+setopt pushd_ignore_dups    # ignore dups in pushd
+#setopt pushd_minus          # exchange +/-
+setopt pushd_silent         # don't print stack after push/pop
+setopt pushd_to_home        # pushd == pushd $HOME
+setopt rc_expand_param      # some expansion trick for arrays in params
+setopt rc_quotes            # '' == ' in 'quoted exprs
+setopt rcs                  # source all /etc rcs
+setopt no_rec_exact         # recognize exact match even if ambiguous
+#setopt restricted           #
+setopt no_rm_star_silent    # ask user before rm foo/*
+setopt no_rm_star_wait      # dont't idle 10 seconds
+
+#[ s-z ]########################################################################
+setopt no_share_history     # traditional bash-history
+setopt no_sh_file_expansion # dont expand filnames first
+setopt no_sh_glob           # allow globbing with [(|)<]
+#setopt shin_stdin           #
+setopt no_sh_nullcmd        # use my NULLCMD
+setopt sh_option_letters    # interprete single option letters a la ksh
+setopt short_loops          # short loops
+setopt no_sh_word_split     # `s="a b"; a=($s)' => array of length 1, not 2
+#setopt single_command       #
+setopt no_single_line_zle   # use multiline editor
+setopt no_sun_keyboard_hack # i don't use sun kb
+setopt transient_rprompt    # better for cut/paste
+#setopt typeset_silent       #
+#setopt unset                #
+#setopt verbose              #
+setopt vi                   # use bindkeys
+setopt no_xtrace            # do not debug by default
+setopt zle                  # use zsh le
+
+is-at-least 4.3.0 && {
+    unsetopt hist_save_by_copy
+}
+
+[ -w $zsh_cache ] && HISTFILE=$zsh_cache/history
+
+HISTSIZE=10000              # size of history
+LISTMAX=1000                # never ask
+NULLCMD='cat'               # use cat for > null commands
+REPORTTIME=2                # report time if execution exceeds amount of seconds
+SAVEHIST=10000              # maximum of history events to be save
+LOGCHECK=60
+watch=(notme)               # watch login/logout
+WORDCHARS="*?_-.[]~/&;!#$%^(){}<>"
+                            # part of word in line editor
diff --git a/config/zsh/20_environment b/config/zsh/20_environment
new file mode 100644 (file)
index 0000000..7de3640
--- /dev/null
@@ -0,0 +1,21 @@
+#! /bin/zsh
+
+export EMAIL="pierre.habouzit@m4x.org"
+export FULLNAME="Pierre Habouzit"
+
+export DEBEMAIL="madcoder@debian.org"
+export DEBFULLNAME=$FULLNAME
+
+export CVS_RSH="ssh"
+export MANWIDTH=80
+export EDITOR=vim
+export VISUAL=vim
+export CCACHE_DIR=$HOME/.cache/ccache
+export CCACHE_NOCOMPRESS=NoThanks
+
+export RLWRAP_HOME=~/.cache/rlwrap/
+export GTK_IM_MODULE=xim
+
+export LC_MESSAGES=C
+export LC_ALL=
+unset VERBOSE
diff --git a/config/zsh/30_binds b/config/zsh/30_binds
new file mode 100644 (file)
index 0000000..58fe1c7
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/zsh
+
+zmodload -i zsh/complist
+
+bindkey "^[[3~" delete-char
+bindkey "^[[5~" backward-word
+bindkey "^[[6~" forward-word
+
+bindkey "^[[A" history-beginning-search-backward
+bindkey "^[[B" history-beginning-search-forward
+
+bindkey "^A" beginning-of-line
+bindkey "^[[7~" beginning-of-line
+bindkey "^E" end-of-line
+bindkey "\e[8~" end-of-line
+bindkey "^K" kill-line
+bindkey "^L" clear-screen
+bindkey "^R" history-incremental-search-backward
+bindkey "^U" kill-whole-line
+bindkey "^V" quoted-insert
+bindkey "^W" backward-kill-word
+
+bindkey -M menuselect "h" backward-char
+bindkey -M menuselect "j" down-line-or-history
+bindkey -M menuselect "k" up-line-or-history
+bindkey -M menuselect "l" forward-char
+bindkey -M menuselect "u" undo
diff --git a/config/zsh/40_completion b/config/zsh/40_completion
new file mode 100644 (file)
index 0000000..8483231
--- /dev/null
@@ -0,0 +1,43 @@
+#! /bin/zsh
+
+zstyle ':completion:*' add-space true
+zstyle ':completion:*' completer _expand _complete _match _prefix _approximate _list
+zstyle ':completion:*' menu select=1
+zstyle ':completion:*' file-sort name
+zstyle ':completion:*' list-colors ${(s.:.)ZLS_COLORS}
+zstyle ':completion:*' matcher-list 'r:|[._-]=** r:|=**' 'l:|=** r:|=**'
+zstyle ':completion:*' menu select
+zstyle ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )'
+
+#[ Formats ]####################################################################
+zstyle ':completion:*' group 1
+zstyle ':completion:*' format '%B---- %d%b'
+zstyle ':completion:*:corrections' format '%B---- %d (errors %e)%b'
+zstyle ':completion:*:descriptions' format "%B---- %d%b"
+zstyle ':completion:*:messages' format '%B%U---- %d%u%b' 
+zstyle ':completion:*:warnings' format "%B$fg[red]%}---- no match for: $fg[white]%d%b"
+zstyle ':completion:*' group-name ''
+
+#[ Kill ]#######################################################################
+zstyle ':completion:*:processes' command 'ps -au$USER -o pid,time,cmd|grep -v "ps -au$USER -o pid,time,cmd"'
+zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)[ 0-9:]#([^ ]#)*=01;30=01;31=01;38'
+
+#[ hosts and users ]############################################################
+zstyle ':completion:*:hosts' list-colors '=(#b)(*)(.madism.org)=01;30=01;31' '=[^.]#=01;31'
+
+users=(root sab madcoder x2000habouzit habouzit)
+zstyle ':completion:*' users $users
+
+zstyle ':completion:*:*:[ak]dvi:*' file-patterns \
+    '*.dvi:dvi-files:DVI\ files *(-/):directories:Directories' '*:all-files'
+zstyle ':completion:*:*:kghostview:*' file-patterns \
+    '*.(ps|pdf)(|.gz|.bz2):pspdf-files:PostScript\ or\ PDF\ files  *(-/):directories:Directories' '*:all-files'
+zstyle ':completion:*:*:swfplayer:*' file-patterns \
+    '*.swf:swf-files:Swf\ files  *(-/):directories:Directories' '*:all-files'
+
+zstyle ':completion:*' file-patterns \
+    '%p:globbed-files: *(-/):directories:Directories' '*:all-files'
+
+#[ ignores for vim ]############################################################
+
+zstyle ':completion:*:*:vi(m|):*:*files' ignored-patterns '*?.(aux|dvi|ps|pdf|bbl|toc|lot|lof|o|cm?)'
diff --git a/config/zsh/50_aliases b/config/zsh/50_aliases
new file mode 100644 (file)
index 0000000..e829180
--- /dev/null
@@ -0,0 +1,69 @@
+#!/bin/zsh
+
+autoload zmv
+alias mmv='noglob zmv -W'
+
+alias su='export XAUTHORITY=${HOME}/.Xauthority ; sudo -s'
+alias sudo='export XAUTHORITY=${HOME}/.Xauthority ; sudo'
+
+alias du="du -hcs"
+alias df="df -h"
+
+case "${$(ls --version | head -1)##* }" in
+    [0-5].*)
+        alias ls="ls -bCF --color=auto"
+        ;;
+    *)
+        alias ls="ls --group-directories-first -bCF --color=auto"
+        ;;
+esac
+
+alias la="ls --color=always -a"
+alias ll="ls --color=always -l"
+alias lla="ls --color=always -la"
+alias lal="ls --color=always -la"
+
+alias egrep='egrep --color=tty -d skip'
+alias fgrep='fgrep --color=tty -d skip'
+alias grep='grep --color=tty -d skip'
+
+alias md='mkdir'
+alias rd='rmdir'
+alias rm='rm -i'
+alias s2disk='sudo s2disk'
+alias s2both='sudo s2both'
+alias s2ram='sudo s2ram'
+
+alias v=vim
+alias m=madmutt
+cvi () {
+    vim -O ${${1%.[hc]}%.}.{h,c}
+}
+xvi () {
+    vim -O ${${${1%.h}%.cpp}%.}.{h,cpp}
+}
+ovi () {
+    vim -O ${${1%.ml}%.}.ml{i,}
+}
+
+alias br='bts --mbox show'
+
+upload() {
+    debsign *.changes
+    dput -e 0 gluck_delayed *.changes
+}
+
+conf_push () {
+    echo -n "PUSHING TO $1"
+    rsync -au --exclude=.git --delete ~madcoder/.madconf/ "$1":.madconf/
+    ssh "$1" LC_ALL=C .madconf/bin/madconf
+    echo "."
+}
+
+dict () { dictl "$@" 2>&1 | colorit | less -R ; }
+
+vman() {
+    if /usr/bin/man "$@" > /dev/null; then
+        vim -m -n --noplugin -c "set ft=man" -c "noremap q :q<cr>" -c "Man $@"
+    fi
+}
diff --git a/config/zsh/60_prompt b/config/zsh/60_prompt
new file mode 100644 (file)
index 0000000..70f9c98
--- /dev/null
@@ -0,0 +1,85 @@
+#! /bin/zsh
+
+autoload colors && colors
+
+precmd() {
+    local git_dir branch
+
+    psvar=()
+    git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
+    if test -d "$git_dir/rebase-apply"; then
+        if test -f "$git_dir/rebase-apply/rebasing"; then
+            psvar[3]="rebase"
+        elif test -f "$git_dir/rebase-apply/applying"; then
+            psvar[3]="am"
+        else
+            psvar[3]="am/rebase"
+        fi
+        branch="$(git symbolic-ref HEAD 2>/dev/null)"
+    elif test -f "$git_dir/rebase-merge/interactive"; then
+        psvar[3]="rebase -i"
+        branch="$(cat "$git_dir/rebase-merge/head-name")"
+    elif test -d "$git_dir/rebase-merge"; then
+        psvar[3]="rebase -m"
+        branch="$(cat "$git_dir/rebase-merge/head-name")"
+    elif test -f "$git_dir/MERGE_HEAD"; then
+        psvar[3]="merge"
+        branch="$(git symbolic-ref HEAD 2>/dev/null)"
+    else
+        test -f "$git_dir/BISECT_LOG" && psvar[3]="bisect"
+        branch="$(git symbolic-ref HEAD 2>/dev/null)" || \
+            branch="$(git describe --exact-match HEAD 2>/dev/null)" || \
+            branch="$(cut -c1-7 "$git_dir/HEAD")..."
+    fi
+
+    psvar[1]="${$(readlink -f ${git_dir:h})/$HOME/~}"
+    psvar[2]="${branch#refs/heads/}"
+}
+
+_mad_prompt_setup() {
+    local rst
+    local -a pcc
+
+    rst="%{$reset_color%}"
+    pcc[1]="%{$reset_color${1:-$fg_no_bold[green]}%}"
+    pcc[2]="%{$reset_color${2:-$fg_no_bold[yellow]}%}"
+    pcc[3]="%{$reset_color${3:-$fg_no_bold[cyan]}%}"
+    pcc[4]="%{$reset_color${4:-$fg_bold[red]}%}"
+
+#%{$'\e[s\e[A\e[4Dblah\e[u'$reset_color%}
+#%{$'\e[400C\e[20D'%}"────────────────────
+    PROMPT="\
+$pcc[1]┌─(%B%T$pcc[1])──%(1v.<$pcc[3]%1v %B%U%2v%u%(3v.$pcc[4] <%3v>.)$pcc[1]>.)──
+$pcc[1]└[$pcc[2]%{%(?..%S)%}%m%s$pcc[1]] $rst"
+    RPROMPT="$pcc[1](%B%~$pcc[1])$rst"
+    POSTEDIT=$reset_color
+}
+
+if [ $UID -eq 0 ]; then
+    PATH=~root/bin:/usr/local/sbin:/usr/sbin:/sbin:$PATH
+    PROMPT="%{$reset_color$fg_bold[yellow]%}[%{$fg_bold[red]%}%n %m%{$fg_bold[yellow]%}]%{$reset_color%} "
+    RPROMPT="%{$reset_color$fg_no_bold[red]%}(%{$fg_bold[red]%}%~%{$fg_no_bold[red]%})%{$reset_color%} "
+else
+    PATH="/usr/lib/ccache:${HOME}/bin:${PATH}"
+    _mad_prompt_setup
+fi
+
+case "$TERM" in
+    screen)
+        PROMPT="${PROMPT}%{\ekzsh\e\\%}"
+
+        preexec () {
+            local CMD=${1[(wr)^(*=*|sudo|exec|-*)]}
+            echo -ne "\ek$CMD\e\\"
+        }
+    ;;
+    xterm|rxvt-unicode)
+        PROMPT="${PROMPT}%{\e]2;zsh\a%}"
+
+        preexec () {
+            local CMD=${1[(wr)^(*=*|sudo|exec|-*)]}
+            echo -ne "\e]2;$CMD\007"
+        }
+    ;;
+    *);;
+esac
diff --git a/devscripts b/devscripts
new file mode 100644 (file)
index 0000000..e4b7ff4
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# use ccache in debuild
+export DEBUILD_PRESERVE_ENVVARS=CCACHE_DIR,CCACHE_NOCOMPRESS,MAKE,MAKEFLAGS,DEB_BUILD_OPTIONS
+export DEBUILD_SET_ENVVAR_PATH="/usr/lib/ccache:/usr/sbin:/usr/bin:/sbin:/bin"
+
+# debsign
+export DEBSIGN_KEYID=madcoder@debian.org
+
+# for dch
+export DEBCHANGE_RELEASE_HEURISTIC=changelog
+
+# for bts
+export BTS_CACHE=yes
+export BTS_CACHE_MODE=mbox
+
+# for nmudiff
+export NMUDIFF_NEWREPORT=no
+export NMUDIFF_MUTT=no
diff --git a/gitconfig b/gitconfig
new file mode 100644 (file)
index 0000000..d445115
--- /dev/null
+++ b/gitconfig
@@ -0,0 +1,58 @@
+[madcoder]
+       up-gitk=true
+
+[alias]
+       co=checkout -m
+       ci=commit -s
+       st=!git -p status
+       pop=reset HEAD~1
+       unstash=stash apply
+       amend=commit -s --amend
+       squash=commit -s --amend -C HEAD
+       p=!git push origin HEAD
+       debtag=!git tag -f -a -s -m `git-symbolic-ref HEAD | sed -e 's~refs/heads/~~'`/`dpkg-parsechangelog | sed -n 's/^Version: \\(.*:\\)\\?//p'` `git-symbolic-ref HEAD | sed -e 's~refs/heads/~~'`/`dpkg-parsechangelog | sed -n 's/^Version: \\(.*:\\)\\?//p'`
+        b64=commit -sm'64bits fix'
+       send=send-email --annotate --compose -C -C -M -n --to
+        stage=add
+        unstage=reset HEAD --
+        track=add -N
+        untrack=rm --cached
+
+[core]
+        #editor=gvim -f
+        editor=vim
+        excludesfile=/home/madcoder/.git-excludes
+
+[user]
+       name  = Pierre Habouzit
+       email = madcoder@debian.org
+
+[color]
+        ui     = auto
+       diff   = auto
+       branch = auto
+       status = auto
+       pager  = true
+        interactive = auto
+
+[color "diff"]
+       meta = green
+       frag = yellow
+       old = magenta
+       new = bold cyan
+;      message = bold
+
+[color "status"]
+       header = bold blue
+       added  = green
+       changed = bold red
+       untracked = bold yellow
+[merge]
+       verbosity = 1
+        renameLimit = 10000
+[clean]
+       requireForce = false
+[pack]
+       threads = 0
+[status]
+       submodulesummary = 1
diff --git a/gnupg/gpg.conf b/gnupg/gpg.conf
new file mode 100644 (file)
index 0000000..9e4d17d
--- /dev/null
@@ -0,0 +1,16 @@
+#keyserver keyring.debian.org
+#keyserver-options auto-key-retrieve
+keyserver subkeys.pgp.net
+
+use-agent
+
+no-default-keyring
+keyring pubring.gpg
+#keyring /usr/share/keyrings/debian-archive-keyring.gpg
+#keyring /usr/share/keyrings/debian-keyring.gpg
+primary-keyring pubring.gpg
+
+utf8-strings
+
+default-key  A1EE761C
+encrypt-to  A1EE761C
diff --git a/gtkrc b/gtkrc
new file mode 100644 (file)
index 0000000..7857c4d
--- /dev/null
+++ b/gtkrc
@@ -0,0 +1,11 @@
+include "/usr/share/themes/Clearlooks/gtk-2.0/gtkrc"
+
+style "user-font"
+{
+       font_name="DejaVu Sans 11"
+}
+widget_class "*" style "user-font"
+
+gtk-theme-name="Clearlooks"
+gtk-font-name="DejaVu Sans 11"
+gtk-key-theme-name="Emacs"
diff --git a/gtkrc-2.0 b/gtkrc-2.0
new file mode 120000 (symlink)
index 0000000..c3e14d0
--- /dev/null
+++ b/gtkrc-2.0
@@ -0,0 +1 @@
+gtkrc
\ No newline at end of file
diff --git a/pbuilder/B90_list_missing b/pbuilder/B90_list_missing
new file mode 100755 (executable)
index 0000000..e6ec629
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Depends on CDBS module in debian/rules:
+# include /usr/share/cdbs/1/rules/utils.mk 
+
+cd /tmp/buildd/*/debian/..
+
+fakeroot debian/rules -q list-missing 2>/dev/null || {
+    if [ "$?" = "1" ]; then
+        echo "I: checking for missing files."
+        fakeroot debian/rules list-missing || true
+    fi
+}
+
+#EOF
diff --git a/pbuilder/B91_lintian b/pbuilder/B91_lintian
new file mode 100755 (executable)
index 0000000..1800bfc
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+# run lintian
+
+echo "I: installing lintian and running it on the package"
+apt-get install -y --force-yes lintian &>/dev/null
+lintian --allow-root --color=always -I /tmp/buildd/*.changes | tee /tmp/buildd/lintian
+
diff --git a/pbuilder/C10_launch_shell b/pbuilder/C10_launch_shell
new file mode 100755 (executable)
index 0000000..027a8d2
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+# invoke shell if build fails.
+
+echo "I: installing necessary tools to work in the damn chroot"
+apt-get install -y --force-yes vim zsh &>/dev/null
+dpkg --purge nvi
+
+cd /tmp/buildd/*/debian/..
+
+/bin/zsh < /dev/tty > /dev/tty
diff --git a/pbuilder/D10_use_result b/pbuilder/D10_use_result
new file mode 100755 (executable)
index 0000000..e778a8c
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+echo "I: adding ${LOCALREPO} in sources.list"
+echo "deb ftp://mirror.corp/debian sid main" > /etc/apt/sources.list
+echo "deb file://${LOCALREPO} ./" >> /etc/apt/sources.list
+
+echo "I: running apt-get update"
+apt-get update &>/dev/null
+
diff --git a/pbuilderrc b/pbuilderrc
new file mode 100644 (file)
index 0000000..cffd162
--- /dev/null
@@ -0,0 +1,66 @@
+#! /bin/sh
+
+die() {
+    echo $1 1>&2
+    exit ${2:-"1"}
+}
+
+nofail() {
+    $@ || true
+}
+
+silent() {
+    $@ &> /dev/null
+}
+
+create_dir() {
+    dir="$1"
+    user="${2:-root}"
+    group="${3:-root}"
+    [ -d "$dir" ] || nofail silent install -d "$dir" -o "$user" -g "$group"
+}
+
+#
+# hack so that build result is in $(package)_$(version) dir
+#
+export LOCALREPO="${HOME}/debian/results"
+mkdir -p ${LOCALREPO}
+silent pushd ${LOCALREPO}
+dpkg-scanpackages . /dev/null > Packages 2>/dev/null
+silent popd
+
+[ -f changelog ] && cd ..
+
+if [ -f debian/changelog ]; then
+    pkg_version=`dpkg-parsechangelog | sed -n 's/^Version: //p'`
+    pkg_source=`dpkg-parsechangelog | sed -n 's/^Source: //p'`
+    [ -n "${pkg_source}" -a -n "${pkg_version}" ] || die "Cannot understand package version/source"
+    BUILDRESULT="${LOCALREPO}/${pkg_source}_${pkg_version}"
+    mkdir -p $BUILDRESULT
+fi
+
+#
+# Configuration
+#
+APTCACHE="/var/cache/apt/archives"
+DISTRIBUTION="sid"
+HOOKDIR=${HOME}/.pbuilder/
+#PDEBUILD_PBUILDER=cowbuilder
+
+#
+# ccache
+#
+export CCACHE_DIR="/var/cache/pbuilder/ccache"
+export PATH="/usr/lib/ccache:$PATH"
+EXTRAPACKAGES="$EXTRAPACKAGES ccache"
+BINDMOUNTS="$BINDMOUNTS $CCACHE_DIR $LOCALREPO"
+if test -d /srv/nfs/debian; then
+    BINDMOUNTS="$BINDMOUNTS /srv/nfs/debian"
+fi
+create_dir "$CCACHE_DIR" 1234 1234
+
+#BASETGZ=/var/cache/pbuilder/base-stable-i386.tgz
+#BASETGZ=/var/cache/pbuilder/base-i386.tgz
+#BASETGZ=/var/cache/pbuilder/etch.tgz
+
+export debian_chroot="pbuild$$"
diff --git a/quiltrc b/quiltrc
new file mode 100644 (file)
index 0000000..08731bb
--- /dev/null
+++ b/quiltrc
@@ -0,0 +1,5 @@
+QUILT_PATCH_OPTS="--unified-reject-files"
+QUILT_DIFF_ARGS="--no-timestamps --no-index -p ab --color=auto"
+QUILT_REFRESH_ARGS="--no-timestamps --no-index"
+#QUILT_PATCHES="debian/patches"
+QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
diff --git a/reportbugrc b/reportbugrc
new file mode 100644 (file)
index 0000000..a90a1b9
--- /dev/null
@@ -0,0 +1,7 @@
+# reportbug preferences file
+# Version of reportbug this preferences file was written by
+reportbug_version "3.15"
+# default operating mode: one of: novice, standard, advanced, expert
+mode standard
+# default user interface
+ui text
diff --git a/screenrc b/screenrc
new file mode 100644 (file)
index 0000000..0b7cfd0
--- /dev/null
+++ b/screenrc
@@ -0,0 +1,51 @@
+
+autodetach      on
+defscrollback   5000
+escape          ^aa
+nonblock        on
+obuflimit       1024
+startup_message off
+vbell           off
+zombie          cr
+
+
+# Support alternate screens so that, for example, when you 
+# quit out of vi, the display is redrawn as it was before vi
+# redrew the full screen.
+altscreen on
+
+#
+# Kludges
+#
+
+# find a free shell
+bind s select zsh
+bind c screen 0
+bind ^c screen 0
+bind 0 select 0
+
+#
+# Colors
+#
+
+sorendition "=b rW"
+caption always "%{= kg}[%{kB} %c %{kg}][%= %{kw}%-w%{kr}[%{kW}%n %t%{kr}]%{kw}%+w %=%{kg}][%{kB} %l %{kg}]%{kw}"
+
+#
+# Shift PgUp/PgDn
+#
+
+bindkey "^[[5;2~" eval "copy" "stuff ^b"
+bindkey -m "^[[5;2~" stuff ^b
+bindkey -m "^[[6;2~" stuff ^f
+
+# xterm understands both im/ic and doesn't have a status line.
+# Note: Do not specify im and ic in the real termcap/info file as
+# some programs (e.g.  vi) will not work anymore.
+termcap  xterm hs@:cs=\E[%i%d;%dr:im=\E[4h:ei=\E[4l
+terminfo xterm hs@:cs=\E[%i%p1%d;%p2%dr:im=\E[4h:ei=\E[4l
+# 80/132 column switching must be enabled for ^AW to work
+termcapinfo  xterm Z0=\E[?3h:Z1=\E[?3l:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l
+# Make the output buffer large for (fast) xterms.
+termcapinfo xterm* OL=100
+
diff --git a/signature b/signature
new file mode 100644 (file)
index 0000000..f68aeb8
--- /dev/null
+++ b/signature
@@ -0,0 +1,3 @@
+·O·  Pierre Habouzit
+··O                                                madcoder@debian.org
+OOO                                                http://www.madism.org
diff --git a/signature.is b/signature.is
new file mode 100644 (file)
index 0000000..85fc098
--- /dev/null
@@ -0,0 +1,7 @@
+Intersec <http://www.intersec.com>
+Pierre Habouzit <pierre.habouzit@intersec.com>
+Tél : +33 (0)1 5570 3346
+Mob : +33 (0)6 1636 8131
+Fax : +33 (0)1 5570 3332
+37 Rue Pierre Lhomme
+92400 Courbevoie
diff --git a/signature.pv b/signature.pv
new file mode 100644 (file)
index 0000000..513b38e
--- /dev/null
@@ -0,0 +1,5 @@
+·O·  Pierre Habouzit
+··O                                                madcoder@debian.org
+OOO                                                http://www.madism.org
+-- 
+    [-- This mail is private and should not ever be declassified --]
diff --git a/ssh/authorized_keys b/ssh/authorized_keys
new file mode 100644 (file)
index 0000000..12f51cd
--- /dev/null
@@ -0,0 +1,2 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAyYvz6t9Ul7PW1vlLO8tM3UnkeoWGgJWujK3WXEoE3T2zW3mrvaPOf4GcjXqzNJY/1LGYXQny9i9FE1owzCX9amNcpDmKpuL2C56bMrK2oM2V6sl6NF6rbXaGB211sTqllB4exHhtV7F21IiiteFoXs3Bv060ruECCNPPtijXVA0cU1oxEDa1oy0rbjUGD8oeaB/vftgAFk2KW7Wx5jqLk8Cu5viK2a+Sj8RaiclFY+CaPHpfBpgJSsO6kPks+YKHNhQBgBdDfjh5psQ2YlEsrzTWEfCfVHxzcLmWpDAWSlomgpWbfV1zKdhzYhz2Tpt+DaPzNCiAdDiRyPeAknj6VQ== madcoder@artemis
+ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzeuXc+l1NCBj/k94K/pfTT83dkp2ktvWxZbTUpwxySwRbmxCKccVd8hqwomCihMfONAVz+gMX4RWJNyPlcoE/R7nEpMPzR9aMoCLkWOETrZmRcCefM/ekLjPIT1YCN7eSQ7kfd3kaWj6CLxsxoWOLtLA9wB1o3DJ0EnmDFL3bhdtz4AqT4n3Ide2TAZ6C+do7bYBfVHAiTBCrbEctMTUEpVqdvXM9HPFueYNZgTYDVcckJd7MxVpdV63m4ms5ZeOpb4gBmjyCeE6fp5bo+ZeOzkT2nB5rnM5HrPT9JwKqBBkcFh8Wc4YGKW5e1wXmP6F7RF3csg6fhNZUrVpeNZ0Yw== madcoder@laphroaig
diff --git a/ssh/config b/ssh/config
new file mode 100644 (file)
index 0000000..fcaef81
--- /dev/null
@@ -0,0 +1,58 @@
+HashKnownHosts no
+ControlMaster auto
+ControlPath   ~/.ssh/ssh_control_%h_%p_%r
+VerifyHostKeyDNS yes
+
+Host *
+    Compression yes
+
+Host *.inria.fr
+    User        habouzit
+
+#--- intersec ---
+Host demo-sfr
+    Hostname    localhost
+    Port        2222
+    User        intersec
+
+Host *.intersec.com
+    Port        2222
+    User        madcoder
+
+Host beacon
+    Hostname    beacon.intersec.eu
+    Port        2222
+    User        madcoder
+
+Host pap
+    Hostname localhost
+    Port 2222
+
+Host rudy
+    HostName    rudy.intersec.com
+    Port        2222
+    User        madcoder
+
+Host rood
+    HostName    rood.intersec.com
+    Port        2222
+    User        madcoder
+
+#--- madism ---
+Host *.madism.org
+    User        madcoder
+    ForwardAgent yes
+
+Host pan
+    Port        2222
+    HostName    pan.madism.org
+
+#--- X ---
+Host *.polytechnique.org
+    User        x2000habouzit
+
+#--- DEBIAN ---
+Host *.debian.org
+    User        madcoder
+
+# vim: set syntax=sshconfig:
diff --git a/ssh/environment b/ssh/environment
new file mode 100644 (file)
index 0000000..6c89372
--- /dev/null
@@ -0,0 +1 @@
+SSH_ASKPASS=ssh-askpass
diff --git a/toprc b/toprc
new file mode 100644 (file)
index 0000000..904c854
--- /dev/null
+++ b/toprc
@@ -0,0 +1,14 @@
+RCfile for "top with windows"          # shameless braggin'
+Id:a, Mode_altscr=1, Mode_irixps=1, Delay_time=1.000, Curwin=0
+Def    fieldscur=AEHIOQTWKNMXbcdfgjplrsuvyz
+       winflags=32568, sortindx=10, maxtasks=0
+       summclr=1, msgsclr=1, headclr=3, taskclr=1
+Job    fieldscur=ABXcefgjlrstuvyzMKNHIWOPQD
+       winflags=32304, sortindx=0, maxtasks=0
+       summclr=6, msgsclr=6, headclr=7, taskclr=6
+Mem    fieldscur=ANOPQRSTUVXbcdefgjlmyzWHIK
+       winflags=32568, sortindx=13, maxtasks=0
+       summclr=5, msgsclr=5, headclr=4, taskclr=5
+Usr    fieldscur=DEFGABXchijlopqrstuvyzMKNW
+       winflags=32560, sortindx=4, maxtasks=0
+       summclr=3, msgsclr=3, headclr=2, taskclr=3
diff --git a/vim/filetype.vim b/vim/filetype.vim
new file mode 100644 (file)
index 0000000..0cb4c21
--- /dev/null
@@ -0,0 +1,51 @@
+if exists("did_load_filetypes")
+  finish
+endif
+
+augroup filetypedetect
+  au BufRead,BufNewFile *.JS               setf javascript
+  au BufRead,BufNewFile *.jas              setf asm
+  au BufRead,BufNewFile *.swfml            setf xml
+  au BufRead,BufNewFile *.hx               setf haxe
+
+  au BufRead,BufNewFile *.tpl              setf xhtml
+
+  au BufRead,BufNewFile massif.*.txt       setf massif
+
+  " HTML (.shtml and .stm for server side)
+  au BufNewFile,BufRead *.html,*.htm,*.shtml,*.stm  call s:FThtml()
+
+  au BufNewFile,BufRead {mad,}mutt{ng,}-*-\w\+ setf mail
+
+  au BufNewFile,BufRead */X11/xkb/* setf xkb
+
+  au BufNewFile,BufRead *.as setf actionscript
+
+  au BufNewFile,BufRead *.dox setf doxygen
+
+  au BufNewFile,BufRead *.iop setf d
+
+  au BufNewFile,BufRead .gitsendemail.* setf gitsendemail
+
+  " Distinguish between HTML, XHTML and Django
+  fun! s:FThtml()
+    let n = 1
+    while n < 10 && n < line("$")
+      if getline(n) =~ '<?'
+        setf php
+        return
+      endif
+      if getline(n) =~ '\<DTD\s\+XHTML\s'
+        setf xhtml
+        return
+      endif
+      if getline(n) =~ '{%\s*\(extends\|block\)\>'
+        setf htmldjango
+        return
+      endif
+      let n = n + 1
+    endwhile
+    setf html
+  endfun
+
+augroup END
diff --git a/vim/ftplugin/debhints.vim b/vim/ftplugin/debhints.vim
new file mode 100644 (file)
index 0000000..609710e
--- /dev/null
@@ -0,0 +1,51 @@
+" Vim filetype plugin file (GUI menu, folding and completion)
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin=1
+
+" {{{1 Local settings (do on every load)
+if !exists("g:debchangelog_fold_disable")
+  setlocal foldmethod=expr
+endif
+setlocal foldexpr=DebHintsFold(v:lnum)
+
+setlocal comments=:#
+
+" Clean unloading
+let b:undo_ftplugin = "setlocal tw< comments< foldmethod< foldexpr< foldtext<"
+" }}}1
+
+if exists("g:did_debhints_ftplugin")
+  finish
+endif
+
+" Don't load another plugin (this is global)
+let g:did_debhints_ftplugin = 1
+
+" {{{1 folding
+
+function! DebHintsFold(lnum)
+    let line = getline(a:lnum)
+    let prevl = getline(a:lnum - 1)
+    if line =~ '^ *finished *$'
+        return '>1'
+    endif
+    if line =~ '^# *[0-9]\{8\}$'
+        return '>1' " beginning of a new day
+    endif
+    if line == '' && prevl == ''
+        return '1'
+    endif
+    if prevl == '' || prevl =~ '^#[0-9]\{8\}$'
+        return '>2' " beginning of a new hint chunk
+    endif
+    return '='
+endfunction
+
+" }}}
+silent! normal zo
+
+" vim: set foldmethod=marker:
+
diff --git a/vim/ftplugin/dosini.vim b/vim/ftplugin/dosini.vim
new file mode 100644 (file)
index 0000000..e80ed37
--- /dev/null
@@ -0,0 +1,45 @@
+" Vim filetype plugin file (GUI menu, folding and completion)
+
+if exists("b:did_ftplugin")
+  finish
+endif
+let b:did_ftplugin=1
+
+" {{{1 Local settings (do on every load)
+if !exists("g:debchangelog_fold_disable")
+  setlocal foldmethod=expr
+endif
+setlocal foldexpr=DosiniFold(v:lnum)
+
+setlocal comments=:#
+
+" Clean unloading
+let b:undo_ftplugin = "setlocal tw< comments< foldmethod< foldexpr< foldtext<"
+" }}}1
+
+if exists("g:did_dosini_ftplugin")
+  finish
+endif
+
+" Don't load another plugin (this is global)
+let g:did_dosini_ftplugin = 1
+
+" {{{1 folding
+
+function! DosiniFold(lnum)
+    let line = getline(a:lnum)
+    let prevl = getline(a:lnum - 1)
+    if line =~ '^ *\['
+        return '>1'
+    endif
+    if line == '' && prevl == ''
+        return '>0'
+    endif
+    return '='
+endfunction
+
+" }}}
+silent! normal zo
+
+" vim: set foldmethod=marker:
+
diff --git a/vim/ftplugin/gitcommit.vim b/vim/ftplugin/gitcommit.vim
new file mode 100644 (file)
index 0000000..86880fa
--- /dev/null
@@ -0,0 +1,70 @@
+"=============================================================================
+" Copyright:    Copyright © Pierre Habouzit
+"               Permission is hereby granted to use and distribute this code,
+"               with or without modifications, provided that this copyright
+"               notice is copied with it. Like anything else that's free,
+"               git.vim is provided *as is* and comes with no
+"               warranty of any kind, either expressed or implied. In no
+"               event will the copyright holder be liable for any damages
+"               resulting from the use of this software.
+" Description:  git-commit(1) helper
+" Maintainer:   Pierre Habouzit <madcoder@debian.org>
+" Last Changed: Mon, 26 Nov 2007 10:06:15 +0100
+" Usage:        This file should live in your ftplugin directory.
+"
+"               The configurations variables are:
+"
+"                 g:git_diff_opts        - options to add to git diff,
+"                                          (default "-C -C")
+"                 g:git_diff_spawn_mode  - use auto-split on commit ?
+"                                          * 1 == hsplit
+"                                          * 2 == vsplit
+"                                          * none else (default)
+"
+"               The default keymaping is:
+"
+"                 <Leader>gd   - view the diff in a hsplit
+"                 <Leader>ghd  - view the diff in a hsplit
+"                 <Leader>gvd  - view the diff in a vsplit
+"========================================================================={{{=
+
+if exists("b:did_ftplugin") | finish | endif
+
+let b:did_ftplugin = 1
+
+setlocal tw=74
+setlocal nowarn nowb
+
+function! Git_diff_windows(vertsplit, auto, opts)
+    if a:vertsplit
+        rightbelow vnew
+    else
+        rightbelow new
+    endif
+    silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile
+    exe "normal :r!cd .. && LANG=C git diff --stat -p --cached ".a:opts."\no\<esc>1GddO\<esc>"
+    setlocal nomodifiable
+    noremap <buffer> q :bw<cr>
+    if a:auto
+        redraw!
+        wincmd p
+        redraw!
+    endif
+endfunction
+
+noremap <buffer> <Leader>gd :call Git_diff_windows(0, 0)<cr>
+noremap <buffer> <Leader>ghd :call Git_diff_windows(0, 0)<cr>
+noremap <buffer> <Leader>gvd :call Git_diff_windows(1, 0)<cr>
+
+if !exists("g:git_diff_opts")
+    let g:git_diff_opts = "-C -C"
+endif
+if exists("g:git_diff_spawn_mode")
+    if g:git_diff_spawn_mode == 1
+        call Git_diff_windows(0, 1, g:git_diff_opts)
+    elseif g:git_diff_spawn_mode == 2
+        call Git_diff_windows(1, 1, g:git_diff_opts)
+    endif
+endif
+
+" }}}
diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim
new file mode 120000 (symlink)
index 0000000..2b44ad4
--- /dev/null
@@ -0,0 +1 @@
+/usr/share/vim-scripts/ftplugin/xml.vim
\ No newline at end of file
diff --git a/vim/ftplugin/mail/Mail_Re_set.vim b/vim/ftplugin/mail/Mail_Re_set.vim
new file mode 100644 (file)
index 0000000..ff80f5e
--- /dev/null
@@ -0,0 +1,310 @@
+"===============================================================
+" File          : Mail_Re_set.vim
+" Initial Author: Dominique Baldo
+" Maintained by        : Luc Hermitte <hermitte {at} free {dot} fr>
+"                 <URL:http://hermitte.free.fr/vim/>
+" URL: http://hermitte.free.fr/vim/ressources/vimfiles/ftplugin/mail/Mail_Re_set.vim
+" Version      : 2.0
+" Last update   : 15th Oct 2003
+"---------------------------------------------------------------
+" Purpose      : Merge the occurencies of "Re:" and "Re[n]" within
+"                e-mails'subject in only one.
+"
+" Calling conv.        : Source this file and invoke :MailCondenseRe
+"                define -> nnoremap ,re :MailCondenseRe<cr>
+" Installation : {{{1
+"  * Drop this file into {rtp}/ftplugin/mail/
+"  * There are two available options you can customize into your .vimrc :
+"    + Customize the way you want the "Re" string to be built thanks to
+"      g:mail_re_fmt or b:mail_re_fmt : 
+"      "Re:"    -- use "Re:"
+"      "Re[]:"  -- use "Re[n]:" when {n}>1 ; "Re:" when {n}=1
+"      "Re[1]:" -- use "Re[n]:" even when {n}>1
+"      "Mimic:" -- use what the correspondant used [default]
+"    + Customize the placement order between "Re:" and "[TAGS]" thanks to 
+"      g:mail_tag_placement or b:mail_tag_placement :
+"      "detect_news"   -- use "Re: [TAG]" for usenet, "[TAG] Re:" otherwise
+"                              [default]
+"      "tag_second"    -- use "Re: [TAG]" ; seems to be the right option on
+"                                           usenet according to trn
+"      "tag_first"     -- use "[TAG] Re:" ; seems to be the option used on
+"                                           tagged mailing lists
+" }}}1
+"---------------------------------------------------------------
+" History: {{{1
+"   * Ver 2.0  : Also merges the various forward indicators
+"   * Ver 1.4d : Fix a bug when g:mail_tag_placement is set
+"                Use "normal!" instead of "normal"
+"                New kind of whitespace managed: some people composing
+"                  their messages from yahogroups web site may use very odd
+"                  whitespace characters to write "Re :"
+"   * Ver 1.4c : Fix a small bug
+"   * Ver 1.4b : "Rép:" added to the list of "Re:" equivalents
+"   * ver 1.4  : "Re:" can be placed before or after the first [tag] present
+"                according to g:mail_tag_placement
+"   * ver 1.3  : Requires VIM 6.x
+"                Export a command: :MailCondenseRe
+"                count the Re: thanks to the global length of strings
+"                The subject build can be customized thanks to g:mail_re_fmt
+"                or b:mail_re_fmt.
+"                The "Re:" will be placed after the [Tags] if present.
+"   * ver 1.2  : Translation of the comments
+"   * ver 1.1  : Handle "Réf" produced by some french e-mailers
+"                Answer by "Re:" most of the time
+"   * ver 1.0  : Replace "Re: Re: ..." n times by "Re[n]:"
+" 
+" TODO: {{{1
+"   * Add an option to add equivalents to "Re:" -- only "Réf.:" and "Rép:" are
+"     supported at this time.
+"   * Support "Re: Fwd: Fw: "
+" }}}1
+"===============================================================
+if exists("b:loaded_local_Mail_Re_set_vim") | finish | endif
+let b:loaded_local_Mail_Re_set_vim = 1
+
+command! -b -nargs=0 MailCondenseRe       :call <sid>Mail_Merge_Re_n_Fwd(1,0)
+command! -b -nargs=0 MailCondenseFwd      :call <sid>Mail_Merge_Re_n_Fwd(0,1)
+command! -b -nargs=0 MailCondenseReAndFwd :call <sid>Mail_Merge_Re_n_Fwd(1,1)
+"===============================================================
+" Global definitions {{{1
+if exists("g:loaded_Mail_Re_set_vim") | finish | endif
+let g:loaded_Mail_Re_set_vim = 1
+"===============================================================
+" Options {{{2
+"---------------------------------------------------------------
+" Function: s:SetVar() to global or default {{{3
+function! s:SetVar(var,default)
+  if     exists('b:'.a:var) | let s:{a:var} = b:{a:var}
+  elseif exists('g:'.a:var) | let s:{a:var} = g:{a:var}
+  else                      | exe "let s:{a:var} =".a:default
+    " Rem: doing :exe to dequote a:default
+  endif
+endfunction
+command! -nargs=+ SetVar :call <sid>SetVar(<f-args>)
+" }}}3
+"---------------------------------------------------------------
+SetVar mail_re_fmt 'Mimic:'
+" SetVar mail_re_fmt 'Re[1]:'
+" Possible formats :
+"      "Re:"    -- use "Re:"
+"      "Re[]:"  -- use "Re[n]:" when {n}>1 ; "Re:" when {n}=1
+"      "Re[1]:" -- use "Re[n]:" even when {n}>1
+"      "Mimic:" -- use what the correspondant used
+" In order to override the default, set g:mail_re_fmt or b:mail_re_fmt to one
+" of the previous values.
+
+SetVar mail_tag_placement 'tag_second'
+" Possible values :
+"      "detect_news"   -- use "Re: [TAG]" for usenet, "[TAG] Re:" otherwise
+"      "tag_second"    -- use "Re: [TAG]" ; seems the right option on usenet
+"                                           accordingto trn
+"      "tag_first"     -- use "[TAG] Re:" ; seems the option used on taggued
+"                                           mailing lists
+
+"---------------------------------------------------------------
+delcommand SetVar
+" Options }}}2
+"===============================================================
+" Functions {{{2
+"---------------------------------------------------------------
+" Function:    ErrorMsg(msg) {{{3
+function! s:ErrorMsg(msg)
+  if has('gui_running')
+    call confirm(a:msg, '&Ok', 1, "Error")
+  else
+    echohl ErrorMsg
+    echo a:msg
+    echohl None
+  endif
+endfunction
+command! -buffer -nargs=1 MailErrMsg :call <sid>ErrorMsg(<args>)
+" }}}3
+"---------------------------------------------------------------
+" Function:    InsertReToSubject(Re_expr, Subject, Tag) {{{3
+" Purpose:     Add the Re expression to the subject according to the possible
+"              presence of tags in the subject.
+"              So, "[Tag] subject" will be changed to "[Tag] Re: subject" and
+"              not "Re: [Tag] subject" 
+function! s:InsertReToSubject(Re_expr, Subject, Tag)
+  let tag = (''!=a:Tag) ? a:Tag . ' ' : a:Tag
+  if "detect_news"    == s:mail_tag_placement
+    normal! 1G
+    let l = search('^\s*$')
+    let l = search('^Newsgroups:', 'bW')
+    let tag_after = (0!=l) ? 1 : 0
+  elseif "tag_second" == s:mail_tag_placement   | let tag_after = 1
+  elseif "tag_first"  == s:mail_tag_placement   | let tag_after = 0
+  else                                         | let tag_after = 0
+    MailErrMsg "<".s:mail_tag_placement."> is not a valid value for mail_tag_placement" 
+    " behave as tag first !
+  endif
+  if tag_after
+    return 'Subject: '.a:Re_expr. tag . a:Subject
+  else
+    return 'Subject: '. tag .a:Re_expr. a:Subject
+  endif
+  " return substitute(a:Subject, '^\(\[.*\] \=\)\=', ' \1'.a:Re_expr, '')
+endfunction
+" }}}3
+"---------------------------------------------------------------
+" Function     : MergeRe(string) {{{3
+" Purpose      : Substitute "Re:Re:Re:Re" by "Re:" and "Re:Re[2]" by "Re[3]"
+let s:tag    = '\[.\{-}\]'
+let s:Re     = '\<Re:'
+let s:Res    = s:Re.'\s*'
+let s:ReN    = '\<Re\s*\[\s*\d\+\s*\]\s*:'
+let s:ReNs   = s:ReN.'\s*'
+let s:anyRes = '\('.s:Res.'\|'.s:ReNs.'\)'
+
+function! s:ChangeReVariantsToRe(subject) " {{{4
+  " We replace all the "Réf.:", "Re :" or "Rép:" by "Re:" and erase spaces
+  " between "Re:"
+  let subject = substitute( a:subject, '\c\<r[ée]f\s*\.\s*:\s*', 'Re:', 'g' )
+  let subject = substitute( subject, '\c\<r[ée]p\s*:\s*', 'Re:', 'g' )
+  let subject = substitute( subject, '\c\<re\%(\s\|'.nr2char(160).'\)*\(\[\d\+\]\)\=\s*:\s*', 'Re\1:', 'g' )
+  " Note: the nr2char(160) is used because some people uses very odd
+  " whitespace characters...
+
+  return subject
+endfunction
+" }}}4
+
+func! s:MergeRe(string)
+  " We retrieve  the "real" subjet (discarding of all the "Re:")
+  " But first, we replace all the "Réf.:", "Re :" or "Rép:" by "Re:" {{{4
+  " and erase spaces between "Re:"
+  let subject = s:ChangeReVariantsToRe( a:string )
+
+  " Strip the first found [TAG]   {{{4
+  let s2 = substitute(subject, '^\(Subject:\s*'.s:anyRes.'*\)'.s:tag, '\1', '')
+  " We search for the first "Re:" {{{4
+  let rank=match(s2, '^Subject:\s*\('.s:Re.'\|'.s:ReN.'\)')
+  if -1 == rank " If none, it means we have finished
+    return subject 
+  else          " If there are "Re:" to discard ... {{{5
+    " n: "Re:" counter
+    let n=0
+    " Strip "Subject:\s*"
+    let tag = substitute(subject, '^Subject:\s*'.s:anyRes.'*\('.s:tag.'\)\=.*', '\2', '')
+    " call confirm("S2=".s2."\ntag=".tag, 'ok')
+    let subject = substitute(s2, '^Subject:\s*', '', '')
+    " Strip all the "Re:"
+    let Re_s = substitute(matchstr(subject, '^'.s:anyRes.'*'), '\s\+', '', 'g')
+    let subject = substitute(subject, '^'.s:anyRes.'*', '', '')
+    let Re_n = substitute(Re_s, s:Re, '', 'g')
+    " Compute the number of "Re:" stripped
+    let n = (strlen(Re_s)-strlen(Re_n))/3
+    " let subject = Re_n.subject
+  endif
+  " If there are "Re:" to discard ...
+
+  " Once at the end, we check for the presence of a "Re[x]:" {{{4
+  let end = matchend(Re_n, s:ReNs)
+  let n2 = 0
+  while -1!=end 
+    let num = strpart(Re_n,0,end)
+    " We extract the number x from "Re[x]" ...
+    let n2 = n2 + matchstr(num,'[0-9]\+')
+    let Re_n = strpart(Re_n, end)
+    let end = matchend(Re_n, s:ReNs)
+  endwhile
+
+  " Determine the format of the subject for the reponse {{{4
+  if     "Mimic:"==s:mail_re_fmt | let do_num = (0!=n2)   ? 1 : 0
+  elseif "Re[1]:"==s:mail_re_fmt | let do_num = 1
+  elseif "Re[]:" ==s:mail_re_fmt | let do_num = ((n+n2)>1) ? 1 : 0
+  elseif "Re:"   ==s:mail_re_fmt | let do_num = 0
+  else | MailErrMsg "<".s:mail_re_fmt."> is not a valid value for mail_re_fmt" 
+    " behave as "mimic" !
+    let do_num = (""!=num)   ? 1 : 0
+  endif
+
+  " Build the subject of the response {{{4
+  if 1==do_num
+    " add num to n (the number of "Re:")
+    let n = n + n2
+    let subject = s:InsertReToSubject('Re['.n.']: ', subject, tag)
+    " let subject = 'Subject: '.tag.'Re['.n.']: ' .subject
+    " let subject = 'Subject: '.'Re['.n.']: '.tag .subject
+  else
+    let subject = s:InsertReToSubject('Re: ', subject, tag)
+    " let subject = 'Subject: '.tag.'Re: ' .subject
+    " let subject = 'Subject: '.'Re: '.tag .subject
+  endif
+
+  " Finally, we return the new subject {{{4
+  return subject
+endf
+" }}}3
+"---------------------------------------------------------------
+" Function     : MergeFwd(string) {{{3
+" Purpose      : Substitute "Fwd:Fwd:Fwd:Fwd" by "Fwd:"
+let s:Fwd    = '\<Fwd:'
+let s:Fwds   = s:Fwd.'\s*'
+let s:anyFwds= '\%(' . s:Fwds . '\)'
+
+function! s:ChangeFwdVariantsToFwd(subject) " {{{4
+  " We replace all the "(fwd)", "Fw:", "Fwd :" or "Tr:" by "Fwd:" and erase
+  " spaces between "Fwd:"
+  let subject = substitute( a:subject, '\c\<fwd\=\s*:\s*', 'Fwd:', 'g' )
+  let subject = substitute( subject, '\c\<tr\s*:\s*', 'Fwd:', 'g' )
+  let subject = substitute( subject, '\c(fw\=d)\s*', 'Fwd:', 'g' )
+  let subject = substitute( subject, '\c\<fwd\%(\s\|'.nr2char(160).'\)*:\s*', 
+       \ 'Fwd:', 'g' )
+  " Note: the nr2char(160) is used because some people uses very odd
+  " whitespace characters...
+
+  return subject
+endfunction
+" }}}4
+
+func! s:MergeFwd(string)
+  " We retrieve  the "real" subjet (discarding of all the "Fwd:")
+  " First, we replace all the "(fwd)", "Fw:", "Fwd :" or "Tr:" by "Fwd:" {{{4
+  " and erase spaces between "Fwd:"
+  let subject = s:ChangeFwdVariantsToFwd( a:string )
+
+  " We search for the first "Fwd:"     {{{4
+  let rank=match(subject, '^Subject:\s*'.s:Fwd)
+  if -1 == rank " If none, it means we have finished
+    return subject 
+  else          " If there are "Fwd:" to discard ... {{{5
+    " Strip "^Subject:\s*"
+    let subject = matchstr(subject, '^Subject:\s*\zs.*')
+    " Store the forward-string used by the MUA
+    let fwd = matchstr(a:string, '^Subject:\s*\zs\S\{-}:\= ')
+    " Strip all the "Fwd:"
+    let subject = substitute(subject, '^'.s:anyFwds.'*', '', '')
+  endif
+
+  " Build the subject of the response  {{{4
+  let subject = 'Subject: '. fwd . subject
+
+  " Finally, we return the new subject {{{4
+  return subject
+endf
+" }}}3
+"---------------------------------------------------------------
+" Function: Mail_Merge_Re_n_Fwd() {{{3
+" Purpose: Main function ; goto start of file and execute the replacement of
+" the subject.
+function! s:Mail_Merge_Re_n_Fwd(do_re, do_fwd)
+  " Search the subject
+  normal! 1G
+  let l = search('^Subject:')
+  if 0 != l
+    " Get the corresponding line
+    let c=getline(l)
+    " And call MergeRe() & MergeFwd() on it.
+    if a:do_re  | let c = s:MergeRe(c)  | endif
+    if a:do_fwd | let c = s:MergeFwd(c) | endif
+    call setline(l, c)
+  endif
+endf
+" }}}3
+"---------------------------------------------------------------
+" Functions }}}2
+"===============================================================
+" }}}1
+"===============================================================
+" vim600: set fdm=marker:
diff --git a/vim/ftplugin/man.vim b/vim/ftplugin/man.vim
new file mode 100644 (file)
index 0000000..b256fd8
--- /dev/null
@@ -0,0 +1,178 @@
+" Vim filetype plugin file
+" Language:    man
+" Maintainer:  Nam SungHyun <namsh@kldp.org>
+" Last Change: 2006 Dec 04
+
+" To make the ":Man" command available before editing a manual page, source
+" this script from your startup vimrc file.
+
+" If 'filetype' isn't "man", we must have been called to only define ":Man".
+if &filetype == "man"
+
+  " Only do this when not done yet for this buffer
+  if exists("b:did_ftplugin")
+    finish
+  endif
+  let b:did_ftplugin = 1
+
+  " allow dot and dash in manual page name.
+  setlocal iskeyword+=\.,-
+
+  " Add mappings, unless the user didn't want this.
+  if !exists("no_plugin_maps") && !exists("no_man_maps")
+    if !hasmapto('<Plug>ManBS')
+      nmap <buffer> <LocalLeader>h <Plug>ManBS
+    endif
+    nnoremap <buffer> <Plug>ManBS :%s/.\b//g<CR>:setl nomod<CR>''
+
+    nnoremap <buffer> <c-]> :call <SID>PreGetPage(v:count)<CR>
+    nnoremap <buffer> <c-t> :call <SID>PopPage()<CR>
+  endif
+
+endif
+
+if exists(":Man") != 2
+  com -nargs=+ Man call s:GetPage(<f-args>)
+  nmap <Leader>K :call <SID>PreGetPage(0)<CR>
+endif
+
+" Define functions only once.
+if !exists("s:man_tag_depth")
+
+let s:man_tag_depth = 0
+
+if !has("win32") && $OSTYPE !~ 'cygwin\|linux' && system('uname -s') =~ "SunOS" && system('uname -r') =~ "^5"
+  let s:man_sect_arg = "-s"
+  let s:man_find_arg = "-l"
+else
+  let s:man_sect_arg = ""
+  let s:man_find_arg = "-w"
+endif
+
+func <SID>PreGetPage(cnt)
+  if a:cnt == 0
+    let old_isk = &iskeyword
+    setl iskeyword+=(,)
+    let str = expand("<cword>")
+    let &l:iskeyword = old_isk
+    let page = substitute(str, '(*\(\k\+\).*', '\1', '')
+    let sect = substitute(str, '\(\k\+\)(\([^()]*\)).*', '\2', '')
+    if match(sect, '^[0-9 ]\+$') == -1
+      let sect = ""
+    endif
+    if sect == page
+      let sect = ""
+    endif
+  else
+    let sect = a:cnt
+    let page = expand("<cword>")
+  endif
+  call s:GetPage(sect, page)
+endfunc
+
+func <SID>GetCmdArg(sect, page)
+  if a:sect == ''
+    return a:page
+  endif
+  return s:man_sect_arg.' '.a:sect.' '.a:page
+endfunc
+
+func <SID>FindPage(sect, page)
+  let where = system("/usr/bin/man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
+  if where !~ "^/"
+    if matchstr(where, " [^ ]*$") !~ "^ /"
+      return 0
+    endif
+  endif
+  return 1
+endfunc
+
+func <SID>GetPage(...)
+  if a:0 >= 2
+    let sect = a:1
+    let page = a:2
+  elseif a:0 >= 1
+    let sect = ""
+    let page = a:1
+  else
+    return
+  endif
+
+  " To support:            nmap K :Man <cword>
+  if page == '<cword>'
+    let page = expand('<cword>')
+  endif
+
+  if sect != "" && s:FindPage(sect, page) == 0
+    let sect = ""
+  endif
+  if s:FindPage(sect, page) == 0
+    echo "\nCannot find a '".page."'."
+    return
+  endif
+  exec "let s:man_tag_buf_".s:man_tag_depth." = ".bufnr("%")
+  exec "let s:man_tag_lin_".s:man_tag_depth." = ".line(".")
+  exec "let s:man_tag_col_".s:man_tag_depth." = ".col(".")
+  let s:man_tag_depth = s:man_tag_depth + 1
+
+  " Use an existing "man" window if it exists, otherwise open a new one.
+  if &filetype != "man"
+    let thiswin = winnr()
+    exe "norm! \<C-W>b"
+    if winnr() > 1
+      exe "norm! " . thiswin . "\<C-W>w"
+      while 1
+       if &filetype == "man"
+         break
+       endif
+       exe "norm! \<C-W>w"
+       if thiswin == winnr()
+         break
+       endif
+      endwhile
+    endif
+    if &filetype != "man"
+      new
+      setl nonu fdc=0
+    endif
+  endif
+  silent exec "edit $HOME/".page.".".sect."~"
+  " Avoid warning for editing the dummy file twice
+  setl buftype=nofile noswapfile
+
+  setl ma
+  silent exec "norm 1GdG"
+  let $MANWIDTH = 80
+  silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
+  " Remove blank lines from top and bottom.
+  while getline(1) =~ '^\s*$'
+    silent norm ggdd
+  endwhile
+  while getline('$') =~ '^\s*$'
+    silent norm Gdd
+  endwhile
+  1
+  setl ft=man nomod
+  setl bufhidden=hide
+  setl nobuflisted
+endfunc
+
+func <SID>PopPage()
+  if s:man_tag_depth > 0
+    let s:man_tag_depth = s:man_tag_depth - 1
+    exec "let s:man_tag_buf=s:man_tag_buf_".s:man_tag_depth
+    exec "let s:man_tag_lin=s:man_tag_lin_".s:man_tag_depth
+    exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
+    exec s:man_tag_buf."b"
+    exec s:man_tag_lin
+    exec "norm ".s:man_tag_col."|"
+    exec "unlet s:man_tag_buf_".s:man_tag_depth
+    exec "unlet s:man_tag_lin_".s:man_tag_depth
+    exec "unlet s:man_tag_col_".s:man_tag_depth
+    unlet s:man_tag_buf s:man_tag_lin s:man_tag_col
+  endif
+endfunc
+
+endif
+
+" vim: set sw=2:
diff --git a/vim/ftplugin/smarty.vim b/vim/ftplugin/smarty.vim
new file mode 120000 (symlink)
index 0000000..2b44ad4
--- /dev/null
@@ -0,0 +1 @@
+/usr/share/vim-scripts/ftplugin/xml.vim
\ No newline at end of file
diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim
new file mode 100644 (file)
index 0000000..2821d2b
--- /dev/null
@@ -0,0 +1,5 @@
+set sw=2
+set iskeyword+=:
+
+map <F12> \ll
+imap <buffer> <leader>it <Plug>Tex_InsertItemOnThisLine
diff --git a/vim/ftplugin/xhtml.vim b/vim/ftplugin/xhtml.vim
new file mode 120000 (symlink)
index 0000000..2b44ad4
--- /dev/null
@@ -0,0 +1 @@
+/usr/share/vim-scripts/ftplugin/xml.vim
\ No newline at end of file
diff --git a/vim/ftplugin/xml.vim b/vim/ftplugin/xml.vim
new file mode 120000 (symlink)
index 0000000..2b44ad4
--- /dev/null
@@ -0,0 +1 @@
+/usr/share/vim-scripts/ftplugin/xml.vim
\ No newline at end of file
diff --git a/vim/indent/mail.vim b/vim/indent/mail.vim
new file mode 100644 (file)
index 0000000..433c7ea
--- /dev/null
@@ -0,0 +1,101 @@
+" Vim indent file
+
+if exists("b:did_indent")
+  finish
+endif
+
+let b:did_indent = 1
+
+if !exists("g:mail_itemize_chars")
+  let g:mail_itemize_chars='o*+-'
+endif
+
+let s:item_cap_re='^ *\(['.g:mail_itemize_chars.']\) .*$'
+let s:item_re='^ *['.g:mail_itemize_chars.'] '
+let s:void_re='^\([>}].*\| *\)$'
+
+setlocal nocindent
+setlocal comments=n:},n:>
+setlocal nolisp
+setlocal nosmartindent
+setlocal noautoindent
+setlocal indentexpr=GetMailIndent()
+setlocal indentkeys=!^F,*<return>,o,O,<space>
+
+" Only define the function once.
+if exists("*GetMailIndent")
+  finish
+endif
+
+function! s:GetItemIndent(lnum)
+  let lnum = a:lnum
+  let char = substitute(getline(lnum), s:item_cap_re, '\1', '')
+  let maxind = 100
+  let lastind = -1
+
+  while lnum >= 1
+    let lnum = lnum - 1
+    let line = getline(lnum)
+    let ind = indent(lnum)
+
+    if line =~ s:void_re
+      return lastind < 0 ? 2 : lastind
+    end
+
+    if ind < maxind
+      let maxind = ind
+    
+      if line =~ s:item_re
+        if lastind < 0
+          let lastind = ind + 4
+        end
+
+        if char == substitute(line, s:item_cap_re, '\1', '')
+          return ind
+        end
+      end
+   
+    end
+  endwhile
+endfunction
+
+function GetMailIndent()
+  if v:lnum <= 1
+    return 0
+  end
+
+  let ind2 = indent(v:lnum - 2)
+  let ind1 = indent(v:lnum - 1)
+  let pre2 = getline(v:lnum - 2)
+  let pre1 = getline(v:lnum - 1)
+  let cur  = getline(v:lnum)
+
+  if cur =~ s:void_re || pre1 == '-- ' || cur =~ '-- '
+    return 0
+  endif
+
+  let ind = ind1
+
+  if pre1 =~ s:item_re
+    let ind = ind + 2
+  elseif pre2 =~ s:void_re || (ind2 <= 2 && pre2 =~ '[^a-zA-Z0-9]$')
+    let ind = ind - 2
+  end
+
+  let len = strlen(pre1) + strlen( substitute(cur, '^ *\([^ ]*\).*$', '\1', '') )
+  if pre1 =~ '[^a-zA-Z0-9]$' && len + 1 < &tw
+    if ind1 <= 2 && pre1 !~ s:item_re
+      let ind = 2
+    else
+      let ind = 0
+    end
+  end
+
+  if cur =~ s:item_re
+    let ind = s:GetItemIndent(v:lnum)
+  end
+
+  return ind
+endfunction
+
+" vim: set sts=2 sw=2:
diff --git a/vim/jptemplate/c/inc b/vim/jptemplate/c/inc
new file mode 100644 (file)
index 0000000..c2b8f7b
--- /dev/null
@@ -0,0 +1,2 @@
+#include <${header}>
+${cursor}
diff --git a/vim/jptemplate/c/main b/vim/jptemplate/c/main
new file mode 100644 (file)
index 0000000..4f0c5d1
--- /dev/null
@@ -0,0 +1,4 @@
+int main(int argc, char **argv)
+{
+    ${cursor}
+}
diff --git a/vim/jptemplate/cpp b/vim/jptemplate/cpp
new file mode 120000 (symlink)
index 0000000..3410062
--- /dev/null
@@ -0,0 +1 @@
+c
\ No newline at end of file
diff --git a/vim/jptemplate/tex/frame b/vim/jptemplate/tex/frame
new file mode 100644 (file)
index 0000000..c8d222e
--- /dev/null
@@ -0,0 +1,3 @@
+\begin{frame}{${Frame Title}}
+  ${cursor}
+\end{frame}
diff --git a/vim/jptemplate/tex/itemize b/vim/jptemplate/tex/itemize
new file mode 100644 (file)
index 0000000..14209f7
--- /dev/null
@@ -0,0 +1,6 @@
+\begin{itemize}
+  \item${cursor}
+  \item
+  \item
+  \item
+\end{itemize}
diff --git a/vim/plugin/BlockComment.vim b/vim/plugin/BlockComment.vim
new file mode 100644 (file)
index 0000000..165bb14
--- /dev/null
@@ -0,0 +1,234 @@
+" BlockComment.vim
+" Author: Chris Russell
+" Version: 1.1
+" License: GPL v2.0 
+" 
+" Description:
+" This script defineds functions and key mappings to block comment code.
+" 
+" Help: 
+" In brief, use '.c' to comment and '.C' to uncomment.
+" 
+" Both commenting and uncommenting can be run on N lines at a time by 
+" using a number before the command.  They both support visual mode and 
+" ranges.
+" 
+" This script will not comment lines with an indent level less that the 
+" initial line of the comment to preserve the control structure of code.
+"
+" Installation:
+" Simply drop this file into your plugin directory.
+" 
+" Changelog:
+" 2002-11-08 v1.1
+"      Convert to Unix eol
+" 2002-11-05 v1.0
+"      Initial release
+" 
+" TODO:
+" Add more file types
+" 
+
+
+"--------------------------------------------------
+" Avoid multiple sourcing
+"-------------------------------------------------- 
+if exists( "loaded_block_comment" )
+       finish
+endif
+let loaded_block_comment = 1
+
+
+"--------------------------------------------------
+" Key mappings
+"-------------------------------------------------- 
+noremap <silent> .c :call Comment()<CR>
+noremap <silent> .C :call UnComment()<CR>
+
+
+"--------------------------------------------------
+" Set comment characters by filetype
+"-------------------------------------------------- 
+function! CommentStr()
+       let s:comment_pad = '--------------------------------------------------'
+       if &ft == "vim"
+               let s:comment_strt = '"'
+               let s:comment_mid0 = '" '
+               let s:comment_mid1 = '"'
+               let s:comment_stop = ' '
+               let s:comment_bkup = 0
+       elseif &ft == "c" || &ft == "css"
+               let s:comment_strt = '/*'
+               let s:comment_mid0 = '* '
+               let s:comment_mid1 = '*'
+               let s:comment_stop = '*/'
+               let s:comment_bkup = 1
+               let s:comment_strtbak = '/ *'
+               let s:comment_stopbak = '* /'
+       elseif &ft == "cpp" || &ft == "java" || &ft == "javascript" || &ft == "php"
+               let s:comment_strt = '//'
+               let s:comment_mid0 = '// '
+               let s:comment_mid1 = '//'
+               let s:comment_stop = ' '
+               let s:comment_bkup = 0
+       elseif &ft == "tex"
+               let s:comment_strt = '%'
+               let s:comment_mid0 = '% '
+               let s:comment_mid1 = '%'
+               let s:comment_stop = ' '
+               let s:comment_bkup = 0
+       elseif &ft == "asm" || &ft == "lisp" || &ft == "scheme"
+               let s:comment_strt = ';'
+               let s:comment_mid0 = '; '
+               let s:comment_mid1 = ';'
+               let s:comment_stop = ' '
+               let s:comment_bkup = 0
+       elseif &ft == "vb"
+               let s:comment_strt = '\''
+               let s:comment_mid0 = '\' '
+               let s:comment_mid1 = '\''
+               let s:comment_stop = ' '
+               let s:comment_bkup = 0
+       elseif &ft == "html" || &ft == "xml" || &ft == "entity"
+               let s:comment_strt = '<!--'
+               let s:comment_mid0 = '! '
+               let s:comment_mid1 = '!'
+               let s:comment_stop = '-->'
+               let s:comment_bkup = 1
+               let s:comment_strtbak = '< !--'
+               let s:comment_stopbak = '-- >'
+       else
+               let s:comment_strt = '#'
+               let s:comment_mid0 = '# '
+               let s:comment_mid1 = '#'
+               let s:comment_stop = ' '
+               let s:comment_bkup = 0
+       endif
+endfunction
+
+"--------------------------------------------------
+" Comment a block of code
+"-------------------------------------------------- 
+function! Comment() range
+       " range variables
+       let l:firstln = a:firstline
+       let l:lastln = a:lastline
+       " get comment chars
+       call CommentStr()
+       " get tab indent level
+       let l:indent = indent( l:firstln ) / &tabstop
+       " loop to get padding str
+       let l:pad = ""
+       let l:i = 0
+       while l:i < l:indent
+               let l:pad = l:pad . "\t"
+               let l:i = l:i + 1
+       endwhile
+       " loop for each line
+       let l:block = 0
+       let l:midline = l:firstln
+       while l:midline <= l:lastln
+               " get line
+               let l:line = getline( l:midline )
+               " check if padding matches
+               if strpart( l:line, 0, l:indent ) == l:pad
+                       " start comment block
+                       if l:block == 0
+                               call append( l:midline - 1, l:pad . s:comment_strt . s:comment_pad )
+                               let l:midline = l:midline + 1
+                               let l:lastln = l:lastln + 1
+                               let l:block = 1
+                       endif
+                       " append comment between indent and code
+                       let l:line = strpart( l:line, l:indent )
+                       " handle comments within comments
+                       if s:comment_bkup == 1
+                               let l:line = substitute( l:line, escape( s:comment_strt, '\*^$.~[]' ), s:comment_strtbak, "g" )
+                               let l:line = substitute( l:line, escape( s:comment_stop, '\*^$.~[]' ), s:comment_stopbak, "g" )
+                       endif
+                       call setline( l:midline, l:pad . s:comment_mid0 . l:line )
+               " else end block
+               elseif l:block == 1
+                       call append( l:midline - 1, l:pad . s:comment_mid1 . s:comment_pad . s:comment_stop )
+                       let l:midline = l:midline + 1
+                       let l:lastln = l:lastln + 1
+                       let l:block = 0
+               endif
+               let l:midline = l:midline + 1
+       endwhile
+       " end block
+       if l:block == 1
+               call append( l:lastln, l:pad . s:comment_mid1 . s:comment_pad . s:comment_stop )
+       endif
+       " return to first line of comment
+       execute l:firstln
+endfunction
+
+"--------------------------------------------------
+" Uncomment a block of code
+"-------------------------------------------------- 
+function! UnComment() range
+       " range variables
+       let l:firstln = a:firstline
+       let l:lastln = a:lastline
+       " get comment chars
+       call CommentStr()
+       " get length of comment string
+       let l:clen = strlen( s:comment_mid0 )
+       " loop for each line
+       let l:midline = l:firstln
+       while l:midline <= l:lastln
+               " get indent level - process indent for each line instead of by block
+               let l:indent = indent( l:midline ) / &tabstop
+               let l:line = getline( l:midline )
+               " begin comment block line - delete line
+               if strpart( l:line, l:indent ) == s:comment_strt . s:comment_pad
+                       execute l:midline . "d"
+                       let l:midline = l:midline - 1
+                       let l:lastln = l:lastln - 1 
+               " end comment block line - delete line
+               elseif strpart( l:line, l:indent ) == s:comment_mid1 . s:comment_pad . s:comment_stop
+                       execute l:midline . "d"
+                       let l:midline = l:midline - 1
+                       let l:lastln = l:lastln - 1
+               " commented code line - remove comment
+               elseif strpart( l:line, l:indent, l:clen ) == s:comment_mid0
+                       let l:pad = strpart( l:line, 0, l:indent )
+                       let l:line = strpart( l:line, l:indent + l:clen )
+                       " handle comments within comments
+                       if s:comment_bkup == 1
+                               let l:line = substitute( l:line, escape( s:comment_strtbak, '\*^$.~[]' ), s:comment_strt, "g" )
+                               let l:line = substitute( l:line, escape( s:comment_stopbak, '\*^$.~[]' ), s:comment_stop, "g" )
+                       endif
+                       call setline( l:midline, l:pad . l:line )
+               endif
+               let l:midline = l:midline + 1
+       endwhile
+       " look at line above block
+       let l:indent = indent( l:firstln - 1 ) / &tabstop
+       let l:line = getline( l:firstln - 1 )
+       " abandoned begin comment block line - delete line
+       if strpart( l:line, l:indent ) == s:comment_strt . s:comment_pad
+               execute ( l:firstln - 1 ) . "d"
+               let l:firstln = l:firstln - 1
+               let l:lastln = l:lastln - 1
+       " abandoned commented code line - insert end comment block line
+       elseif strpart( l:line, l:indent, l:clen ) == s:comment_mid0
+               let l:pad = strpart( l:line, 0, l:indent )
+               call append( l:firstln - 1, l:pad . s:comment_mid1 . s:comment_pad . s:comment_stop )
+               let l:lastln = l:lastln + 1
+       endif
+       " look at line belowe block
+       let l:indent = indent( l:lastln + 1 ) / &tabstop
+       let l:line = getline( l:lastln + 1 )
+       " abandoned end comment block line - delete line
+       if strpart( l:line, l:indent ) == s:comment_mid1 . s:comment_pad . s:comment_stop
+               execute ( l:lastln + 1 ) . "d"
+               let l:lastln = l:lastln - 1
+       " abandoned commented code line - insert begin comment block line
+       elseif strpart( l:line, l:indent, l:clen ) == s:comment_mid0
+               let l:pad = strpart( l:line, 0, l:indent )
+               call append( l:lastln, l:pad . s:comment_strt . s:comment_pad )
+       endif
+endfunction
+
diff --git a/vim/plugin/ZoomWin.vim b/vim/plugin/ZoomWin.vim
new file mode 100644 (file)
index 0000000..c11d54a
--- /dev/null
@@ -0,0 +1,203 @@
+" ZoomWin: Brief-like ability to zoom into/out-of a window
+"  Author: Ron Aaron
+"          modified by Charles Campbell
+" Version: 19
+" History: see :he zoomwin-history
+
+" ---------------------------------------------------------------------
+if &cp || exists("s:loaded_zoomwin")
+ finish
+endif
+let s:loaded_zoomwin= 1
+
+" ---------------------------------------------------------------------
+"  Public Interface:
+if !hasmapto("<Plug>ZoomWin")
+ nmap <unique> <c-w>o  <Plug>ZoomWin
+endif
+nnoremap <silent> <script> <Plug>ZoomWin :set lz<CR>:call ZoomWin()<CR>:set nolz<CR>
+com! ZoomWin :set lz|silent call ZoomWin()|set nolz
+
+au VimLeave * call <SID>CleanupSessionFile()
+
+" ---------------------------------------------------------------------
+
+" ZoomWin: toggles between a single-window and a multi-window layout
+"          The original was by Ron Aaron and has been extensively
+"          modified by Charles E. Campbell.
+fun! ZoomWin()  
+"  let g:decho_hide= 1         "Decho
+"  call Dfunc("ZoomWin() winbufnr(2)=".winbufnr(2))
+
+  let keep_hidden = &hidden
+  let keep_write  = &write
+  if &wmh == 0 || &wmw == 0
+   let keep_wmh = &wmh
+   let keep_wmw = &wmw
+   set wmh=1 wmw=1
+  endif
+  set hidden write
+
+  if winbufnr(2) == -1
+    " there's only one window - restore to multiple-windows mode
+    
+    if exists("s:sessionfile") && filereadable(s:sessionfile)
+      let sponly= s:SavePosn(0)
+
+      " read session file to restore window layout
+         let ei_keep= &ei
+         set ei=all
+      exe 'silent! so '.s:sessionfile
+      let v:this_session= s:sesskeep
+
+      if exists("s:savedposn1")
+        " restore windows' positioning and buffers
+        windo call s:RestorePosn(s:savedposn{winnr()})|unlet s:savedposn{winnr()}
+        call s:GotoWinNum(s:winkeep)
+        unlet s:winkeep
+      endif
+
+         if line(".") != s:origline || virtcol(".") != s:origcol
+          " If the cursor hasn't moved from the original position,
+          " then let the position remain what it was in the original
+          " multi-window layout.
+       call s:RestorePosn(sponly)
+         endif
+
+         " delete session file and variable holding its name
+      call delete(s:sessionfile)
+      unlet s:sessionfile
+         let &ei=ei_keep
+    endif
+
+  else " there's more than one window - go to only-one-window mode
+
+    let s:winkeep    = winnr()
+    let s:sesskeep   = v:this_session
+       let s:origline   = line(".")
+       let s:origcol    = virtcol(".")
+
+       " doesn't work with the command line window (normal mode q:)
+       if &bt == "nofile" && expand("%") == "command-line"
+        echoerr "***error*** ZoomWin doesn't work with the command line window"
+"     call Dret("ZoomWin")
+        return
+       endif
+
+    " save window positioning commands
+    let ei_keep   = &ei
+       set ei=all
+    windo let s:savedposn{winnr()}= s:SavePosn(1)
+    call s:GotoWinNum(s:winkeep)
+
+    " set up name of session file
+    let s:sessionfile= tempname()
+
+    " save session
+    let ssop_keep = &ssop
+    let &ssop     = 'blank,help,winsize'
+    exe 'mksession! '.s:sessionfile
+    set lz ei=all bh=
+     exe "new! ".s:sessionfile
+     v/wincmd\|split\|resize/d
+     w!
+        bw!
+    set nolz
+    let &ssop = ssop_keep
+    only!
+    let &ei   = ei_keep
+    echomsg expand("%")
+  endif
+
+  " restore user option settings
+  let &hidden= keep_hidden
+  let &write = keep_write
+  if exists("keep_wmw")
+   let &wmh= keep_wmh
+   let &wmw= keep_wmw
+  endif
+"  call Dret("ZoomWin")
+endfun
+
+" ---------------------------------------------------------------------
+
+" SavePosn: this function sets up a savedposn variable that
+"          has the commands necessary to restore the view
+"          of the current window.
+fun! s:SavePosn(savewinhoriz)
+"  call Dfunc("SavePosn(savewinhoriz=".a:savewinhoriz.") file<".expand("%").">")
+  let swline    = line(".")
+  let swcol     = col(".")
+  let swwline   = winline()-1
+  let swwcol    = virtcol(".") - wincol()
+  let savedposn = "silent b ".winbufnr(0)."|".swline."|silent norm! z\<cr>"
+  if swwline > 0
+   let savedposn= savedposn.":silent norm! ".swwline."\<c-y>\<cr>:silent norm! zs\<cr>"
+  endif
+  let savedposn= savedposn.":silent call cursor(".swline.",".swcol.")\<cr>"
+
+  if a:savewinhoriz
+   if swwcol > 0
+    let savedposn= savedposn.":silent norm! ".swwcol."zl\<cr>"
+   endif
+
+   " handle certain special settings for the multi-window savedposn call
+   "   bufhidden buftype buflisted
+   let settings= ""
+   if &bh != ""
+       let settings="bh=".&bh
+       setlocal bh=hide
+   endif
+   if !&bl
+       let settings= settings." nobl"
+       setlocal bl
+   endif
+   if &bt != ""
+       let settings= settings." bt=".&bt
+       setlocal bt=
+   endif
+   if settings != ""
+       let savedposn= savedposn.":setlocal ".settings."\<cr>"
+   endif
+
+  endif
+"  call Dret("SavePosn savedposn<".savedposn.">")
+  return savedposn
+endfun
+
+" ---------------------------------------------------------------------
+
+" s:RestorePosn: this function restores noname and scratch windows
+fun! s:RestorePosn(savedposn)
+"  call Dfunc("RestorePosn(savedposn<".a:savedposn.">) file<".expand("%").">")
+  exe a:savedposn
+"  call Dret("RestorePosn")
+endfun
+
+" ---------------------------------------------------------------------
+
+" CleanupSessionFile: if you exit Vim before cleaning up the
+"                     supposed-to-be temporary session file
+fun! s:CleanupSessionFile()
+"  call Dfunc("CleanupSessionFile()")
+  if exists("s:sessionfile") && filereadable(s:sessionfile)
+"   call Decho("sessionfile exists and is readable; deleting it")
+   silent! call delete(s:sessionfile)
+   unlet s:sessionfile
+  endif
+"  call Dret("CleanupSessionFile")
+endfun
+
+" ---------------------------------------------------------------------
+
+" GotoWinNum: this function puts cursor into specified window
+fun! s:GotoWinNum(winnum)
+"  call Dfunc("GotoWinNum(winnum=".a:winnum.") winnr=".winnr())
+  if a:winnum != winnr()
+   exe a:winnum."wincmd w"
+  endif
+"  call Dret("GotoWinNum")
+endfun
+
+" ---------------------------------------------------------------------
+" vim: ts=4
diff --git a/vim/plugin/file:line.vim b/vim/plugin/file:line.vim
new file mode 100644 (file)
index 0000000..434b2ba
--- /dev/null
@@ -0,0 +1,19 @@
+
+function! s:gotoline()
+       let file = bufname("%")
+       let names =  matchlist( file, '\(.*\):\(\d\+\)')
+
+       if len(names) != 0 && filereadable(names[1])
+               let l:bufn = bufnr("%")
+               exec ":e " . names[1]
+               exec ":" . names[2]
+               exec ":bdelete " . l:bufn
+               if foldlevel(names[2]) > 0
+                       exec ":foldopen!"
+               endif
+       endif
+
+endfunction
+
+autocmd! BufNewFile *:* nested call s:gotoline()
+
diff --git a/vim/plugin/jptemplate.vim b/vim/plugin/jptemplate.vim
new file mode 100644 (file)
index 0000000..00a174a
--- /dev/null
@@ -0,0 +1,203 @@
+" jptemplate.vim: 
+" 
+" A comfortable, interactive templating system for VIM.
+" 
+" Copyright (c) 2008 Jannis Pohlmann <jannis@xfce.org>.
+"
+" This program is free software; you can redistribute it and/or modify 
+" it under the terms of the GNU General Public License as published by 
+" the Free Software Foundation; either version 2 of the License, or (at 
+" your option) any later version.
+"
+" This program is distributed in the hope that it will be useful, but 
+" WITHOUT ANY WARRANTY; without even the implied warranty of 
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+" General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License 
+" along with this program; if not, write to the Free Software 
+" Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
+" MA  02111-1307  USA
+"
+" TODO:
+" - Code cleanup
+"
+
+
+" Default template dir used if g:jpTemplateDir is not set
+let s:defaultTemplateDir = $HOME . '/.vim/jptemplate'
+
+" Debug mode
+let s:debug = 1
+
+
+function! jp:GetTemplateInfo ()
+
+  " Prepare info dictionary
+  let info = {}
+
+  " Get part of the line before the cursor
+  let part = getline  ('.')[0 : getpos ('.')[2]-1]
+
+  " Get start and end position of the template name
+  let info['start'] = match    (part, '\(\w*\)$')
+  let info['end']   = matchend (part, '\(\w*\)$')
+
+  " Get template name
+  let info['name']  = part[info['start'] : info['end']]
+
+  " Throw exception if no template name could be found
+  if info['name'] == ''
+    throw 'No template name found at cursor'
+  endif
+
+  " Calculate line indentation
+  let info['indent'] = max ([0, matchend (part, '^\s\+')])
+
+  " Return template name information
+  return info
+
+endfunction
+
+
+function! jp:ReadTemplate (name, filename)
+  
+  " Try to read the template file and throw exception if that fails
+  try
+    return readfile (a:filename)
+  catch
+    throw 'Template "' . a:name . '" could not be found.'
+  endtry
+
+endfunction
+
+
+function! jp:SetCursorPosition (lines)
+
+  for cnt in range (0, a:lines)
+    " Search for ${cursor} in the current line
+    let str    = getline  (line ('.') + cnt)
+    let start  = match    (str, '${cursor}')
+    let end    = matchend (str, '${cursor}') 
+    let before = strpart  (str, 0, start)
+    let after  = strpart  (str, end)
+
+    if start >= 0
+      " Remove ${cursor} and move the cursor to the desired position
+      call setline (line ('.') + cnt, before . after)
+      call cursor (line ('.') + cnt, start+1)
+
+      " We're done
+      break
+    endif
+  endfor
+
+endfunction
+
+
+function! jp:ProcessTemplate (info, template)
+  
+  let matchpos  = 0
+  let variables = {}
+
+  let str = join (a:template, ' ')
+
+  " Detect all variable names of the template
+  while 1
+    " Find next variable start and end position
+    let start = match    (str, '${\(\w\|\s\)\+}', matchpos)
+    let end   = matchend (str, '${\(\w\|\s\)\+}', matchpos)
+
+    if start < 0
+      " Stop search if there is no variable left
+      break
+    else
+      if str[start+2 : end-2] == 'cursor'
+        let matchpos = end
+      else
+        " Add variable name (without ${}) to the dictionary
+        let variables[str[start+2 : end-2]] = 0
+    
+        " Start next search at the end position of this variable
+        let matchpos = end
+      endif
+    endif
+  endwhile
+
+  " Ask the user to enter values for all variables
+  for name in keys (variables)
+    let variables[name] = input (name . ": ")
+  endfor
+
+  " Expand all variables
+  let index = 0
+  while index < len (a:template)
+    for var in items (variables)
+      let expr = '${' . var[0] . '}'
+      let a:template[index] = substitute (a:template[index], expr, var[1], 'g')
+    endfor
+    let index = index + 1
+  endwhile
+
+  " Backup characters before and after the template name
+  let before = strpart (getline ('.'), 0, a:info['start'])
+  let after  = strpart (getline ('.'), a:info['end'])
+
+  " Generate indentation
+  let indent = repeat (' ', a:info['indent'])
+
+  " Insert template into the code line by line
+  for cnt in range (0, len (a:template)-1)
+    if cnt == 0 
+      call setline (line ('.'), before . a:template[cnt])
+    else
+      call append (line ('.') + cnt - 1, indent . a:template[cnt])
+    endif
+    if cnt == len (a:template)-1
+      call setline (line ('.') + cnt, getline (line ('.') + cnt) . after)
+
+      " Move cursor to the end of the inserted template. ${cursor} may
+      " overwrite this
+      call cursor(line ('.'), len (getline (line ('.') + cnt)))
+    endif
+  endfor
+
+  " Set the cursor position
+  call jp:SetCursorPosition (cnt)
+
+  " Return to insert mode
+  startinsert!
+
+endfunction
+
+
+function! jp:InsertTemplate ()
+
+  " Determine the template directory
+  let templateDir = exists ('g:jpTemplateDir') ? g:jpTemplateDir : s:defaultTemplateDir
+
+  " Determine the filetype subdirectory
+  let ftDir = &ft == '' ? 'general' : &ft
+
+  try
+    " Detect bounds of the template name as well as the name itself
+    let info = jp:GetTemplateInfo ()
+
+    " Generate the full template filename
+    let templateFile = templateDir .'/'. ftDir . '/' . info['name']
+
+    " Load the template file
+    let template = jp:ReadTemplate (info['name'], templateFile)
+  
+    " Do the hard work: Process the template
+    call jp:ProcessTemplate (info, template)
+  catch
+    " Inform the user about errors
+    echo s:debug ? v:exception . " (in " . v:throwpoint . ")" : v:exception
+  endtry
+
+endfunction
+
+
+" Map <Ctrl>+<Tab> to the template system
+imap <Esc><Space> <Esc>:call jp:InsertTemplate()<CR>
diff --git a/vim/plugin/vis.vim b/vim/plugin/vis.vim
new file mode 100644 (file)
index 0000000..2e66068
--- /dev/null
@@ -0,0 +1,300 @@
+" vis.vim:
+" Function:    Perform an Ex command on a visual highlighted block (CTRL-V).
+" Version:     18
+" Date:                Aug 26, 2005
+" GetLatestVimScripts: 1066 1 cecutil.vim
+" GetLatestVimScripts: 1195 1 :AutoInstall: vis.vim
+" Verse: For am I now seeking the favor of men, or of God? Or am I striving
+" to please men? For if I were still pleasing men, I wouldn't be a servant
+" of Christ. (Gal 1:10, WEB)
+
+" ---------------------------------------------------------------------
+"  Details: {{{1
+" Requires: Requires 6.0 or later  (this script is a plugin)
+"           Requires <cecutil.vim> (see :he vis-required)
+"
+" Usage:    Mark visual block (CTRL-V) or visual character (v),
+"           press ':B ' and enter an Ex command [cmd].
+"
+"           ex. Use ctrl-v to visually mark the block then use
+"                 :B cmd     (will appear as   :'<,'>B cmd )
+"
+"           ex. Use v to visually mark the block then use
+"                 :B cmd     (will appear as   :'<,'>B cmd )
+"
+"           Command-line completion is supported for Ex commands.
+"
+" Note:     There must be a space before the '!' when invoking external shell
+"           commands, eg. ':B !sort'. Otherwise an error is reported.
+"
+" Author:   Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM> - NOSPAM
+"           Based on idea of Stefan Roemer <roemer@informatik.tu-muenchen.de>
+"
+" ------------------------------------------------------------------------------
+" Initialization: {{{1
+" Exit quickly when <Vis.vim> has already been loaded or
+" when 'compatible' is set
+if &cp || exists("g:loaded_vis")
+  finish
+endif
+let s:keepcpo    = &cpo
+let g:loaded_vis = "v18"
+set cpo&vim
+
+" ------------------------------------------------------------------------------
+" Public Interface: {{{1
+"  -range       : VisBlockCmd operates on the range itself
+"  -com=command : Ex command and arguments
+"  -nargs=+     : arguments may be supplied, up to any quantity
+com! -range -nargs=+ -com=command    B  silent <line1>,<line2>call s:VisBlockCmd(<q-args>)
+com! -range -nargs=* -com=expression S  silent <line1>,<line2>call s:VisBlockSearch(<q-args>)
+
+" Suggested by Hari --
+vn // <esc>/<c-r>=<SID>VisBlockSearch()<cr>
+vn ?? <esc>?<c-r>=<SID>VisBlockSearch()<cr>
+
+" ---------------------------------------------------------------------
+"  Support Functions: {{{1
+" ------------------------------------------------------------------------------
+" VisBlockCmd: {{{2
+fun! <SID>VisBlockCmd(cmd) range
+"  call Dfunc("VisBlockCmd(cmd<".a:cmd.">")
+
+  " retain and re-use same visual mode
+  norm `<
+  let curposn = SaveWinPosn()
+  let vmode   = visualmode()
+"  call Decho("vmode<".vmode.">")
+
+  " save options which otherwise may interfere
+  let keep_lz    = &lz
+  let keep_fen   = &fen
+  let keep_ic    = &ic
+  let keep_magic = &magic
+  let keep_sol   = &sol
+  let keep_ve    = &ve
+  let keep_ww    = &ww
+  set lz
+  set magic
+  set nofen
+  set noic
+  set nosol
+  set ve=
+  set ww=
+
+  " Save any contents in register a
+  let rega= @a
+
+  if vmode == 'V'
+"   call Decho("cmd<".a:cmd.">")
+   exe "'<,'>".a:cmd
+  else
+
+   " Initialize so begcol<endcol for non-v modes
+   let begcol   = s:VirtcolM1("<")
+   let endcol   = s:VirtcolM1(">")
+   if vmode != 'v'
+    if begcol > endcol
+     let begcol  = s:VirtcolM1(">")
+     let endcol  = s:VirtcolM1("<")
+    endif
+   endif
+
+   " Initialize so that begline<endline
+   let begline  = a:firstline
+   let endline  = a:lastline
+   if begline > endline
+    let begline = a:lastline
+    let endline = a:firstline
+   endif
+"   call Decho('beg['.begline.','.begcol.'] end['.endline.','.endcol.']')
+
+   " =======================
+   " Modify Selected Region:
+   " =======================
+   " 1. delete selected region into register "a
+"   call Decho("delete selected region into register a")
+   norm! gv"ad
+
+   " 2. put cut-out text at end-of-file
+"   call Decho("put cut-out text at end-of-file")
+   $
+   pu_
+   let lastline= line("$")
+   silent norm! "ap
+"   call Decho("reg-A<".@a.">")
+
+   " 3. apply command to those lines
+"   call Decho("apply command to those lines")
+   exe '.,$'.a:cmd
+
+   " 4. visual-block select the modified text in those lines
+"   call Decho("visual-block select modified text at end-of-file")
+   exe lastline
+   exe "norm! 0".vmode."G$\"ad"
+
+   " 5. delete excess lines
+"   call Decho("delete excess lines")
+   silent exe lastline.',$d'
+
+   " 6. put modified text back into file
+"   call Decho("put modifed text back into file (beginning=".begline.".".begcol.")")
+   exe begline
+   if begcol > 1
+    exe 'norm! '.begcol."\<bar>\"ap"
+   elseif begcol == 1
+    norm! 0"ap
+   else
+    norm! 0"aP
+   endif
+
+   " 7. attempt to restore gv -- this is limited, it will
+   " select the same size region in the same place as before,
+   " not necessarily the changed region
+   let begcol= begcol+1
+   let endcol= endcol+1
+   silent exe begline
+   silent exe 'norm! '.begcol."\<bar>".vmode
+   silent exe endline
+   silent exe 'norm! '.endcol."\<bar>\<esc>"
+   silent exe begline
+   silent exe 'norm! '.begcol."\<bar>"
+  endif
+
+  " restore register a and options
+"  call Decho("restore register a, options, and window pos'n")
+  let @a  = rega
+  let &lz = keep_lz
+  let &fen= keep_fen
+  let &ic = keep_ic
+  let &sol= keep_sol
+  let &ve = keep_ve
+  let &ww = keep_ww
+  call RestoreWinPosn(curposn)
+
+"  call Dret("VisBlockCmd")
+endfun
+
+" ------------------------------------------------------------------------------
+" VisBlockSearch: {{{2
+fun! <SID>VisBlockSearch(...) range
+"  call Dfunc("VisBlockSearch() a:0=".a:0." lines[".a:firstline.",".a:lastline."]")
+  let keepic= &ic
+  set noic
+
+  if a:0 >= 1 && strlen(a:1) > 0
+   let pattern   = a:1
+   let s:pattern = pattern
+"   call Decho("a:0=".a:0.": pattern<".pattern.">")
+  elseif exists("s:pattern")
+   let pattern= s:pattern
+  else
+   let pattern   = @/
+   let s:pattern = pattern
+  endif
+  let vmode= visualmode()
+
+  " collect search restrictions
+  let firstline  = line("'<")
+  let lastline   = line("'>")
+  let firstcolm1 = s:VirtcolM1("<")
+  let lastcolm1  = s:VirtcolM1(">")
+"  call Decho("1: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolm1=".lastcolm1)
+
+  if(firstline > lastline)
+   let firstline = line("'>")
+   let lastline  = line("'<")
+   if a:0 >= 1
+    norm! `>
+   endif
+  else
+   if a:0 >= 1
+    norm! `<
+   endif
+  endif
+"  call Decho("2: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolm1=".lastcolm1)
+
+  if vmode != 'v'
+   if firstcolm1 > lastcolm1
+       let tmp        = firstcolm1
+       let firstcolm1 = lastcolm1
+       let lastcolm1  = tmp
+   endif
+  endif
+"  call Decho("3: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolm1=".lastcolm1)
+
+  let firstlinem1 = firstline  - 1
+  let lastlinep1  = lastline   + 1
+  let firstcol    = firstcolm1 + 1
+  let lastcol     = lastcolm1  + 1
+  let lastcolp1   = lastcol    + 1
+"  call Decho("4: firstline=".firstline." lastline=".lastline." firstcolm1=".firstcolm1." lastcolp1=".lastcolp1)
+
+  " construct search string
+  if vmode == 'V'
+   let srch= '\%(\%>'.firstlinem1.'l\%<'.lastlinep1.'l\)\&'
+"   call Decho("V  srch: ".srch)
+  elseif vmode == 'v'
+   if firstline == lastline || firstline == lastlinep1
+       let srch= '\%(\%'.firstline.'l\%>'.firstcolm1.'v\%<'.lastcolp1.'v\)\&'
+   else
+    let srch= '\%(\%(\%'.firstline.'l\%>'.firstcolm1.'v\)\|\%(\%'.lastline.'l\%<'.lastcolp1.'v\)\|\%(\%>'.firstline.'l\%<'.lastline.'l\)\)\&'
+   endif
+"   call Decho("v  srch: ".srch)
+  else
+   let srch= '\%(\%>'.firstlinem1.'l\%>'.firstcolm1.'v\%<'.lastlinep1.'l\%<'.lastcolp1.'v\)\&'
+"   call Decho("^v srch: ".srch)
+  endif
+
+  " perform search
+  if a:0 <= 1
+"   call Decho("Search forward: <".srch.pattern.">")
+   call search(srch.pattern)
+   let @/= srch.pattern
+
+  elseif a:0 == 2
+"   call Decho("Search backward: <".srch.pattern.">")
+   call search(srch.pattern,a:2)
+   let @/= srch.pattern
+  endif
+
+  " restore ignorecase
+  let &ic= keepic
+
+"  call Dret("VisBlockSearch <".srch.">")
+  return srch
+endfun
+
+" ------------------------------------------------------------------------------
+" VirtcolM1: usually a virtcol(mark)-1, but due to tabs this can be different {{{2
+fun! s:VirtcolM1(mark)
+"  call Dfunc("VirtcolM1(mark ".a:mark.")")
+  let mark   = "'".a:mark
+
+  if virtcol(mark) <= 1
+"   call Dret("VirtcolM1 0")
+   return 0
+  endif
+
+  if &ve == "block"
+   " works around a ve=all vs ve=block difference with virtcol()
+   set ve=all
+"   call Decho("temporarily setting ve=all")
+  endif
+
+"  call Decho("exe norm! `".a:mark."h")
+  exe "norm! `".a:mark."h"
+
+  let vekeep = &ve
+  let vc  = virtcol(".")
+  let &ve = vekeep
+
+"  call Dret("VirtcolM1 ".vc)
+  return vc
+endfun
+
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" ------------------------------------------------------------------------------
+"  Modelines: {{{1
+" vim: fdm=marker
diff --git a/vim/syntax/actionscript.vim b/vim/syntax/actionscript.vim
new file mode 100644 (file)
index 0000000..3989c1c
--- /dev/null
@@ -0,0 +1,154 @@
+" Vim syntax file
+" Language:    actionScript
+" Maintainer:  Igor Dvorsky <amigo@modesite.net>
+" URL:         http://www.modesite.net/vim/actionscript.vim
+" Last Change: 2002 Sep 12
+" Updated to support AS 2.0 2004 Mar 12 by Richard Leider  (richard@appliedrhetoric.com)
+" Updated to support new AS 2.0 Flash 8 Language Elements 2005 September 29 (richard@appliedrhetoric.com)
+
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+  finish
+endif
+  let main_syntax = 'actionscript'
+endif
+
+" based on "JavaScript" VIM syntax by Claudio Fleiner <claudio@fleiner.com>
+
+syn case ignore
+syn match   actionScriptLineComment                    "\/\/.*$"
+syn match   actionScriptCommentSkip                    "^[ \t]*\*\($\|[ \t]\+\)"
+syn region  actionScriptCommentString                  start=+"+  skip=+\\\\\|\\"+  end=+"+ end=+\*/+me=s-1,he=s-1 contains=actionScriptSpecial,actionScriptCommentSkip,@htmlPreproc
+syn region  actionScriptComment2String                 start=+"+  skip=+\\\\\|\\"+  end=+$\|"+  contains=actionScriptSpecial,@htmlPreproc
+syn region  actionScriptComment                                start="/\*"  end="\*/" contains=actionScriptCommentString,actionScriptCharacter,actionScriptNumber
+syn match   actionScriptSpecial                                "\\\d\d\d\|\\."
+syn region  actionScriptStringD                                start=+"+  skip=+\\\\\|\\"+  end=+"+  contains=actionScriptSpecial,@htmlPreproc
+syn region  actionScriptStringS                                start=+'+  skip=+\\\\\|\\'+  end=+'+  contains=actionScriptSpecial,@htmlPreproc
+syn match   actionScriptSpecialCharacter               "'\\.'"
+syn match   actionScriptNumber                         "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn keyword actionScriptConditional                    if else and or not
+syn keyword actionScriptRepeat                         do while for in
+syn keyword actionScriptCase                           break continue switch case default
+syn keyword actionScriptConstructor                    new
+syn keyword actionScriptObjects                                arguments Array Boolean Date _global Math Number Object String super var this Accessibility Color Key _level Mouse _root Selection Sound Stage System TextFormat LoadVars XML XMLSocket XMLNode LoadVars Button TextField TextSnapshot CustomActions Error ContextMenu ContextMenuItem NetConnection NetStream Video PrintJob MovieClipLoader StyleSheet Camera LocalConnection Microphone SharedObject MovieClip
+syn keyword actionScriptStatement                      return with
+syn keyword actionScriptFunction                       function on onClipEvent
+syn keyword actionScriptValue                          true false undefined null NaN void
+syn keyword actionScriptArray                          concat join length pop push reverse shift slice sort sortOn splice toString unshift
+syn keyword actionScriptDate                           getDate getDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getYear setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setYear UTC 
+syn keyword actionScriptMath                           abs acos asin atan atan2 ceil cos E exp floor log LOG2E LOG10E LN2 LN10 max min PI pow random round sin sqrt SQRT1_2 SQRT2 tan -Infinity Infinity
+syn keyword actionScriptNumberObj                      MAX_VALUE MIN_VALUE NaN NEGATIVE_INFINITY POSITIVE_INFINITY valueOf 
+syn keyword actionScriptObject                         addProperty __proto__ registerClass toString unwatch valueOf watch
+syn keyword actionScriptString                         charAt charCodeAt concat fromCharCode indexOf lastIndexOf length slice split substr substring toLowerCase toUpperCase add le lt gt ge eq ne chr mbchr mblength mbord mbsubstring ord
+syn keyword actionScriptColor                          getRGB getTransform setRGB setTransform
+syn keyword actionScriptKey                                    addListener BACKSPACE CAPSLOCK CONTROL DELETEKEY DOWN END ENTER ESCAPE getAscii getCode HOME INSERT isDown isToggled LEFT onKeyDown onKeyUp PGDN PGUP removeListener RIGHT SHIFT SPACE TAB UP ALT
+syn keyword actionScriptMouse                          hide onMouseDown onMouseUp onMouseMove show onMouseWheel
+syn keyword actionScriptSelection                      getBeginIndex getCaretIndex getEndIndex getFocus setFocus setSelection  
+syn keyword actionScriptSound                          attachSound duration getBytesLoaded getBytesTotal getPan getTransform getVolume loadSound onLoad onSoundComplete position setPan setTransform setVolume start stop onID3
+syn keyword actionScriptStage                          align height onResize scaleMode width
+syn keyword actionScriptSystem                         capabilities hasAudioEncoder hasAccessibility hasAudio hasMP3 language manufacturer os pixelAspectRatio screenColor screenDPI screenResolution.x screenResolution.y version hasVideoEncoder security useCodepage exactSettings hasEmbeddedVideo screenResolutionX screenResolutionY input isDebugger serverString hasPrinting playertype hasStreamingAudio hasScreenBroadcast hasScreenPlayback hasStreamingVideo avHardwareDisable localFileReadDisable windowlesDisable
+syn keyword actionScriptTextFormat                     align blockIndent bold bullet color font getTextExtent indent italic leading leftMargin rightMargin size tabStops target underline url  
+syn keyword actionScriptCommunication          contentType getBytesLoaded getBytesTotal load loaded onLoad send sendAndLoad toString   addRequestHeader fscommand MMExecute
+syn keyword actionScriptXMLSocket                      close connect onClose onConnect onData onXML
+syn keyword actionScriptTextField                      autoSize background backgroundColor border borderColor bottomScroll embedFonts _focusrect getDepth getFontList getNewTextFormat getTextFormat hscroll html htmlText maxChars maxhscroll maxscroll multiline onChanged onScroller onSetFocus _parent password _quality removeTextField replaceSel replaceText restrict selectable setNewTextFormat setTextFormat text textColor textHeight textWidth type variable wordWrap condenseWhite mouseWheelEnabled textFieldHeight textFieldWidth ascent descent
+syn keyword actionScriptMethods                                callee caller _alpha attachMovie beginFill beginGradientFill clear createEmptyMovieClip createTextField _currentframe curveTo _droptarget duplicateMovieClip enabled endFill focusEnabled _framesloaded getBounds globalToLocal gotoAndPlay gotoAndStop _height _highquality hitArea hitTest lineStyle lineTo loadMovie loadMovieNum loadVariables loadVariablesNum localToGlobal moveTo _name nextFrame onDragOut onDragOver onEnterFrame onKeyDown onKeyUp onKillFocus onMouseDown onMouseMove onMouseUp onPress onRelease onReleaseOutside onRollOut onRollOver onUnload play prevFrame removeMovieClip _rotation setMask _soundbuftime startDrag stopDrag swapDepths tabChildren tabIndex _target _totalframes trackAsMenu unloadMovie unloadMovieNum updateAfterEvent _url useHandCursor _visible _width _x _xmouse _xscale _y _ymouse _yscale tabEnabled asfunction call setInterval clearInterval setProperty stopAllSounds #initclip #endinitclip delete unescape escape eval apply prototype getProperty getTimer getURL getVersion ifFrameLoaded #include instanceof int new nextScene parseFloat parseInt prevScene print printAsBitmap printAsBitmapNum printNum scroll set targetPath tellTarget toggleHighQuality trace typeof isActive getInstanceAtDepth getNextHighestDepth getNextDepth getSWFVersion getTextSnapshot isFinite isNAN updateProperties _lockroot get install list uninstall showMenu onSelect builtInItems save zoom quality loop rewind forward_back customItems caption separatorBefore visible attachVideo bufferLength bufferTime currentFps onStatus pause seek setBuffertime smoothing time bytesLoaded bytesTotal addPage paperWidth paperHeight pageWidth pageHeight orientation loadClip unloadClip getProgress onLoadStart onLoadProgress onLoadComplete onLoadInit onLoadError styleSheet copy hideBuiltInItem transform activityLevel allowDomain allowInsecureDomain attachAudio bandwidth deblocking domain flush fps gain getLocal getRemote getSize index isConnected keyFrameInterval liveDelay loopback motionLevel motionTimeOut menu muted names onActivity onSync publish rate receiveAudio receiveVideo setFps setGain setKeyFrameInterval setLoopback setMode setMotionLevel setQuality setRate setSilenceLevel setUseEchoSuppression showSettings setClipboard silenceLevel silenceTimeOut useEchoSuppression
+syn match   actionScriptBraces                         "([{}])"
+syn keyword actionScriptException                      try catch finally throw name message
+syn keyword actionScriptXML                                    attributes childNodes cloneNode createElement createTextNode docTypeDecl status firstChild hasChildNodes lastChild insertBefore nextSibling nodeName nodeType nodeValue parentNode parseXML previousSibling removeNode xmlDecl ignoreWhite
+syn keyword actionScriptArrayConstant          CASEINSENSITIVE DESCENDING UNIQUESORT RETURNINDEXEDARRAY NUMERIC
+syn keyword actionScriptStringConstant                 newline
+syn keyword actionScriptEventConstant          press release releaseOutside rollOver rollOut dragOver dragOut enterFrame unload mouseMove mouseDown mouseUp keyDown keyUp data
+syn keyword actionScriptTextSnapshot           getCount setSelected getSelected getText getSelectedText hitTestTextNearPos findText setSelectColor
+syn keyword actionScriptID3                            id3 artist album songtitle year genre track comment COMM TALB TBPM TCOM TCON TCOP TDAT TDLY TENC TEXT TFLT TIME TIT1 TIT2 TIT3 TKEY TLAN TLEN TMED TOAL TOFN TOLY TOPE TORY TOWN TPE1 TPE2 TPE3 TPE4 TPOS TPUB TRCK TRDA TRSN TRSO TSIZ TSRX TSSE TYER WXXX
+syn keyword actionScriptAS2                            class extends public private static interface implements import dynamic
+syn keyword actionScriptStyleSheet                     parse parseCSS getStyle setStyle getStyleNames
+syn keyword flash8Functions                             onMetaData onCuePoint flashdisplay flashexternal flashfilters flashgeom flashnet flashtext addCallback applyFilter browse cancel clone colorTransform  containsPoint containsRectangle copyChannel copyPixels createBox createGradientBox deltaTransformPoint dispose download draw equals fillRect floodFill generateFilterRect getColorBoundsRect getPixel getPixel32 identity inflate inflatePoint interpolate intersection intersects invert isEmpty loadBitmap merge noise normalize offsetPoint paletteMap perlinNoise pixelDissolve polar rotate scale setAdvancedAntialiasingTable setEmpty setPixel setPixel32 subtract threshold transformPoint translate union upload
+syn keyword flash8Constants                            ALPHANUMERIC_FULL ALPHANUMERIC_HALF CHINESE JAPANESE_HIRAGANA JAPANESE_KATAKANA_FULL JAPANESE_KATAKANA_HALF KOREAN UNKNOWN
+syn keyword flash8Properties                           appendChild cacheAsBitmap opaqueBackground scrollRect keyPress #initclip #endinitclip kerning letterSpacing onHTTPStatus lineGradientStyle IME windowlessDisable hasIME hideBuiltInItems onIMEComposition getEnabled setEnabled getConversionMode setConversionMode setCompositionString doConversion idMap antiAliasType available bottom bottomRight concatenatedColorTransform concatenatedMatrix creationDate creator fileList maxLevel modificationDate pixelBounds rectangle rgb top topLeft attachBitmap beginBitmapFill blendMode filters getRect scale9Grid gridFitType sharpness thickness
+syn keyword flash8Classes                              BevelFilter BitmapData BitmapFilter BlurFilter ColorMatrixFilter ColorTransform ConvolutionFilter DisplacementMapFilter DropShadowFilter ExternalInterface FileReference FileReferenceList GlowFilter GradientBevelFilter GradientGlowFilter Matrix Point Rectangle TextRenderer
+syn keyword actionScriptInclude #include #initClip #endInitClip
+" catch errors caused by wrong parenthesis
+syn match   actionScriptInParen     contained "[{}]"
+syn region  actionScriptParen       transparent start="(" end=")" contains=actionScriptParen,actionScript.*
+syn match   actionScrParenError  ")"
+
+if main_syntax == "actionscript"
+  syn sync ccomment actionScriptComment
+endif
+
+" 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_actionscript_syn_inits")
+  if version < 508
+    let did_actionscript_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+  HiLink actionScriptComment           Comment
+  HiLink actionScriptLineComment       Comment
+  HiLink actionScriptSpecial           Special
+  HiLink actionScriptStringS           String
+  HiLink actionScriptStringD           String
+  HiLink actionScriptCharacter         Character
+  HiLink actionScriptSpecialCharacter  actionScriptSpecial
+  HiLink actionScriptNumber            actionScriptValue
+  HiLink actionScriptBraces            Function
+  HiLink actionScriptError             Error
+  HiLink actionScrParenError           actionScriptError
+  HiLink actionScriptInParen           actionScriptError
+  HiLink actionScriptConditional       Conditional
+  HiLink actionScriptRepeat            Repeat
+  HiLink actionScriptCase              Label
+  HiLink actionScriptConstructor       Operator
+  HiLink actionScriptObjects           Operator
+  HiLink actionScriptStatement         Statement
+  HiLink actionScriptFunction          Function
+  HiLink actionScriptValue             Boolean
+  HiLink actionScriptArray             Type
+  HiLink actionScriptDate              Type
+  HiLink actionScriptMath              Type
+  HiLink actionScriptNumberObj         Type
+  HiLink actionScriptObject            Function
+  HiLink actionScriptString            Type
+  HiLink actionScriptColor             Type
+  HiLink actionScriptKey               Type
+  HiLink actionScriptMouse             Type
+  HiLink actionScriptSelection         Type
+  HiLink actionScriptSound             Type
+  HiLink actionScriptStage             Type
+  HiLink actionScriptSystem            Type
+  HiLink actionScriptTextFormat                Type
+  HiLink actionScriptCommunication     Type
+  HiLink actionScriptXMLSocket         Type
+  HiLink actionScriptTextField         Type
+  HiLink actionScriptMethods           Statement
+  HiLink actionScriptException         Exception
+  HiLink actionScriptXML                       Type
+  HiLink actionScriptArrayConstant     Constant
+  HiLink actionScriptStringConstant    Constant
+  HiLink actionScriptEventConstant     Constant
+  HiLink actionScriptTextSnapshot      Type
+  HiLink actionScriptID3                       Type
+  HiLink actionScriptAS2                       Function
+  HiLink actionScriptStyleSheet                Type
+  HiLink flash8Constants               Constant
+  HiLink flash8Functions               Function
+  HiLink flash8Properties              Type
+  HiLink flash8Classes                         Type
+  HiLink actionScriptInclude           Include
+  delcommand HiLink
+endif
+
+let b:current_syntax = "actionscript"
+if main_syntax == 'actionscript'
+  unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/vim/syntax/c.vim b/vim/syntax/c.vim
new file mode 100644 (file)
index 0000000..d31ab90
--- /dev/null
@@ -0,0 +1,18 @@
+
+syn keyword cOperator  ssizeof fieldsizeof countof assert offsetof
+syn keyword cStatement p_delete p_new p_new_raw p_clear p_realloc
+syn keyword cStatement mp_delete mp_new mp_new_raw
+syn keyword cStatement p_dup p_dupstr p_dupz
+
+syn keyword isGlobal   _G
+syn match   isGlobal "\<[a-zA-Z_][a-zA-Z0-9_]*_g\>"
+
+syn keyword cType byte
+syn match cType "\<[a-zA-Z_][a-zA-Z0-9_]*_[ft]\>"
+syn match cType "\<[a-zA-Z_][a-zA-Z0-9_]*_\(array\|vector\|htbl\|ring\|set\)\>"
+syn match cFunction "\<\([a-z][a-zA-Z0-9_]*\|[a-zA-Z_][a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\)\> *("me=e-1
+syn match Function "\$\<\([a-z][a-zA-Z0-9_]*\|[a-zA-Z_][a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\)\> *[({]"me=e-1
+
+hi def link isGlobal Function
+hi def link cStructure Type
+hi def link cStorageClass Statement
diff --git a/vim/syntax/debhints.vim b/vim/syntax/debhints.vim
new file mode 100644 (file)
index 0000000..599efde
--- /dev/null
@@ -0,0 +1,30 @@
+" Vim syntax file
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+setlocal iskeyword+=-
+
+syn region      hintComment     start=/^#/ end=/$/ contains=hintDate
+syn region      hintLine        start=/^[^#]/ end=/$/ contains=hintCommand,hintPkgSpec
+
+syn match       hintDate        contained "\<20[0-9]\{6\}\>"
+
+syn keyword     hintCommand     contained hint easy force-hint remove force block approve unblock urgent age-days block-all finished nextgroup=hintPkgSpec
+syn match       hintPkgSpec     contained "\(\w\|-\)\+\/\(\w\|[.~+\-]\)\+" contains=hintPkgVersion
+syn match       hintPkgVersion  contained "\/\(\w\|[.~+\-]\)\+"hs=s+1
+
+
+" Define the default highlighting.
+" Only used when an item doesn't have highlighting yet
+hi def link hintDate    Include
+hi def link hintComment        Comment
+
+hi def link hintCommand Keyword
+hi def link hintPkgVersion Number
+
+let b:current_syntax = "debhints"
+
+" vim: ts=8 sw=2
diff --git a/vim/syntax/javascript.vim b/vim/syntax/javascript.vim
new file mode 100644 (file)
index 0000000..944ce9f
--- /dev/null
@@ -0,0 +1,137 @@
+" Vim syntax file
+" Language:    JavaScript
+" Maintainer:  Claudio Fleiner <claudio@fleiner.com>
+" Updaters:    Scott Shattuck (ss) <ss@technicalpursuit.com>
+" URL:         http://www.fleiner.com/vim/syntax/javascript.vim
+" Changes:     (ss) added keywords, reserved words, and other identifiers
+"              (ss) repaired several quoting and grouping glitches
+"              (ss) fixed regex parsing issue with multiple qualifiers [gi]
+"              (ss) additional factoring of keywords, globals, and members
+" Last Change: 2006 Jun 19
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+" tuning parameters:
+" unlet javaScript_fold
+
+if !exists("main_syntax")
+  if version < 600
+    syntax clear
+  elseif exists("b:current_syntax")
+    finish
+  endif
+  let main_syntax = 'javascript'
+endif
+
+" Drop fold if it set but vim doesn't support it.
+if version < 600 && exists("javaScript_fold")
+  unlet javaScript_fold
+endif
+
+syn case ignore
+
+
+syn keyword javaScriptCommentTodo      TODO FIXME XXX TBD contained
+syn match   javaScriptLineComment      "\/\/.*" contains=@Spell,javaScriptCommentTodo
+syn match   javaScriptCommentSkip      "^[ \t]*\*\($\|[ \t]\+\)"
+syn region  javaScriptComment         start="/\*"  end="\*/" contains=@Spell,javaScriptCommentTodo
+syn match   javaScriptSpecial         "\\\d\d\d\|\\."
+syn region  javaScriptStringD         start=+"+  skip=+\\\\\|\\"+  end=+"\|$+  contains=javaScriptSpecial,@htmlPreproc
+syn region  javaScriptStringS         start=+'+  skip=+\\\\\|\\'+  end=+'\|$+  contains=javaScriptSpecial,@htmlPreproc
+
+syn match   javaScriptSpecialCharacter "'\\.'"
+syn match   javaScriptNumber          "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn region  javaScriptRegexpString     start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
+
+syn keyword javaScriptConditional      if else switch
+syn keyword javaScriptRepeat           while for do in
+syn keyword javaScriptBranch           break continue
+syn keyword javaScriptOperator         new delete instanceof typeof
+syn keyword javaScriptType             Array Boolean Date Function Number Object String RegExp
+syn keyword javaScriptStatement        return with
+syn keyword javaScriptBoolean          true false
+syn keyword javaScriptNull             null undefined
+syn keyword javaScriptIdentifier       arguments this var
+syn keyword javaScriptLabel            case default
+syn keyword javaScriptException                try catch finally throw
+syn keyword javaScriptMessage          alert confirm prompt status
+syn keyword javaScriptGlobal           self window top parent
+syn keyword javaScriptMember           document event location 
+syn keyword javaScriptDeprecated       escape unescape
+syn keyword javaScriptReserved         abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile 
+
+if exists("javaScript_fold")
+    syn match  javaScriptFunction      "\<function\>"
+    syn region javaScriptFunctionFold  start="\<function\>.*[^};]$" end="^\z1}.*$" transparent fold keepend
+
+    syn sync match javaScriptSync      grouphere javaScriptFunctionFold "\<function\>"
+    syn sync match javaScriptSync      grouphere NONE "^}"
+
+    setlocal foldmethod=syntax
+    setlocal foldtext=getline(v:foldstart)
+else
+    syn keyword        javaScriptFunction      function
+    syn match  javaScriptBraces           "[{}\[\]]"
+    syn match  javaScriptParens           "[()]"
+endif
+
+syn sync fromstart
+syn sync maxlines=100
+
+if main_syntax == "javascript"
+  syn sync ccomment javaScriptComment
+endif
+
+" 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_javascript_syn_inits")
+  if version < 508
+    let did_javascript_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+  HiLink javaScriptComment          Comment
+  HiLink javaScriptLineComment      Comment
+  HiLink javaScriptCommentTodo      Todo
+  HiLink javaScriptSpecial          Special
+  HiLink javaScriptStringS          String
+  HiLink javaScriptStringD          String
+  HiLink javaScriptCharacter        Character
+  HiLink javaScriptSpecialCharacter  javaScriptSpecial
+  HiLink javaScriptNumber           javaScriptValue
+  HiLink javaScriptConditional      Conditional
+  HiLink javaScriptRepeat           Repeat
+  HiLink javaScriptBranch           Conditional
+  HiLink javaScriptOperator         Operator
+  HiLink javaScriptType                     Type
+  HiLink javaScriptStatement        Statement
+  HiLink javaScriptFunction         Function
+  HiLink javaScriptBraces           Function
+  HiLink javaScriptError            Error
+  HiLink javaScrParenError          javaScriptError
+  HiLink javaScriptNull                        Keyword
+  HiLink javaScriptBoolean          Boolean
+  HiLink javaScriptRegexpString      String
+
+  HiLink javaScriptIdentifier          Identifier
+  HiLink javaScriptLabel               Label
+  HiLink javaScriptException           Exception
+  HiLink javaScriptMessage             Keyword
+  HiLink javaScriptGlobal              Keyword
+  HiLink javaScriptMember              Keyword
+  HiLink javaScriptDeprecated          Exception 
+  HiLink javaScriptReserved            Keyword
+  HiLink javaScriptDebug               Debug
+  HiLink javaScriptConstant            Label
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "javascript"
+if main_syntax == 'javascript'
+  unlet main_syntax
+endif
+
+" vim: ts=8
diff --git a/vim/syntax/mail.vim b/vim/syntax/mail.vim
new file mode 100644 (file)
index 0000000..2646d74
--- /dev/null
@@ -0,0 +1,13 @@
+hi def link mailSignature      NonText
+hi def link mailQuoted1                Identifier
+hi def link mailQuoted2                Type
+hi def link mailQuoted3                Special
+hi def link mailQuoted4                Comment
+hi def link mailQuoted5                Comment
+hi def link mailQuoted6                Comment
+hi def link mailQuoteExp1      mailQuoted1
+hi def link mailQuoteExp2      mailQuoted2
+hi def link mailQuoteExp3      mailQuoted3
+hi def link mailQuoteExp4      mailQuoted4
+hi def link mailQuoteExp5      mailQuoted5
+hi def link mailQuoteExp6      mailQuoted6
diff --git a/vim/syntax/make.vim b/vim/syntax/make.vim
new file mode 100644 (file)
index 0000000..599d374
--- /dev/null
@@ -0,0 +1,137 @@
+" Vim syntax file
+" Language:    Makefile
+" Maintainer:  Claudio Fleiner <claudio@fleiner.com>
+" URL:         http://www.fleiner.com/vim/syntax/make.vim
+" Last Change: 2007 Apr 30
+
+" 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
+
+" some special characters
+syn match makeSpecial  "^\s*[@+-]\+"
+syn match makeNextLine "\\\n\s*"
+
+" some directives
+syn match makePreCondit        "^ *\(ifeq\>\|else\>\|endif\>\|ifneq\>\|ifdef\>\|ifndef\>\)"
+syn match makeInclude  "^ *[-s]\=include"
+syn match makeStatement        "^ *vpath"
+syn match makeExport    "^ *\(export\|unexport\)\>"
+syn match makeOverride "^ *override"
+hi link makeOverride makeStatement
+hi link makeExport makeStatement
+
+" Koehler: catch unmatched define/endef keywords.  endef only matches it is by itself on a line
+syn region makeDefine start="^\s*define\s" end="^\s*endef\s*$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
+
+" Microsoft Makefile specials
+syn case ignore
+syn match makeInclude  "^! *include"
+syn match makePreCondit "! *\(cmdswitches\|error\|message\|include\|if\|ifdef\|ifndef\|else\|elseif\|else if\|else\s*ifdef\|else\s*ifndef\|endif\|undef\)\>"
+syn case match
+
+" identifiers
+syn region makeIdent   start="\$(" skip="\\)\|\\\\" end=")" contains=makeStatement,makeIdent,makeSString,makeDString
+syn region makeIdent   start="\${" skip="\\}\|\\\\" end="}" contains=makeStatement,makeIdent,makeSString,makeDString
+syn match makeIdent    "\$\$\w*"
+syn match makeIdent    "\$[^({]"
+syn match makeIdent    "^[\t ]*\S*[ \t]*[:+?!*]="me=e-2
+syn match makeIdent    "^[\t ]*\S*[ \t]*="me=e-1
+syn match makeIdent    "%"
+
+" Makefile.in variables
+syn match makeConfig "@[A-Za-z0-9_]\+@"
+
+" make targets
+" syn match makeSpecTarget     "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
+syn match makeImplicit         "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
+syn match makeImplicit         "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
+
+syn region makeTarget  transparent matchgroup=makeTarget start="^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeTarget           "^[A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget skipnl nextgroup=makeCommands,makeCommandError
+
+syn region makeSpecTarget      transparent matchgroup=makeSpecTarget start="^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*:\{1,2}[^:=]"rs=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
+syn match makeSpecTarget               "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>\s*::\=\s*$" contains=makeIdent skipnl nextgroup=makeCommands,makeCommandError
+
+syn match makeCommandError "^\s\+\S.*" contained
+syn region makeCommands start=";"hs=s+1 start="^\t" end="^[^\t#]"me=e-1,re=e-1 end="^$" contained contains=makeCmdNextLine,makeSpecial,makeComment,makeIdent,makePreCondit,makeDefine,makeDString,makeSString nextgroup=makeCommandError
+syn match makeCmdNextLine      "\\\n."he=e-1 contained
+
+
+" Statements / Functions (GNU make)
+syn match makeStatement contained "(\(subst\|abspath\|addprefix\|addsuffix\|and\|basename\|call\|dir\|error\|eval\|filter-out\|filter\|findstring\|firstword\|flavor\|foreach\|if\|info\|join\|lastword\|notdir\|or\|origin\|patsubst\|realpath\|shell\|sort\|strip\|suffix\|value\|warning\|wildcard\|word\|wordlist\|words\)\>"ms=s+1
+
+" Comment
+if exists("make_microsoft")
+   syn match  makeComment "#.*" contains=@Spell,makeTodo
+elseif !exists("make_no_comments")
+   syn region  makeComment     start="#" end="^$" end="[^\\]$" keepend contains=@Spell,makeTodo
+   syn match   makeComment     "#$" contains=@Spell
+endif
+syn keyword makeTodo TODO FIXME XXX contained
+
+" match escaped quotes and any other escaped character
+" except for $, as a backslash in front of a $ does
+" not make it a standard character, but instead it will
+" still act as the beginning of a variable
+" The escaped char is not highlightet currently
+syn match makeEscapedChar      "\\[^$]"
+
+
+syn region  makeDString start=+\(\\\)\@<!"+  skip=+\\.+  end=+"+  contains=makeIdent
+syn region  makeSString start=+\(\\\)\@<!'+  skip=+\\.+  end=+'+  contains=makeIdent
+syn region  makeBString start=+\(\\\)\@<!`+  skip=+\\.+  end=+`+  contains=makeIdent,makeSString,makeDString,makeNextLine
+
+" Syncing
+syn sync minlines=20 maxlines=200
+
+" Sync on Make command block region: When searching backwards hits a line that
+" can't be a command or a comment, use makeCommands if it looks like a target,
+" NONE otherwise.
+syn sync match makeCommandSync groupthere NONE "^[^\t#]"
+syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"
+syn sync match makeCommandSync groupthere makeCommands "^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}\s*$"
+
+" 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_make_syn_inits")
+  if version < 508
+    let did_make_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink makeNextLine          makeSpecial
+  HiLink makeCmdNextLine       makeSpecial
+  HiLink makeSpecTarget                Statement
+  if !exists("make_no_commands")
+    HiLink makeCommands                Number
+  endif
+  HiLink makeImplicit          Function
+  HiLink makeTarget            Function
+  HiLink makeInclude           Include
+  HiLink makePreCondit         PreCondit
+  HiLink makeStatement         Statement
+  HiLink makeIdent             Identifier
+  HiLink makeSpecial           Special
+  HiLink makeComment           Comment
+  HiLink makeDString           String
+  HiLink makeSString           String
+  HiLink makeBString           Function
+  HiLink makeError             Error
+  HiLink makeTodo              Todo
+  HiLink makeDefine            Define
+  HiLink makeCommandError      Error
+  HiLink makeConfig            PreCondit
+  delcommand HiLink
+endif
+
+let b:current_syntax = "make"
+
+" vim: ts=8
diff --git a/vim/syntax/massif.vim b/vim/syntax/massif.vim
new file mode 100644 (file)
index 0000000..e08d8d0
--- /dev/null
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language:    valgrind massif outputs
+
+" Quit when a (custom) syntax file was already loaded
+if exists("b:current_syntax")
+  finish
+endif
+
+syn region massifStanza start=/^== \d* ===*$/ end=/^==/
+  \ contains=massifHead,massifResult,massifSpecLine,massifSep
+
+syn region massifHead contained start=/^==/ end=/==$/ contains=massifSection
+syn match  massifSection /\d\+/ contained
+syn match  massifSep  /^--*$/ contained
+syn match  massifSpecLine /^[A-Z].*$/ contained contains=massifRate
+
+syn region massifResult contained start=/^\s*\d\+/ end=/$/
+  \ contains=massifFile,massifFunc,massifRate,massifAddr
+
+syn match  massifRate "\d\+\(\.\d\+\)\?%" contained
+syn match  massifAddr "0x[0-9A-Fa-f]*" contained
+syn match  massifFile "\((\)\@<=.*:\d\+\()\)\@=" contained
+
+hi def link massifHead     Type
+hi def link massifSection  Normal
+hi def link massifSep      Comment
+hi def link massifFile     Statement
+hi def link massifSpecLine Type
+
+hi def link massifRate     Constant
+hi def link massifAddr     NonText
+
+let b:current_syntax = "massif"
+
+" vim: ts=8 sw=2
diff --git a/vimrc b/vimrc
new file mode 100644 (file)
index 0000000..c849db9
--- /dev/null
+++ b/vimrc
@@ -0,0 +1,456 @@
+" {{{ settings
+
+set nocompatible                " Use Vim defaults instead of 100% vi compatibility
+set backspace=indent,eol,start  " more powerful backspacing
+
+set autoindent                  " always set auto-indenting on
+set autoread                    " reload unchanged files silentely
+set clipboard=unnamed           " copy/paste to global clipboard
+set hidden                      " allow to cycle and hide modified buffers
+set nobackup                    " Don't keep a backup file
+set backupcopy=auto,breakhardlink
+set swapsync=
+set esckeys                     " allow usage of curs keys within insert mode
+set timeout
+set ttimeoutlen=10
+set timeoutlen=500              " set timout for esc to 50ms
+
+set listchars=tab:\ \ ,trail:-,extends:>,precedes:<
+set list
+set joinspaces                  " insert two spaces after a period with every joining of lines.
+                                " This is very nice!
+set lazyredraw                  " [VIM5];  do not update screen while executing macros
+set ttyfast
+set magic                       " Use some magic in search patterns?  Certainly!
+set modeline                    " Allow the last line to be a modeline - useful when
+                                " the last line in sig gives the preferred text-width
+                                " for replies.
+set modelines=5
+set pastetoggle=<F4>
+
+set nonumber
+set report=0                    " show a report when N lines were changed.
+                                " report=0 thus means "show all changes"!
+
+set laststatus=2                " show status line?  Yes, always!
+set noruler                       " show cursor position?  Yep!
+set statusline=[\ %f%m\ %r%y\ %=\ hex:%B\ \ %l,%c%V\ \ %P\ ]
+
+set shiftwidth=4                " Number of spaces to use for each insertion of
+                                " (auto)indent.
+set shortmess=at                " Kind of messages to show.   Abbreviate them all!
+                                " New since vim-5.0v: flag 'I' to suppress "intro message".
+set scrolloff=2                 " context
+set showcmd                     " Show current uncompleted command?  Absolutely!
+set showmatch                   " Show the matching bracket for the last ')'?
+set showmode                    " Show the current mode?  YEEEEEEEEESSSSSSSSSSS!
+
+set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.cmi,.cmo
+                                " Suffixes to ignore in file completion
+
+set tabstop=8                   " tabstop
+set softtabstop=4               " sts
+set expandtab                   " expand tabs
+set notextmode                  " no - I am using Vim on UNIX!
+set textwidth=0                 " Don't wrap words by default
+set title                       " Permet de voir le tit. du doc. crt. ds les XTERM
+set viminfo='1000,/1000,:1000,<1000,@1000,n~/.viminfo
+set history=1000
+                                " What info to store from an editing session
+                                " in the viminfo file;  can be used at next session.
+set sessionoptions=buffers,folds,localoptions,options,tabpages,help
+
+set ignorecase                  " Do case insensitive matching
+set incsearch                   " Incremental search
+set hlsearch                    " hilight search
+
+
+set whichwrap=<,>,[,]           "
+set wildchar=<TAB>              " the char used for "expansion" on the command line
+                                " default value is "<C-E>" but I prefer the tab key:
+set wildmenu                    " Completion on the command line shows a menu
+set wildmode=longest,full
+set winminheight=0              " Minimum height of VIM's windows opened
+set mouse=a
+set mousefocus
+set wrapmargin=1
+set nowritebackup
+set foldmethod=marker
+
+set noequalalways
+set eadirection=
+
+set cpoptions-=C                " enable commands that continue on the next line
+
+" use ctrl-n ctrl-n instead of ctrl-x ctrl-k
+set complete-=k complete+=k
+
+set tags=tags;/,.tags;/,TAGS;/
+
+set cinoptions=
+set cinoptions+=t0             " type on the line before the functions is not idented
+set cinoptions+=:2,=2          " indent case ...: of 2 from the switch {
+set cinoptions+=(0,Ws          " indent in functions ( ... ) when it breaks
+set cinoptions+=g2,h2          " indent C++ scope of 2, and the members from 2 from it
+set cinoptions+=m1             " aligh the closing ) properly
+"set cinoptions+=l1            " align closing brace with the case
+"set cinoptions+=b1            " align break; with case ...:
+
+set diffopt=filler,context:5,iwhite
+set fillchars+=diff:\ ,vert:│
+
+set makeprg=LC_ALL=C\ make\ M=1
+
+exe "set path=." . system("echo | cpp -v 2>&1 | grep '^ .*/include' | tr -d \"\n\" | tr \" \" \",\"")
+set path+=.;/
+
+" }}}
+" {{{ vim 7 settings
+
+if version >= 700
+    set autochdir              " autochdir...
+    set virtualedit=onemore    " Yes I want to be able to be "on \n"
+    set spelllang=en_us,fr
+    set pumheight=16
+
+    " make <enter> work in popup
+    inoremap <cr> <C-R>=pumvisible() ? "\<lt>C-Y>" : "\<lt>cr>"<cr>
+else
+    au BufEnter * :lcd %:p:h
+endif
+
+" }}}
+" {{{ Window magic
+
+function! DeleteBuffer()
+   let bid = bufnr("%")
+   bnext
+   exe "bdel " . bid
+   redraw
+endfunction
+
+map <C-W>d :call DeleteBuffer()<cr>
+"map <C-W>k :bd<cr>
+map <C-W>g :bo cw 8<cr>
+
+" }}}
+" {{{ Mappings
+
+" {{{ Tab Key magic ...
+vmap <tab> >gv
+vmap <bs> <gv
+
+function! TabAlign()
+    let col  = col('.')
+    let lnum = line('.')
+
+    while lnum > 1
+        let lnum = lnum - 1
+        let ln = strpart(getline(lnum), col-1)
+        let ms = matchstr(ln, '[^ ]*  *[^ ]')
+        if ms != ""
+            break
+        endif
+    endwhile
+
+    if lnum == 1
+        return "\<Tab>"
+    else
+        let @z = substitute(strpart(ms, 0, strlen(ms)-1), '.', ' ', 'g')
+        if col > strlen(getline('.'))
+            return "\<C-O>\"zp"
+        else
+            return "\<C-O>\"zP"
+        endif
+    endif
+
+endfunction
+
+function! CleverTab()
+    let c = strpart(getline('.'), col('.')-2, 1)
+    if c == ' ' || c == '\t' || c == ''
+        return TabAlign()
+    else
+        return "\<C-P>"
+    endif
+endfunction
+inoremap <Tab> <C-R>=CleverTab()<CR>
+inoremap <S-Tab> <C-R>=TabAlign()<CR>
+
+" }}}
+
+map + :cn<cr>
+map - :cp<cr>
+map <kPlus> :cn<cr>
+map <kMinus> :cp<cr>
+
+map Q gq
+
+noremap  <F2>   :set mouse=a<cr>
+noremap  <F3>   :set mouse=h<cr>
+noremap  <F5>   :source ~/.vimrc<cr>
+
+inoremap <F6>   <c-o>mzviwU`z
+noremap  <F7>   :set ai!<CR>:set ai?<cr>
+inoremap <F7>   <space><esc><F7>a<bs>
+
+noremap  <F9>   :bp<cr>
+inoremap <F9>   <esc>:bp<cr>
+noremap  <F10>  :bn<cr>
+inoremap <F10>  <esc>:bn<cr>
+noremap  <F11>  :make!<cr>:bo cw 8<cr><cr>
+inoremap <F11>  <esc>:make!<cr>:bo cw 8<cr><cr>
+noremap  <S-F11> :make clean<cr><cr>
+inoremap <S-F11> <esc>:make clean<cr><cr>
+
+" }}}
+"{{{ FTYPES
+
+if has("autocmd")
+    filetype plugin indent on
+    syntax on
+
+    au BufReadPost *
+                \ if line("'\"") > 0 && line("'\"") <= line("$") |
+                \   exe "normal g`\"" |
+                \ endif
+
+    au VimLeave * mksession! ~/.cache/session.vim
+
+    au FileType debchangelog normal zO
+
+    au FileType javascript setlocal cindent tw=78 iskeyword+=$
+    au FileType actionscript setlocal cindent tw=78 iskeyword+=$ noignorecase ff=dos
+    au FileType mail setlocal noet iskeyword+=- tw=72
+
+    au FileType haxe setlocal tw=78 noignorecase cin ai
+    au FileType c,cpp setlocal tw=78 noignorecase "fo-=ro
+    au FileType ocaml,acute,omlet setlocal sw=2 sts=2 tw=78
+    au FileType php  setlocal et fo+=ro tw=78 indentexpr= cin
+    au FileType python setlocal foldmethod=indent foldnestmax=1
+
+    au FileType diff   setlocal nofoldenable
+
+    au FileType html,xhtml,xml setlocal sw=2
+    au FileType mail setlocal spell
+
+    " make error list special
+    au BufRead quickfix setlocal nobuflisted nowrap number
+
+    au FileType svn setlocal spell tw=76
+    au FileType git setlocal spell tw=76
+
+    au BufRead,BufNewFile */dev/scm/git/* setlocal noet sw=8
+
+    let ocaml_noindent_let=1
+    let git_diff_spawn_mode=2
+    let git_diff_opts = "--patience -C -C -M -B"
+    let c_gnu=1
+    let c_space_errors=1
+    let c_no_curly_error=1
+
+    let g:bufExplorerFindActive=0
+    let g:bufExplorerSplitOutPathName=1
+    let g:bufExplorerShowRelativePath=0
+    let g:bufExplorerSortBy='fullpath'
+
+    let g:is_bash=1
+    let g:sh_fold_enabled=1
+
+    let g:debchangelog_fold_enable = 1
+    let g:debcontrol_fold_enable = 1
+endif " has ("autocmd")
+
+" }}}
+" {{{ PLUGINS
+
+runtime macros/matchit.vim
+"runtime macros/justify.vim
+
+runtime ftplugin/man.vim
+nmap ! :exe "Man" expand("<cword>")<cr>
+
+" }}}
+" {{{ COLORS, GUI and FOLDING
+
+set background=light
+hi clear
+if exists("syntax_on")
+   syntax reset
+endif
+
+if has("gui_running")
+    set guioptions=eit
+    set guifont=terminus
+    set guicursor=a:blinkon0
+    set background=light
+
+    fun! GuiTabLabel()
+        let label = ''
+        let bufnrlist = tabpagebuflist(v:lnum)
+
+        " Append the number of windows in the tab page if more than one
+        let wincount = tabpagewinnr(v:lnum, '$')
+        let label .= wincount
+
+        " Add '[*]' if one of the buffers in the tab page is modified
+        for bufnr in bufnrlist
+            if getbufvar(bufnr, "&modified")
+                let label .= '[*]'
+                break
+            endif
+        endfor
+
+
+        if exists("t:tabname")
+            return t:tabname . ': ' . label
+        else
+            return label . '[' . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1]) .']'
+        endif
+    endf
+    set guitablabel=%{GuiTabLabel()}
+endif
+
+fun! <SID>Y(a)
+    if strlen(a:a) != 6 || a:a == "yellow"
+        return a:a
+    endif
+    if has("gui_running")
+        return "#".a:a
+    endif
+    let l:r = ("0x" . strpart(a:a, 0, 2)) + 0
+    let l:g = ("0x" . strpart(a:a, 2, 2)) + 0
+    let l:b = ("0x" . strpart(a:a, 4, 2)) + 0
+    if &t_Co == 88
+        let l:gray  = 10
+        let l:cube  = 4
+        let l:shift = 79
+    else
+        let l:gray  = 26
+        let l:cube  = 6
+        let l:shift = 232
+    endif
+
+    if l:r * l:gray / 256 == l:g * l:gray / 256 && l:r * l:gray / 256 == l:b * l:gray / 256
+        let l:s = l:r * l:gray / 256
+        if l:s == 0
+            return "black"
+        elseif l:s == l:gray - 1
+            return "white"
+        else
+            return l:shift + l:s
+        endif
+    endif
+    let l:x = ((l:r * l:cube) / 256)
+    let l:y = ((l:g * l:cube) / 256)
+    let l:z = ((l:b * l:cube) / 256)
+    return 16 + ((l:x * l:cube + l:y) * l:cube) + l:z
+endfun
+
+fun! <SID>myhi(cls, m, fg, bg)
+    if has("gui_running")
+        exec "hi ".a:cls." gui=".a:m." guifg=".<SID>Y(a:fg)." guibg=".<SID>Y(a:bg)
+    else
+        exec "hi ".a:cls." cterm=".a:m." ctermfg=".<SID>Y(a:fg)." ctermbg=".<SID>Y(a:bg)
+    endif
+endfun
+
+if has("gui_running") || &t_Co >= 88
+    if has("gui_running")
+        exec <SID>myhi("Normal",       "none",       "dfdfdf",    "00000f")
+        exec <SID>myhi("MoreMsg",      "none",       "dfdfdf",    "00000f")
+    else
+        exec <SID>myhi("Normal",       "none",       "dfdfdf",    "NONE")
+        exec <SID>myhi("MoreMsg",      "none",       "dfdfdf",    "NONE")
+    endif
+    exec <SID>myhi("Comment",      "none",       "afafff",    "0f0f2f")
+    exec <SID>myhi("Folded",       "none",       "afafff",    "0f0f2f")
+
+    exec <SID>myhi("SpecialKey",   "none",       "dfdfdf",    "0f0f2f")
+    exec <SID>myhi("Todo",         "underline",  "yellow",    "333333")
+    exec <SID>myhi("Error",        "bold",       "white",     "red")
+
+    exec <SID>myhi("Function",     "none",       "4fcfcf",    "NONE")
+    exec <SID>myhi("Identifier",   "none",       "4fcfcf",    "NONE")
+
+    exec <SID>myhi("Cursor",       "reverse",    "dfdfdf",    "black")
+    exec <SID>myhi("Visual",       "none",       "NONE",      "333333")
+    exec <SID>myhi("IncSearch",    "none",       "black",     "yellow")
+    exec <SID>myhi("Search",       "none",       "black",     "yellow")
+
+    exec <SID>myhi("StatusLine",   "none",       "yellow",    "333333")
+    exec <SID>myhi("StatusLineNc", "none",       "dfdfdf",    "1c1c1c")
+    exec <SID>myhi("WildMenu",     "none",       "white",     "0f0f2f")
+    exec <SID>myhi("VertSplit",    "none",       "darkgray",  "0f0f2f")
+    exec <SID>myhi("NonText",      "none",       "darkgray",  "NONE")
+
+    exec <SID>myhi("MatchParen",   "none",       "white",     "0f0f2f")
+    exec <SID>myhi("Pmenu",        "none",       "dfdfdf",    "0f0f2f")
+    exec <SID>myhi("PmenuSel",     "none",       "white",     "3f3f7f")
+    exec <SID>myhi("PmenuSbar",    "none",       "white",     "0f0f2f")
+    exec <SID>myhi("PmenuThumb",   "none",       "3f3f7f",    "3f3f7f")
+
+    exec <SID>myhi("SpellBad",     "none",       "NONE",      "800000")
+    exec <SID>myhi("SpellCap",     "none",       "NONE",      "004000")
+    exec <SID>myhi("SpellLocal",   "none",       "NONE",      "004000")
+    exec <SID>myhi("SpellRare",    "none",       "NONE",      "NONE")
+
+    exec <SID>myhi("Label",        "none",       "bf7f00",    "NONE")
+    exec <SID>myhi("Conditional",  "none",       "bf7f00",    "NONE")
+    exec <SID>myhi("Repeat",       "none",       "bf7f00",    "NONE")
+    exec <SID>myhi("Statement",    "none",       "bf7f00",    "NONE")
+
+    exec <SID>myhi("StorageClass", "none",       "3fbf3f",    "NONE")
+    exec <SID>myhi("Type",         "none",       "3fbf3f",    "NONE")
+    exec <SID>myhi("Structure",    "none",       "3fbf3f",    "NONE")
+    exec <SID>myhi("Directory",    "none",       "3fbf3f",    "NONE")
+
+    exec <SID>myhi("Include",      "none",       "bf0fbf",    "NONE")
+    exec <SID>myhi("PreProc",      "none",       "bf0fbf",    "NONE")
+    exec <SID>myhi("Macro",        "none",       "bf0fbf",    "NONE")
+    exec <SID>myhi("SpecialChar",  "none",       "bf0fbf",    "NONE")
+
+    exec <SID>myhi("Character",    "none",       "bf0f0f",    "NONE")
+    exec <SID>myhi("String",       "none",       "bf0f0f",    "NONE")
+    exec <SID>myhi("Constant",     "none",       "bf0f0f",    "NONE")
+
+    " diff
+    exec <SID>myhi("DiffAdd",      "none",       "NONE",      "002f0f")
+    exec <SID>myhi("DiffDelete",   "none",       "NONE",      "2f000f")
+    exec <SID>myhi("DiffChange",   "none",       "NONE",      "00003f")
+    exec <SID>myhi("DiffText",     "underline",  "NONE",      "00003f")
+    exec <SID>myhi("diffRemoved",  "none",       "bf0fbf",    "NONE")
+
+    " C
+    exec <SID>myhi("cFunction",    "none",       "b0b0b0",    "NONE")
+else
+    hi Comment      cterm=none       ctermfg=blue       ctermbg=none
+    hi Folded       cterm=none       ctermfg=brown      ctermbg=none
+
+    hi Visual       cterm=reverse    ctermfg=none       ctermbg=none
+    hi IncSearch    cterm=underline  ctermfg=white      ctermbg=none
+    hi Search       cterm=underline  ctermfg=white      ctermbg=none
+
+    hi StatusLine   cterm=none       ctermfg=white      ctermbg=blue
+    hi StatusLineNc cterm=none       ctermfg=black      ctermbg=white
+    hi WildMenu     cterm=none       ctermfg=white      ctermbg=none
+    hi VertSplit    cterm=none       ctermfg=darkgray   ctermbg=none
+    hi NonText      cterm=none       ctermfg=darkgray   ctermbg=none
+
+    hi MatchParen   cterm=underline  ctermfg=none       ctermbg=none
+    hi Pmenu        cterm=none       ctermfg=gray       ctermbg=black
+    hi PmenuSel     cterm=none       ctermfg=black      ctermbg=gray
+    hi PmenuSbar    cterm=none       ctermfg=blue       ctermbg=blue
+    hi PmenuThumb   cterm=none       ctermfg=gray       ctermbg=gray
+
+    hi SpellBad     cterm=underline  ctermfg=lightred   ctermbg=none
+    hi SpellCap     cterm=none       ctermfg=lightred   ctermbg=none
+    hi SpellLocal   cterm=underline  ctermfg=darkgreen  ctermbg=none
+    hi SpellRare    cterm=none       ctermfg=none       ctermbg=none
+endif
+
+" Custom
+hi def link htmlTag htmlStatement
+hi def link htmlEndTag htmlStatement
+
+" }}}
diff --git a/zshenv b/zshenv
new file mode 100644 (file)
index 0000000..6f44bec
--- /dev/null
+++ b/zshenv
@@ -0,0 +1,45 @@
+#!/bin/zsh
+
+local _chose_locale
+
+function _chose_locale() {
+    export LANG=C
+    export LC_ALL=C
+
+    local locs loc
+
+    locs=(${(M)${(f)"$(locale -a)"%*.utf8}})
+    case $locs in
+        *fr_FR*) loc=fr_FR.utf8;;
+        *fr*)    loc=${${(M)locs:#fr*.utf8}[1]};;
+        *en_US*) loc=en_US.utf8;;
+        *en*)    loc=${${(M)locs:#en*.utf8}[1]};;
+        *)       loc=C;;
+    esac
+
+    export LC_CTYPE=${loc:-C}
+    export LC_NUMERIC=${loc:-C}
+    export LC_TIME=${loc:-C}
+    export LC_MESSAGES=C
+    export LC_COLLATE=C
+    export LC_MONETARY=${loc:-C}
+    export LC_PAPER=${loc:-C}
+    export LC_NAME=${loc:-C}
+    export LC_ADDRESS=${loc:-C}
+    export LC_TELEPHONE=${loc:-C}
+    export LC_MEASUREMENT=${loc:-C}
+    export LC_IDENTIFICATION=${loc:-C}
+    export LC_ALL=
+}
+
+_chose_locale
+
+if test -z "$TERMINFO"; then
+    export TERMINFO=$HOME/.config/terminfo
+    export TERM=$TERM
+fi
+
+if test -d ~/dev/scm/git; then
+    export GIT_EXEC_PATH=~/dev/scm/git
+    export PATH=~/dev/scm/git:${PATH}
+fi
diff --git a/zshrc b/zshrc
new file mode 100644 (file)
index 0000000..2fbf152
--- /dev/null
+++ b/zshrc
@@ -0,0 +1,25 @@
+#! /bin/zsh
+
+autoload -U compinit zrecompile
+
+_madcoder_main () {
+    local zsh_cache zshrc_snipplet
+    setopt extended_glob
+
+    zsh_cache=${HOME}/.cache/zsh
+
+    if [ $UID -eq 0 ]; then
+        compinit
+    else
+        compinit -d $zsh_cache/zcomp-$HOST
+
+        for f in ~/.zshrc $zsh_cache/zcomp-$HOST; do
+            zrecompile -p $f && rm -f $f.zwc.old
+        done
+    fi
+
+    for zshrc_snipplet in ~/.config/zsh/[0-9][0-9][^.]#; do
+        source $zshrc_snipplet
+    done
+}
+_madcoder_main