├── bin ├── gn.py ├── git-goodness ├── ctags ├── hgk ├── while-success ├── line ├── pseudovpn.sh ├── colorerrors ├── word-frequency ├── stopwatch_times.py ├── download-iphone-receipts.sh ├── git-what-the-hell-just-happened ├── git-churn ├── compressibility ├── git-whodoneit ├── gn ├── bash_colors.sh ├── ptags.py ├── git-divergence ├── run-command-on-git-revisions ├── gvim └── nosy.py ├── .zprofile ├── .rvmrc ├── .tmux.conf ├── .zshenv ├── .emacs-lisp ├── mmm-rpm.el ├── pycomplete.el ├── mmm-univ.el ├── pycomplete.py ├── mmm-cweb.el ├── mmm-utils.el ├── mmm-mason.el ├── mmm-compat.el ├── mmm-auto.el └── redo.el ├── .vim ├── ftdetect │ ├── cucumber.vim │ └── haml.vim ├── colors │ ├── grb.vim │ ├── grb.vim~ │ ├── grblight.vim~ │ ├── grblight.vim │ ├── Black.vim │ ├── grb4.vim │ ├── grb3.vim │ ├── c.vim │ ├── darkzen.vim │ ├── redstring.vim │ ├── Dark.vim │ ├── grb256.vim │ ├── grb2.vim │ ├── pyte.vim │ ├── autumnleaf.vim │ ├── moria.vim │ └── ir_black.vim ├── indent │ ├── scss.vim │ ├── html_grb.vim │ ├── sass.vim │ ├── cucumber.vim │ ├── javascript.vim │ ├── haml.vim │ ├── python.vim │ └── html.vim ├── ftplugin │ ├── scss.vim │ ├── sass.vim │ ├── haml.vim │ └── cucumber.vim ├── filetype.vim ├── syntax │ ├── scss.vim │ ├── mkd.vim │ ├── sass.vim │ └── haml.vim ├── ruby │ ├── vim │ │ ├── screen.rb │ │ └── window.rb │ └── vim.rb ├── .VimballRecord ├── plugin │ └── scratch.vim └── autoload │ └── pathogen.vim ├── .screenrc ├── Library ├── AppleScripts │ └── ScheduleConference.scpt └── KeyBindings │ └── DefaultKeyBinding.dict ├── .autotest ├── .gemrc ├── .ackrc ├── .getmail └── getmail.gmail ├── .hgrc ├── .gitconfig ├── .gitmodules ├── .gitignore ├── .bashrc ├── .zshrc ├── .zsh └── func │ ├── zgitinit │ ├── prompt_wunjo_setup │ └── prompt_grb_setup └── .emacs /bin/gn.py: -------------------------------------------------------------------------------- 1 | gn -------------------------------------------------------------------------------- /.zprofile: -------------------------------------------------------------------------------- 1 | source ~/.zshrc 2 | -------------------------------------------------------------------------------- /.rvmrc: -------------------------------------------------------------------------------- 1 | export rvm_path="$HOME/.rvm" 2 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | set -g default-terminal "screen-256color" 2 | -------------------------------------------------------------------------------- /bin/git-goodness: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | git diff $* | gn 4 | 5 | -------------------------------------------------------------------------------- /.zshenv: -------------------------------------------------------------------------------- 1 | fpath=($fpath $HOME/.zsh/func) 2 | typeset -U fpath 3 | 4 | -------------------------------------------------------------------------------- /bin/ctags: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcoury/dotfiles-1/master/bin/ctags -------------------------------------------------------------------------------- /bin/hgk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcoury/dotfiles-1/master/bin/hgk -------------------------------------------------------------------------------- /.emacs-lisp/mmm-rpm.el: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcoury/dotfiles-1/master/.emacs-lisp/mmm-rpm.el -------------------------------------------------------------------------------- /.vim/ftdetect/cucumber.vim: -------------------------------------------------------------------------------- 1 | " Cucumber 2 | autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber 3 | -------------------------------------------------------------------------------- /.screenrc: -------------------------------------------------------------------------------- 1 | hardstatus on 2 | hardstatus alwayslastline "%{=b}%{G} Screen(s): %{b}%w" 3 | defscrollback 5000 4 | term screen-256color 5 | 6 | -------------------------------------------------------------------------------- /Library/AppleScripts/ScheduleConference.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fcoury/dotfiles-1/master/Library/AppleScripts/ScheduleConference.scpt -------------------------------------------------------------------------------- /.vim/ftdetect/haml.vim: -------------------------------------------------------------------------------- 1 | autocmd BufNewFile,BufRead *.haml setf haml 2 | autocmd BufNewFile,BufRead *.sass setf sass 3 | autocmd BufNewFile,BufRead *.scss setf scss 4 | -------------------------------------------------------------------------------- /bin/while-success: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Clear $? by doing something that always succeeds 3 | echo > /dev/null 4 | 5 | while [ "$?" -eq "0" ]; do 6 | $* 7 | done 8 | 9 | -------------------------------------------------------------------------------- /bin/line: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $1 = '' ]; then 4 | echo "Usage: $0 line_number" 5 | fi 6 | 7 | line_number=$1 8 | 9 | head -$line_number | tail -1 10 | 11 | -------------------------------------------------------------------------------- /.autotest: -------------------------------------------------------------------------------- 1 | Autotest.add_hook :initialize do |at| 2 | %w{.svn .hg .git vendor}.each {|exception| at.add_exception(exception)} 3 | end 4 | 5 | require 'autotest/redgreen' 6 | 7 | -------------------------------------------------------------------------------- /bin/pseudovpn.sh: -------------------------------------------------------------------------------- 1 | KEEPALIVE="while true; do echo 'foo'; sleep 5; done" 2 | 3 | while true; do 4 | ssh hq.bitbacker.com -L8080:localhost:80 $KEEPALIVE 5 | sleep 1 6 | done 7 | -------------------------------------------------------------------------------- /bin/colorerrors: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Color errors in make output (or make-like output) 4 | ccred=$(echo -e "\033[1;31m") 5 | ccend=$(echo -e "\033[0m") 6 | $@ 2>&1 | sed "s/error:/${ccred}error:${ccend}/" 7 | 8 | -------------------------------------------------------------------------------- /.vim/colors/grb.vim: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/Default.vim 3 | 4 | hi clear 5 | set background=dark 6 | 7 | syntax reset 8 | 9 | let g:colors_name = "grb" 10 | 11 | " hi Statement ctermfg=yellow 12 | hi Comment ctermfg=darkyellow 13 | 14 | -------------------------------------------------------------------------------- /.vim/colors/grb.vim~: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/Default.vim 3 | 4 | hi clear 5 | set background=dark 6 | 7 | syntax reset 8 | 9 | let g:colors_name = "grb" 10 | 11 | " hi Statement ctermfg=yellow 12 | hi Comment ctermfg=darkyellow 13 | 14 | -------------------------------------------------------------------------------- /.gemrc: -------------------------------------------------------------------------------- 1 | --- 2 | :verbose: true 3 | :update_sources: true 4 | :sources: 5 | - http://gemcutter.org 6 | - http://gems.rubyforge.org/ 7 | - http://gems.github.com 8 | gem: --no-rdoc --no-ri 9 | :bulk_threshold: 1000 10 | :backtrace: false 11 | :benchmark: false 12 | -------------------------------------------------------------------------------- /.vim/indent/scss.vim: -------------------------------------------------------------------------------- 1 | " Vim indent file 2 | " Language: SCSS 3 | " Maintainer: Tim Pope 4 | " Last Change: 2010 Jul 26 5 | 6 | if exists("b:did_indent") 7 | finish 8 | endif 9 | 10 | runtime! indent/css.vim 11 | 12 | " vim:set sw=2: 13 | -------------------------------------------------------------------------------- /.vim/ftplugin/scss.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin 2 | " Language: SCSS 3 | " Maintainer: Tim Pope 4 | " Last Change: 2010 Jul 26 5 | 6 | if exists("b:did_ftplugin") 7 | finish 8 | endif 9 | 10 | runtime! ftplugin/sass.vim 11 | 12 | " vim:set sw=2: 13 | -------------------------------------------------------------------------------- /bin/word-frequency: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ruby -F'[^a-zA-Z]+' -ane ' 4 | BEGIN { $words = Hash.new(0) } 5 | $F.each { |word| $words[word.downcase] += 1 } 6 | END { $words.each { |word, i| printf "%3d %s\n", i, word } } 7 | ' | 8 | sort -rn 9 | 10 | -------------------------------------------------------------------------------- /.ackrc: -------------------------------------------------------------------------------- 1 | # lexically sort filenames 2 | --sort-files 3 | 4 | --type-add=ruby=rake,haml 5 | --type-add=vim=vimrc 6 | --type-add=js=json 7 | --type-set=css=sass 8 | 9 | # add types ack doesn't know about 10 | --type-set=MARKDOWN=md,mkd,markdown 11 | --type-set=RDOC=rdoc 12 | 13 | -------------------------------------------------------------------------------- /.vim/colors/grblight.vim~: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/Default.vim 3 | 4 | hi clear 5 | set background=light 6 | 7 | syntax reset 8 | 9 | let g:colors_name = "grb" 10 | 11 | " hi Statement ctermfg=yellow 12 | hi Comment ctermfg=DarkYellow 13 | hi Statement ctermfg=Blue 14 | 15 | -------------------------------------------------------------------------------- /.vim/filetype.vim: -------------------------------------------------------------------------------- 1 | " markdown filetype file 2 | 3 | if exists("did\_load\_filetypes") 4 | 5 | finish 6 | 7 | endif 8 | 9 | augroup markdown 10 | 11 | au! BufRead,BufNewFile *.mkd setfiletype mkd 12 | au! BufRead,BufNewFile *.markdown setfiletype mkd 13 | 14 | augroup END 15 | 16 | -------------------------------------------------------------------------------- /.vim/colors/grblight.vim: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/Default.vim 3 | 4 | hi clear 5 | set background=light 6 | 7 | syntax reset 8 | 9 | let g:colors_name = "grb" 10 | 11 | " hi Statement ctermfg=yellow 12 | hi Comment ctermfg=DarkYellow 13 | hi Statement ctermfg=Blue 14 | hi Identifier ctermfg=Green 15 | 16 | -------------------------------------------------------------------------------- /bin/stopwatch_times.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import pickle 4 | 5 | 6 | stopwatch_dict = pickle.load(file('.nose-stopwatch-times')) 7 | tests = stopwatch_dict.items() 8 | sorted_tests = sorted(tests, key=lambda (name, time): -time) 9 | for name, time in sorted_tests: 10 | print "%.3fs: %s" % (time, name) 11 | 12 | -------------------------------------------------------------------------------- /bin/download-iphone-receipts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | if [[ $# -ne 4 ]]; then 4 | echo "usage: $0 ip directory start_file_number end_file_number" 5 | exit 1 6 | fi 7 | 8 | ip=$1 9 | directory=$2 10 | start=$3 11 | end=$4 12 | 13 | for i in {$start..$end}; do 14 | curl -o ${directory}/${i}.jpg "http://${ip}/${directory}/${i}.jpg" 15 | done 16 | 17 | -------------------------------------------------------------------------------- /.vim/indent/html_grb.vim: -------------------------------------------------------------------------------- 1 | " [-- helper function to assemble tag list --] 2 | fun! HtmlIndentPush(tag) 3 | if exists('g:html_indent_tags') 4 | let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag 5 | else 6 | let g:html_indent_tags = a:tag 7 | endif 8 | endfun 9 | call HtmlIndentPush('p') 10 | call HtmlIndentPush('li') 11 | -------------------------------------------------------------------------------- /bin/git-what-the-hell-just-happened: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | ref=${1:-"HEAD"} 5 | 6 | old=$ref@{1} 7 | new=$ref 8 | 9 | log() { 10 | git log --graph --pretty=short -1 $1 11 | } 12 | 13 | echo "Old revision:" 14 | log $old 15 | echo 16 | echo "New revision:" 17 | log $new 18 | echo 19 | echo "Changes:" 20 | git diff --stat --summary $new $old 21 | 22 | -------------------------------------------------------------------------------- /Library/KeyBindings/DefaultKeyBinding.dict: -------------------------------------------------------------------------------- 1 | /* ~/Library/KeyBindings/DefaultKeyBinding.dict */ 2 | { 3 | "~f" = "moveWordForward:"; 4 | "~b" = "moveWordBackward:"; 5 | "~<" = "moveToBeginningOfDocument:"; 6 | "~>" = "moveToEndOfDocument:"; 7 | "~v" = "pageUp:"; 8 | "~d" = "deleteWordForward:"; 9 | "^w" = "deleteWordBackward:"; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /.vim/colors/Black.vim: -------------------------------------------------------------------------------- 1 | " It's based on: 2 | runtime colors/Dark.vim 3 | 4 | let g:colors_name = "Black" 5 | 6 | hi Normal guibg=black guifg=GhostWhite 7 | hi NonText guibg=grey10 8 | 9 | " More faded is too similar to blue on LCDs. 10 | "hi Identifier guifg=#90CC90 11 | hi Identifier guifg=#60CC60 12 | 13 | " Experimental: 14 | " Stick with the default for a while... 15 | "hi Cursor guibg=red2 guifg=white 16 | 17 | -------------------------------------------------------------------------------- /.getmail/getmail.gmail: -------------------------------------------------------------------------------- 1 | [retriever] 2 | type = SimplePOP3SSLRetriever 3 | server = pop.gmail.com 4 | username = gary.bernhardt@gmail.com 5 | 6 | [destination] 7 | type = Maildir 8 | path = ~/getmail-gmail-archive/ 9 | 10 | [options] 11 | # print messages about each action (verbose = 2) 12 | # Other options: 13 | # 0 prints only warnings and errors 14 | # 1 prints messages about retrieving and deleting messages only 15 | verbose = 2 16 | message_log = ~/.getmail/gmail.log 17 | 18 | -------------------------------------------------------------------------------- /.vim/syntax/scss.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: SCSS 3 | " Maintainer: Tim Pope 4 | " Filenames: *.scss 5 | " Last Change: 2010 Jul 26 6 | 7 | if exists("b:current_syntax") 8 | finish 9 | endif 10 | 11 | runtime! syntax/sass.vim 12 | 13 | syn match scssComment "//.*" contains=sassTodo,@Spell 14 | syn region scssComment start="/\*" end="\*/" contains=sassTodo,@Spell 15 | 16 | hi def link scssComment sassComment 17 | 18 | let b:current_syntax = "scss" 19 | 20 | " vim:set sw=2: 21 | -------------------------------------------------------------------------------- /.vim/colors/grb4.vim: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/ir_black.vim 3 | 4 | let g:colors_name = "grb4" 5 | 6 | hi pythonSpaceError ctermbg=red guibg=red 7 | 8 | hi Comment ctermfg=darkyellow 9 | 10 | hi StatusLine ctermbg=lightgrey ctermfg=black 11 | hi StatusLineNC ctermbg=lightgrey ctermfg=black 12 | hi VertSplit ctermbg=lightgrey ctermfg=black 13 | hi LineNr ctermfg=lightgrey 14 | 15 | " ir_black doesn't highlight operators for some reason 16 | hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE 17 | 18 | -------------------------------------------------------------------------------- /.vim/ftplugin/sass.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin 2 | " Language: Sass 3 | " Maintainer: Tim Pope 4 | " Last Change: 2010 Jul 26 5 | 6 | " Only do this when not done yet for this buffer 7 | if exists("b:did_ftplugin") 8 | finish 9 | endif 10 | let b:did_ftplugin = 1 11 | 12 | let b:undo_ftplugin = "setl cms< def< inc< inex< ofu< sua<" 13 | 14 | setlocal commentstring=//\ %s 15 | setlocal define=^\\s*\\%(@mixin\\\|=\\) 16 | setlocal includeexpr=substitute(v:fname,'\\%(.*/\\\|^\\)\\zs','_','') 17 | setlocal omnifunc=csscomplete#CompleteCSS 18 | setlocal suffixesadd=.sass,.scss,.css 19 | 20 | let &l:include = '^\s*@import\s\+\%(url(\)\=["'']\=' 21 | 22 | " vim:set sw=2: 23 | -------------------------------------------------------------------------------- /.vim/colors/grb3.vim: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/ir_black.vim 3 | 4 | let g:colors_name = "grb" 5 | 6 | hi pythonSpaceError ctermbg=red guibg=red 7 | 8 | " hi Comment ctermfg=darkyellow 9 | 10 | hi Normal guibg=#101010 11 | hi NonText guibg=#101010 12 | hi LineNr guibg=#101010 13 | 14 | hi CursorLine guibg=#181818 15 | hi CursorColumn guibg=#181818 16 | 17 | hi VertSplit guifg=#303030 guibg=#303030 18 | hi StatusLine guifg=#000000 guibg=#a0a0a0 19 | hi StatusLineNC guifg=#888888 guibg=#303030 20 | 21 | " ir_black doesn't highlight operators for some reason 22 | hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE 23 | 24 | -------------------------------------------------------------------------------- /bin/git-churn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Written by Corey Haines 4 | # Scriptified by Gary Bernhardt 5 | # 6 | # Put this anywhere on your $PATH (~/bin is recommended). Then git will see it 7 | # and you'll be able to do `git churn`. 8 | # 9 | # Show churn for whole repo: 10 | # $ git churn 11 | # 12 | # Show churn for specific directories: 13 | # $ git churn app lib 14 | # 15 | # Show churn for a time range: 16 | # $ git churn --since='1 month ago' 17 | # 18 | # (These are all standard arguments to `git log`.) 19 | 20 | set -e 21 | git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' | sort -g 22 | 23 | 24 | -------------------------------------------------------------------------------- /.hgrc: -------------------------------------------------------------------------------- 1 | [ui] 2 | username = Gary Bernhardt 3 | 4 | [defaults] 5 | #log = --graph --style compact 6 | diff = -p 7 | qnew = -D --git 8 | qrefresh = -D --git 9 | qseries = -s 10 | qimport = --git 11 | 12 | [diff] 13 | git=1 14 | 15 | [extdiff] 16 | cmd.vimdiff = mvim 17 | opts.vimdiff = -f '+next' '+execute "DirDiff" argv(0) argv(1)' 18 | 19 | [pager] 20 | pager=LESS='FSRX' less 21 | ignore=version, help, update, push, pull, merge, fetch, convert, clone, record, crecord, grep, status, add, addremove, revert, commit, init 22 | 23 | [git] 24 | intree=1 25 | 26 | [extensions] 27 | churn= 28 | hgk= 29 | mq= 30 | record= 31 | graphlog= 32 | color= 33 | rebase= 34 | transplant= 35 | bookmarks= 36 | record= 37 | extdiff= 38 | pager= 39 | hggit= 40 | 41 | -------------------------------------------------------------------------------- /bin/compressibility: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # By Gary Bernhardt. 4 | # Dotfiles at: https://github.com/garybernhardt/dotfiles 5 | 6 | import sys 7 | import zlib 8 | import bz2 9 | 10 | 11 | def main(): 12 | data = file_data() 13 | size = len(data) 14 | print 'file size', size 15 | gzip_size = len(zlib.compress(data)) 16 | print 'gzip size %i (%i%%)' % (gzip_size, percent(gzip_size, size)) 17 | bz2_size = len(bz2.compress(data)) 18 | print 'bz2 size %i (%i%%)' % (bz2_size, percent(bz2_size, size)) 19 | 20 | 21 | def file_data(): 22 | files = map(open, sys.argv[1:]) 23 | if not files: 24 | files = [sys.stdin] 25 | return ''.join(f.read() for f in files) 26 | 27 | 28 | def percent(part, whole): 29 | return int(100.0 * part / whole) 30 | 31 | 32 | if __name__ == '__main__': 33 | main() 34 | 35 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Gary Bernhardt 3 | email = gary.bernhardt@gmail.com 4 | [diff] 5 | [color] 6 | ui = auto 7 | [alias] 8 | st = status 9 | ci = commit 10 | co = checkout 11 | di = diff 12 | dc = diff --cached 13 | amend = commit --amend 14 | aa = add --all 15 | head = !git l -1 16 | h = !git head 17 | r = !git l -20 18 | ra = !git r --all 19 | ff = merge --ff-only 20 | pullff = pull --ff-only 21 | noff = merge --no-ff 22 | l = log --graph --abbrev-commit --date=relative 23 | la = !git l --all 24 | div = divergence 25 | gn = goodness 26 | gnc = goodness --cached 27 | fa = fetch --all 28 | pom = push origin master 29 | b = branch 30 | ds = diff --stat=160,120 31 | dh1 = diff HEAD~1 32 | 33 | [format] 34 | pretty=format:%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset 35 | 36 | [merge] 37 | tool = vimdiff 38 | 39 | -------------------------------------------------------------------------------- /.vim/colors/c.vim: -------------------------------------------------------------------------------- 1 | " Vim Syntax Highlighting File 2 | " 3 | " Language: C 4 | " 5 | " Extra: This is to copy the vi clone elvis on its 6 | " syntax highlighting. 7 | " 8 | " Maintainer: Dean Jones 9 | " 10 | " Comment: This works well with the default c.vim 11 | " that comes with vim6.x. It basically 12 | " overrides the very bright colors it uses 13 | " and uses simple white for highlighting 14 | " key words and types in the C language. 15 | " If you're using Eterm, uncomment the 16 | " Normal line specified below. 17 | 18 | hi clear 19 | 20 | " Eterm users, uncomment the line below 21 | " hi Normal ctermfg=grey 22 | 23 | hi PreProc ctermfg=white 24 | hi Type ctermfg=white 25 | hi Statement ctermfg=white 26 | hi Comment ctermfg=grey 27 | hi Constant cterm=NONE ctermfg=NONE 28 | hi Number cterm=NONE ctermfg=NONE 29 | hi String cterm=NONE ctermfg=NONE 30 | hi Special cterm=NONE ctermfg=NONE 31 | 32 | " EOF for Dean's Elvis like highlighting 33 | -------------------------------------------------------------------------------- /bin/git-whodoneit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | class WhoDoneIt 4 | PATTERN = ARGV.fetch(0) 5 | 6 | def print 7 | lines.each do |line| 8 | puts line 9 | end 10 | end 11 | 12 | def lines 13 | blame_and_code.map do |blame, code| 14 | blame += " " * (longest_blame_line - blame.length) 15 | "#{blame} #{code}" 16 | end 17 | end 18 | 19 | def blame_and_code 20 | @blame_and_code ||= blame_lines.map do |line| 21 | blame, code = line.split(')', 2) 22 | blame += ")" 23 | [blame, code] 24 | end 25 | end 26 | 27 | def longest_blame_line 28 | @longest_blame_line ||= blame_and_code.map do |blame, code| 29 | blame.length 30 | end.max 31 | end 32 | 33 | def blame_lines 34 | @blame_lines ||= matching_files.map do |filename| 35 | `git blame -f -- #{filename} | grep #{PATTERN}` 36 | end.map do |line| 37 | line.split("\n") 38 | end.flatten 39 | end 40 | 41 | def matching_files 42 | @matching_files ||= `git grep -I --name-only #{PATTERN}`.split("\n") 43 | end 44 | end 45 | 46 | WhoDoneIt.new.print 47 | 48 | -------------------------------------------------------------------------------- /bin/gn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # 4 | # Print a diff summary like: 5 | # 6 | # $ git diff 'master~10..master' | gn 7 | # 293 lines of diff 8 | # 185 lines added 9 | # 19 lines removed 10 | # +166 lines net change 11 | 12 | import sys, os, re, fileinput 13 | 14 | def get_lines(diff_lines): 15 | # Added lines start with '+' (but not '+++', because that marks a new 16 | # file). The same goes for removed lines, except '-' instead of '+'. 17 | added_lines = [line for line in diff_lines 18 | if line.startswith('+') and not line.startswith('+++')] 19 | removed_lines = [line for line in diff_lines 20 | if line.startswith('-') and not line.startswith('---')] 21 | return added_lines, removed_lines 22 | 23 | 24 | if __name__ == '__main__': 25 | diff_lines = list(fileinput.input()) 26 | added_lines, removed_lines = get_lines(diff_lines) 27 | print '%i lines of diff' % len(diff_lines) 28 | print '%i lines added' % len(added_lines) 29 | print '%i lines removed' % len(removed_lines) 30 | print '%+i lines net change' % (len(added_lines) - len(removed_lines)) 31 | 32 | -------------------------------------------------------------------------------- /.vim/indent/sass.vim: -------------------------------------------------------------------------------- 1 | " Vim indent file 2 | " Language: Sass 3 | " Maintainer: Tim Pope 4 | " Last Change: 2010 May 21 5 | 6 | if exists("b:did_indent") 7 | finish 8 | endif 9 | let b:did_indent = 1 10 | 11 | setlocal autoindent sw=2 et 12 | setlocal indentexpr=GetSassIndent() 13 | setlocal indentkeys=o,O,*,<:>,!^F 14 | 15 | " Only define the function once. 16 | if exists("*GetSassIndent") 17 | finish 18 | endif 19 | 20 | let s:property = '^\s*:\|^\s*[[:alnum:]-]\+\%(:\|\s*=\)' 21 | 22 | function! GetSassIndent() 23 | let lnum = prevnonblank(v:lnum-1) 24 | let line = substitute(getline(lnum),'\s\+$','','') 25 | let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') 26 | let lastcol = strlen(line) 27 | let line = substitute(line,'^\s\+','','') 28 | let indent = indent(lnum) 29 | let cindent = indent(v:lnum) 30 | if line !~ s:property && cline =~ s:property 31 | return indent + &sw 32 | "elseif line =~ s:property && cline !~ s:property 33 | "return indent - &sw 34 | else 35 | return -1 36 | endif 37 | endfunction 38 | 39 | " vim:set sw=2: 40 | -------------------------------------------------------------------------------- /.emacs-lisp/pycomplete.el: -------------------------------------------------------------------------------- 1 | ;;; Complete symbols at point using Pymacs. 2 | 3 | ;;; See pycomplete.py for the Python side of things and a short description 4 | ;;; of what to expect. 5 | 6 | (require 'pymacs) 7 | (require 'python-mode) 8 | 9 | (pymacs-load "pycomplete") 10 | 11 | (defun py-complete () 12 | (interactive) 13 | (let ((pymacs-forget-mutability t)) 14 | (insert (pycomplete-pycomplete (py-symbol-near-point) 15 | (py-find-global-imports))))) 16 | 17 | (defun py-find-global-imports () 18 | (save-excursion 19 | (let (first-class-or-def imports) 20 | (goto-char (point-min)) 21 | (setq first-class-or-def 22 | (re-search-forward "^ *\\(def\\|class\\) " nil t)) 23 | (goto-char (point-min)) 24 | (setq imports nil) 25 | (while (re-search-forward 26 | "^\\(import \\|from \\([A-Za-z_][A-Za-z_0-9]*\\) import \\).*" 27 | nil t) 28 | (setq imports (append imports 29 | (list (buffer-substring 30 | (match-beginning 0) 31 | (match-end 0)))))) 32 | imports))) 33 | 34 | (define-key py-mode-map "\M-\C-i" 'py-complete) 35 | 36 | (provide 'pycomplete) 37 | -------------------------------------------------------------------------------- /bin/bash_colors.sh: -------------------------------------------------------------------------------- 1 | DULL=0 2 | BRIGHT=1 3 | 4 | FG_BLACK=30 5 | FG_RED=31 6 | FG_GREEN=32 7 | FG_YELLOW=33 8 | FG_BLUE=34 9 | FG_VIOLET=35 10 | FG_CYAN=36 11 | FG_WHITE=37 12 | 13 | FG_NULL=00 14 | 15 | BG_BLACK=40 16 | BG_RED=41 17 | BG_GREEN=42 18 | BG_YELLOW=43 19 | BG_BLUE=44 20 | BG_VIOLET=45 21 | BG_CYAN=46 22 | BG_WHITE=47 23 | 24 | BG_NULL=00 25 | 26 | ## 27 | # ANSI Escape Commands 28 | ## 29 | ESC="\033" 30 | NORMAL="$ESC[m" 31 | RESET="$ESC[${DULL};${FG_WHITE};${BG_NULL}m" 32 | 33 | BLACK="$ESC[${DULL};${FG_BLACK}m" 34 | RED="$ESC[${DULL};${FG_RED}m" 35 | GREEN="$ESC[${DULL};${FG_GREEN}m" 36 | YELLOW="$ESC[${DULL};${FG_YELLOW}m" 37 | BLUE="$ESC[${DULL};${FG_BLUE}m" 38 | VIOLET="$ESC[${DULL};${FG_VIOLET}m" 39 | CYAN="$ESC[${DULL};${FG_CYAN}m" 40 | WHITE="$ESC[${DULL};${FG_WHITE}m" 41 | 42 | # BRIGHT TEXT 43 | BRIGHT_BLACK="$ESC[${BRIGHT};${FG_BLACK}m" 44 | BRIGHT_RED="$ESC[${BRIGHT};${FG_RED}m" 45 | BRIGHT_GREEN="$ESC[${BRIGHT};${FG_GREEN}m" 46 | BRIGHT_YELLOW="$ESC[${BRIGHT};${FG_YELLOW}m" 47 | BRIGHT_BLUE="$ESC[${BRIGHT};${FG_BLUE}m" 48 | BRIGHT_VIOLET="$ESC[${BRIGHT};${FG_VIOLET}m" 49 | BRIGHT_CYAN="$ESC[${BRIGHT};${FG_CYAN}m" 50 | BRIGHT_WHITE="$ESC[${BRIGHT};${FG_WHITE}m" 51 | 52 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".vim/bundle/Command-T"] 2 | path = .vim/bundle/Command-T 3 | url = https://github.com/vim-scripts/Command-T.git 4 | ignore = untracked 5 | [submodule ".vim/bundle/vim-makegreen"] 6 | path = .vim/bundle/vim-makegreen 7 | url = git@github.com:garybernhardt/vim-makegreen.git 8 | [submodule ".vim/bundle/vim-fugitive"] 9 | path = .vim/bundle/vim-fugitive 10 | url = git://github.com/tpope/vim-fugitive.git 11 | [submodule ".vim/bundle/vim-rails"] 12 | path = .vim/bundle/vim-rails 13 | url = https://github.com/tpope/vim-rails.git 14 | [submodule ".vim/bundle/L9"] 15 | path = .vim/bundle/L9 16 | url = https://github.com/vim-scripts/L9 17 | [submodule ".vim/bundle/vim-fuzzyfinder"] 18 | path = .vim/bundle/vim-fuzzyfinder 19 | url = https://github.com/clones/vim-fuzzyfinder 20 | [submodule ".vim/bundle/vim-colors-solarized"] 21 | path = .vim/bundle/vim-colors-solarized 22 | url = https://github.com/altercation/vim-colors-solarized 23 | [submodule ".vim/bundle/vim-ruby"] 24 | path = .vim/bundle/vim-ruby 25 | url = https://github.com/vim-ruby/vim-ruby.git 26 | [submodule ".vim/bundle/vim-commentary"] 27 | path = .vim/bundle/vim-commentary 28 | url = https://github.com/tpope/vim-commentary.git 29 | -------------------------------------------------------------------------------- /.vim/colors/darkzen.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Ruda Moura 3 | " Last Change: $Date: 2005/11/12 15:40:06 $ 4 | 5 | set background=dark 6 | highlight clear 7 | if exists("syntax on") 8 | syntax reset 9 | endif 10 | 11 | let g:colors_name = "darkzen" 12 | 13 | highlight Normal term=none ctermfg=gray cterm=none guifg=gray gui=none guibg=black 14 | highlight Comment term=none ctermfg=cyan cterm=none guifg=cyan gui=none 15 | highlight Constant term=none ctermfg=red cterm=none guifg=red gui=none 16 | highlight Special term=none ctermfg=red cterm=bold guifg=red gui=bold 17 | highlight Identifier term=none ctermfg=gray cterm=none guifg=gray gui=none 18 | highlight Statement term=bold ctermfg=gray cterm=bold guifg=gray gui=bold 19 | highlight Operator term=bold ctermfg=gray cterm=bold guifg=gray gui=bold 20 | highlight PreProc term=bold ctermfg=lightgreen cterm=none guifg=green gui=none 21 | highlight Type term=bold ctermfg=magenta cterm=none guifg=magenta gui=none 22 | highlight String term=none ctermfg=red cterm=none guifg=red gui=none 23 | highlight Number term=none ctermfg=red cterm=none guifg=red gui=none 24 | 25 | " vim:ts=2:sw=2:et 26 | -------------------------------------------------------------------------------- /.vim/indent/cucumber.vim: -------------------------------------------------------------------------------- 1 | " Vim indent file 2 | " Language: Cucumber 3 | " Maintainer: Tim Pope 4 | 5 | if exists("b:did_indent") 6 | finish 7 | endif 8 | let b:did_indent = 1 9 | 10 | setlocal autoindent 11 | setlocal indentexpr=GetCucumberIndent() 12 | setlocal indentkeys=o,O,*,<:>,0,0#,=,!^F 13 | 14 | " Only define the function once. 15 | if exists("*GetCucumberIndent") 16 | finish 17 | endif 18 | 19 | function! GetCucumberIndent() 20 | let line = getline(prevnonblank(v:lnum-1)) 21 | let cline = getline(v:lnum) 22 | if cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):' 23 | return &sw 24 | elseif cline =~# '^\s*\%(Examples\|Scenarios\):' 25 | return 2 * &sw 26 | elseif line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):' 27 | return 2 * &sw 28 | elseif line =~# '^\s*\%(Examples\|Scenarios\):' 29 | return 3 * &sw 30 | elseif cline =~# '^\s*|' && line =~# '^\s*|' 31 | return indent(prevnonblank(v:lnum-1)) 32 | elseif cline =~# '^\s*|' && line =~# '^\s*[^|#]' 33 | return indent(prevnonblank(v:lnum-1)) + &sw 34 | elseif cline =~# '^\s*[^|#]' && line =~# '^\s*|' 35 | return indent(prevnonblank(v:lnum-1)) - &sw 36 | endif 37 | return -1 38 | endfunction 39 | 40 | " vim:set sts=2 sw=2: 41 | -------------------------------------------------------------------------------- /.vim/colors/redstring.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Connor Berry 3 | " Last Change: 2006/05/25 4 | " Version: 1.0 5 | 6 | set background=dark 7 | highlight clear 8 | if exists("syntax on") 9 | syntax reset 10 | endif 11 | 12 | let g:colors_name = "redstring" 13 | 14 | highlight Normal term=none ctermfg=grey cterm=none ctermbg=black guifg=white gui=none guibg=black 15 | highlight Comment term=none ctermfg=DarkGrey guifg=DarkGrey 16 | highlight Constant term=none ctermfg=red cterm=none guifg=red gui=none 17 | highlight Special term=none ctermfg=red cterm=bold guifg=red gui=bold 18 | highlight Identifier term=none ctermfg=lightgreen cterm=none guifg=lightgreen gui=none 19 | highlight Statement term=bold ctermfg=cyan cterm=bold guifg=cyan gui=bold 20 | highlight Operator term=bold ctermfg=cyan cterm=bold guifg=cyan gui=bold 21 | highlight PreProc term=bold ctermfg=lightgreen cterm=none guifg=green gui=none 22 | highlight Type term=bold ctermfg=lightgreen cterm=none guifg=lightgreen gui=none 23 | highlight String term=none ctermfg=red cterm=none guifg=red gui=none 24 | highlight Number term=none ctermfg=red cterm=none guifg=red gui=none 25 | 26 | " vim:ts=2:sw=2:et 27 | -------------------------------------------------------------------------------- /bin/ptags.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # ptags 4 | # 5 | # Create a tags file for Python programs, usable with vi. 6 | # Tagged are: 7 | # - functions (even inside other defs or classes) 8 | # - classes 9 | # - filenames 10 | # Warns about files it cannot open. 11 | # No warnings about duplicate tags. 12 | 13 | import sys, re, os 14 | 15 | tags = [] # Modified global variable! 16 | 17 | def main(): 18 | args = sys.argv[1:] 19 | for filename in args: 20 | treat_file(filename) 21 | if tags: 22 | fp = open('tags', 'w') 23 | tags.sort() 24 | for s in tags: fp.write(s) 25 | 26 | 27 | expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:\(]' 28 | matcher = re.compile(expr) 29 | 30 | def treat_file(filename): 31 | try: 32 | fp = open(filename, 'r') 33 | except: 34 | sys.stderr.write('Cannot open %s\n' % filename) 35 | return 36 | base = os.path.basename(filename) 37 | if base[-3:] == '.py': 38 | base = base[:-3] 39 | s = base + '\t' + filename + '\t' + '1\n' 40 | tags.append(s) 41 | while 1: 42 | line = fp.readline() 43 | if not line: 44 | break 45 | m = matcher.match(line) 46 | if m: 47 | content = m.group(0) 48 | name = m.group(2) 49 | s = name + '\t' + filename + '\t/^' + content + '/\n' 50 | tags.append(s) 51 | 52 | if __name__ == '__main__': 53 | main() 54 | -------------------------------------------------------------------------------- /bin/git-divergence: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | ( 6 | function branch() { 7 | git branch 2>/dev/null | grep -e '^*' | tr -d '\* ' 8 | } 9 | 10 | function ensure_valid_ref() { 11 | ref=$1 12 | ( 13 | set +e 14 | git show-ref $ref > /dev/null 15 | if [[ $? == 1 ]]; then 16 | echo "$0: bad ref: $ref" 17 | exit 1 18 | fi 19 | ) 20 | } 21 | 22 | function show_rev() { 23 | rev=$1 24 | git log -1 $rev --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative 25 | echo 26 | git di $rev^..$rev | diffstat 27 | echo 28 | } 29 | 30 | if [[ $# == 2 ]]; then 31 | LOCAL=$1 32 | REMOTE=$2 33 | elif [[ $# == 1 ]]; then 34 | LOCAL=`branch` 35 | REMOTE=$1 36 | else 37 | LOCAL=`branch` 38 | REMOTE=origin/$LOCAL 39 | fi 40 | 41 | ensure_valid_ref $LOCAL 42 | ensure_valid_ref $REMOTE 43 | 44 | echo "changes from local ${LOCAL} to remote ${REMOTE}:" 45 | echo 46 | 47 | echo incoming: 48 | echo 49 | for rev in `git rev-list $LOCAL..$REMOTE`; do 50 | show_rev $rev 51 | done 52 | 53 | echo 54 | echo outgoing: 55 | echo 56 | for rev in `git rev-list $REMOTE..$LOCAL`; do 57 | show_rev $rev 58 | done 59 | ) | less -r 60 | 61 | -------------------------------------------------------------------------------- /bin/run-command-on-git-revisions: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # This script runs a given command over a range of Git revisions. Note that it 4 | # will check past revisions out! Exercise caution if there are important 5 | # untracked files in your working tree. 6 | # 7 | # This came from Gary Bernhardt's dotfiles: 8 | # https://github.com/garybernhardt/dotfiles 9 | # 10 | # Example usage: 11 | # $ run-command-on-git-revisions origin/master master 'python runtests.py' 12 | 13 | set -e 14 | 15 | if [[ $1 == -v ]]; then 16 | verbose=1 17 | shift 18 | fi 19 | start_ref=$1 20 | end_ref=$2 21 | test_command=$3 22 | 23 | main() { 24 | enforce_usage 25 | run_tests 26 | } 27 | 28 | enforce_usage() { 29 | if [ -z "$test_command" ]; then 30 | usage 31 | exit $E_BADARGS 32 | fi 33 | } 34 | 35 | usage() { 36 | echo "usage: `basename $0` start_ref end_ref test_command" 37 | } 38 | 39 | run_tests() { 40 | revs=`log_command git rev-list --reverse ${start_ref}..${end_ref}` 41 | 42 | for rev in $revs; do 43 | debug "Checking out: $(git log --oneline -1 $rev)" 44 | log_command git checkout --quiet $rev 45 | log_command $test_command 46 | log_command git reset --hard 47 | done 48 | log_command git checkout --quiet $end_ref 49 | debug "OK for all revisions!" 50 | } 51 | 52 | log_command() { 53 | debug "=> $*" 54 | eval $* 55 | } 56 | 57 | debug() { 58 | if [ $verbose ]; then 59 | echo $* >&2 60 | fi 61 | } 62 | 63 | main 64 | 65 | -------------------------------------------------------------------------------- /.vim/ruby/vim/screen.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Wincent Colaiuta. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # 1. Redistributions of source code must retain the above copyright notice, 7 | # this list of conditions and the following disclaimer. 8 | # 2. Redistributions in binary form must reproduce the above copyright notice, 9 | # this list of conditions and the following disclaimer in the documentation 10 | # and/or other materials provided with the distribution. 11 | # 12 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 13 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 16 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 18 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 19 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 21 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 22 | # POSSIBILITY OF SUCH DAMAGE. 23 | 24 | module VIM 25 | module Screen 26 | def self.lines 27 | VIM.evaluate('&lines').to_i 28 | end 29 | 30 | def self.columns 31 | VIM.evaluate('&columns').to_i 32 | end 33 | end # module Screen 34 | end # module VIM 35 | -------------------------------------------------------------------------------- /.vim/colors/Dark.vim: -------------------------------------------------------------------------------- 1 | " 2 | " Restore default colors 3 | hi clear 4 | set background=dark 5 | 6 | 7 | if exists("syntax_on") 8 | syntax reset 9 | endif 10 | 11 | let g:colors_name = "Dark" 12 | 13 | 14 | hi Normal guibg=grey20 guifg=GhostWhite 15 | hi NonText guibg=grey15 guifg=yellow3 16 | "hi Cursor guibg=GhostWhite 17 | "hi Cursor guibg=red guifg=white 18 | hi Cursor guibg=green2 guifg=black 19 | 20 | hi Statement guifg=tan 21 | hi Constant guifg=#FF7070 22 | hi String guifg=#ffa0a0 23 | hi Comment guifg=SkyBlue 24 | hi PreProc guifg=orchid2 25 | hi Character guifg=Cyan 26 | hi Type guifg=orange gui=none 27 | hi Special guifg=#DDDD00 28 | hi Identifier guifg=#60DD60 29 | hi link Function Identifier 30 | "hi Function guifg=#ffa0a0 31 | 32 | " Slight tweaks after some time away: 33 | hi Type guifg=LightMagenta 34 | hi PreProc guifg=orange2 35 | 36 | 37 | hi link SpecialKey Comment 38 | hi link Directory Comment 39 | 40 | " 41 | " Colors not part of the original set: 42 | " 43 | "hi Folded guifg=cyan4 guibg=grey20 44 | hi Folded guifg=grey90 guibg=grey45 45 | hi Visual gui=reverse guibg=fg guifg=darkolivegreen 46 | hi Search guifg=black guibg=LightSkyBlue3 gui=none 47 | "hi IncSearch guifg=yellow guibg=LightSkyBlue3 gui=bold 48 | hi IncSearch guibg=blue guifg=yellow gui=bold 49 | hi WarningMsg guifg=red guibg=GhostWhite gui=bold 50 | hi Error guibg=red3 51 | 52 | 53 | " Here are the original colors: 54 | "hi guifg=grey70 gui=bold 55 | "hi guifg=#FF7070 gui=bold 56 | "hi guifg=green gui=bold 57 | "hi guifg=yellow gui=bold 58 | "hi guifg=SkyBlue gui=bold 59 | "hi guifg=orchid1 gui=bold 60 | "hi guifg=Cyan gui=bold 61 | "hi guifg=White gui=bold 62 | " 63 | 64 | -------------------------------------------------------------------------------- /.vim/colors/grb256.vim: -------------------------------------------------------------------------------- 1 | " Based on 2 | runtime colors/ir_black.vim 3 | 4 | let g:colors_name = "grb256" 5 | 6 | hi pythonSpaceError ctermbg=red guibg=red 7 | 8 | hi Comment ctermfg=darkgray 9 | 10 | hi StatusLine ctermbg=darkgrey ctermfg=white 11 | hi StatusLineNC ctermbg=black ctermfg=lightgrey 12 | hi VertSplit ctermbg=black ctermfg=lightgrey 13 | hi LineNr ctermfg=darkgray 14 | hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=234 15 | hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE 16 | hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=236 cterm=NONE 17 | 18 | hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=16 ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color 19 | hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE 20 | hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=red cterm=NONE 21 | hi SpellBad guifg=white guibg=#FF6C60 gui=BOLD ctermfg=16 ctermbg=160 cterm=NONE 22 | 23 | " ir_black doesn't highlight operators for some reason 24 | hi Operator guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE 25 | 26 | highlight DiffAdd term=reverse cterm=bold ctermbg=lightgreen ctermfg=16 27 | highlight DiffChange term=reverse cterm=bold ctermbg=lightblue ctermfg=16 28 | highlight DiffText term=reverse cterm=bold ctermbg=lightgray ctermfg=16 29 | highlight DiffDelete term=reverse cterm=bold ctermbg=lightred ctermfg=16 30 | 31 | highlight PmenuSel ctermfg=16 ctermbg=156 32 | 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | /.CFUserTextEncoding 3 | /.Trash 4 | /.account 5 | /.bash_history 6 | /.bazaar 7 | /.bi_li3 8 | /.bugs_everywhere 9 | /.bundle 10 | /.bzr.log 11 | /.cache 12 | /.certs 13 | /.cups 14 | /.dropbox 15 | /.dvdcss 16 | /.ec2 17 | /.emacs-places 18 | /.emacs.bak 19 | /.emacs.d 20 | /.erlang.cookie 21 | /.eshell 22 | /.fontconfig 23 | /.fonts 24 | /.freemind 25 | /.gdb_history 26 | /.gem 27 | /.getmail/gmail.log 28 | /.getmail/oldmail-pop.gmail.com-995-gary.bernhardt@gmail.com 29 | /.gnupg 30 | /.god 31 | /.heroku 32 | /.hg.cvsps 33 | /.hgk 34 | /.history 35 | /.history.436tlA 36 | /.hoe_template 37 | /.hudson 38 | /.ipython 39 | /.irb-history 40 | /.irb_history 41 | /.lesshst 42 | /.localized 43 | /.macports 44 | /.mysql_history 45 | /.pip 46 | /.psql_history 47 | /.pypirc 48 | /.python-eggs 49 | /.rnd 50 | /.rvm 51 | /.sh_history 52 | /.sqlite_history 53 | /.ssh 54 | /.ssl 55 | /.subversion 56 | /.tox 57 | /.vim-tmp 58 | /.vim/.netrwhist 59 | /.vim-fuf-data 60 | /.vimfuzzyfinder 61 | /.viminfo 62 | /.vimprojects 63 | /.vimrc.backup 64 | /.vimrc.old 65 | /.viper 66 | /.wireshark 67 | /.wireshark-etc 68 | /.zcompdump 69 | /.Xauthority 70 | /Desktop 71 | /Documents 72 | /Downloads 73 | /Dropbox 74 | /Library/* 75 | !/Library/KeyBindings 76 | !/Library/AppleScripts 77 | /Movies 78 | /Music 79 | /Pictures 80 | /Public 81 | /Sites 82 | /bin/rvm 83 | /bin/rvm-auto-ruby 84 | /bin/rvm-exec 85 | /bin/rvm-prompt 86 | /bin/rvm-shell 87 | /bin/rvmsudo 88 | /blog 89 | /desktop_temp 90 | /doc 91 | /getmail-gmail-archive 92 | /media 93 | /misc.sparsebundle 94 | /proj 95 | /purchases 96 | /reference 97 | /screencasts 98 | /share/man 99 | /src 100 | /talks 101 | /var 102 | /work 103 | 104 | *.elc 105 | *~ 106 | *.orig 107 | *.rej 108 | *.pyc 109 | -------------------------------------------------------------------------------- /.vim/ruby/vim.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Wincent Colaiuta. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # 1. Redistributions of source code must retain the above copyright notice, 7 | # this list of conditions and the following disclaimer. 8 | # 2. Redistributions in binary form must reproduce the above copyright notice, 9 | # this list of conditions and the following disclaimer in the documentation 10 | # and/or other materials provided with the distribution. 11 | # 12 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 13 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 16 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 18 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 19 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 21 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 22 | # POSSIBILITY OF SUCH DAMAGE. 23 | 24 | require 'vim/screen' 25 | require 'vim/window' 26 | 27 | module VIM 28 | def self.has_syntax? 29 | VIM.evaluate('has("syntax")').to_i != 0 30 | end 31 | 32 | def self.pwd 33 | VIM.evaluate('getcwd()') 34 | end 35 | 36 | # Escape a string for safe inclusion in a Vim single-quoted string 37 | # (single quotes escaped by doubling, everything else is literal) 38 | def self.escape_for_single_quotes str 39 | str.gsub "'", "''" 40 | end 41 | end # module VIM 42 | -------------------------------------------------------------------------------- /.vim/ruby/vim/window.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2010 Wincent Colaiuta. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # 6 | # 1. Redistributions of source code must retain the above copyright notice, 7 | # this list of conditions and the following disclaimer. 8 | # 2. Redistributions in binary form must reproduce the above copyright notice, 9 | # this list of conditions and the following disclaimer in the documentation 10 | # and/or other materials provided with the distribution. 11 | # 12 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 13 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 15 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 16 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 18 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 19 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 20 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 21 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 22 | # POSSIBILITY OF SUCH DAMAGE. 23 | 24 | module VIM 25 | class Window 26 | def select 27 | return true if selected? 28 | initial = $curwin 29 | while true do 30 | VIM::command 'wincmd w' # cycle through windows 31 | return true if $curwin == self # have selected desired window 32 | return false if $curwin == initial # have already looped through all 33 | end 34 | end 35 | 36 | def selected? 37 | $curwin == self 38 | end 39 | end # class Window 40 | end # module VIM 41 | -------------------------------------------------------------------------------- /.vim/ftplugin/haml.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin 2 | " Language: Haml 3 | " Maintainer: Tim Pope 4 | " Last Change: 2010 May 21 5 | 6 | " Only do this when not done yet for this buffer 7 | if exists("b:did_ftplugin") 8 | finish 9 | endif 10 | 11 | let s:save_cpo = &cpo 12 | set cpo-=C 13 | 14 | " Define some defaults in case the included ftplugins don't set them. 15 | let s:undo_ftplugin = "" 16 | let s:browsefilter = "All Files (*.*)\t*.*\n" 17 | let s:match_words = "" 18 | 19 | runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim 20 | unlet! b:did_ftplugin 21 | 22 | " Override our defaults if these were set by an included ftplugin. 23 | if exists("b:undo_ftplugin") 24 | let s:undo_ftplugin = b:undo_ftplugin 25 | unlet b:undo_ftplugin 26 | endif 27 | if exists("b:browsefilter") 28 | let s:browsefilter = b:browsefilter 29 | unlet b:browsefilter 30 | endif 31 | if exists("b:match_words") 32 | let s:match_words = b:match_words 33 | unlet b:match_words 34 | endif 35 | 36 | runtime! ftplugin/ruby.vim ftplugin/ruby_*.vim ftplugin/ruby/*.vim 37 | let b:did_ftplugin = 1 38 | 39 | " Combine the new set of values with those previously included. 40 | if exists("b:undo_ftplugin") 41 | let s:undo_ftplugin = b:undo_ftplugin . " | " . s:undo_ftplugin 42 | endif 43 | if exists ("b:browsefilter") 44 | let s:browsefilter = substitute(b:browsefilter,'\cAll Files (\*\.\*)\t\*\.\*\n','','') . s:browsefilter 45 | endif 46 | if exists("b:match_words") 47 | let s:match_words = b:match_words . ',' . s:match_words 48 | endif 49 | 50 | " Change the browse dialog on Win32 to show mainly Haml-related files 51 | if has("gui_win32") 52 | let b:browsefilter="Haml Files (*.haml)\t*.haml\nSass Files (*.sass)\t*.sass\n" . s:browsefilter 53 | endif 54 | 55 | " Load the combined list of match_words for matchit.vim 56 | if exists("loaded_matchit") 57 | let b:match_words = s:match_words 58 | endif 59 | 60 | setlocal comments= commentstring=-#\ %s 61 | 62 | let b:undo_ftplugin = "setl cms< com< " 63 | \ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin 64 | 65 | let &cpo = s:save_cpo 66 | 67 | " vim:set sw=2: 68 | -------------------------------------------------------------------------------- /.emacs-lisp/mmm-univ.el: -------------------------------------------------------------------------------- 1 | ;;; mmm-univ.el --- The "Universal" Submode Class 2 | 3 | ;; Copyright (C) 2000 by Free Software Foundation, Inc. 4 | 5 | ;; Author: Michael Abraham Shulman 6 | 7 | ;;{{{ GPL 8 | 9 | ;; This file is free software; you can redistribute it and/or modify 10 | ;; it under the terms of the GNU General Public License as published by 11 | ;; the Free Software Foundation; either version 2, or (at your option) 12 | ;; any later version. 13 | 14 | ;; This file is distributed in the hope that it will be useful, 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | ;; GNU General Public License for more details. 18 | 19 | ;; You should have received a copy of the GNU General Public License 20 | ;; along with GNU Emacs; see the file COPYING. If not, write to 21 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 22 | ;; Boston, MA 02111-1307, USA. 23 | 24 | ;;}}} 25 | 26 | ;;; Commentary: 27 | 28 | ;; This file defines the "universal" submode class, the default value 29 | ;; of `mmm-global-classes', which specifies a standard way to indicate 30 | ;; that part of a buffer should be in a different mode--for example, 31 | ;; in an email message. 32 | 33 | ;;; Code: 34 | 35 | (require 'mmm-auto) 36 | (require 'mmm-vars) 37 | 38 | (defun mmm-univ-get-mode (string) 39 | (string-match "[a-zA-Z-]+" string) 40 | (setq string (match-string 0 string)) 41 | (let ((modestr (intern (if (string-match "mode\\'" string) 42 | string 43 | (concat string "-mode"))))) 44 | (or (mmm-ensure-modename modestr) 45 | (signal 'mmm-no-matching-submode nil)))) 46 | 47 | (mmm-add-classes 48 | `((universal 49 | :front "{%\\([a-zA-Z-]+\\)%}" 50 | :back "{%/~1%}" 51 | :insert ((?/ universal "Submode: " @ "{%" str "%}" @ "\n" _ "\n" 52 | @ "{%/" str "%}" @)) 53 | :match-submode mmm-univ-get-mode 54 | :save-matches 1 55 | ))) 56 | 57 | (provide 'mmm-univ) 58 | 59 | 60 | ;;; Local Variables: 61 | ;;; mmm-global-classes: nil 62 | ;;; End: 63 | 64 | ;;; mmm-univ.el ends here -------------------------------------------------------------------------------- /.vim/indent/javascript.vim: -------------------------------------------------------------------------------- 1 | " Vim indent file 2 | " Language: JavaScript 3 | " Author: Ryan (ryanthe) Fabella 4 | " URL: - 5 | " Last Change: 2007 september 25 6 | 7 | if exists('b:did_indent') 8 | finish 9 | endif 10 | let b:did_indent = 1 11 | 12 | setlocal indentexpr=GetJsIndent() 13 | setlocal indentkeys=0{,0},0),:,!^F,o,O,e,*,=*/ 14 | " Clean CR when the file is in Unix format 15 | if &fileformat == "unix" 16 | silent! %s/\r$//g 17 | endif 18 | " Only define the functions once per Vim session. 19 | if exists("*GetJsIndent") 20 | finish 21 | endif 22 | function! GetJsIndent() 23 | let pnum = prevnonblank(v:lnum - 1) 24 | if pnum == 0 25 | return 0 26 | endif 27 | let line = getline(v:lnum) 28 | let pline = getline(pnum) 29 | let ind = indent(pnum) 30 | 31 | if pline =~ '{\s*$\|[\s*$\|(\s*$' 32 | let ind = ind + &sw 33 | endif 34 | 35 | if pline =~ ';\s*$' && line =~ '^\s*}' 36 | let ind = ind - &sw 37 | endif 38 | 39 | if pline =~ '\s*]\s*$' && line =~ '^\s*),\s*$' 40 | let ind = ind - &sw 41 | endif 42 | 43 | if pline =~ '\s*]\s*$' && line =~ '^\s*}\s*$' 44 | let ind = ind - &sw 45 | endif 46 | 47 | if line =~ '^\s*});\s*$\|^\s*);\s*$' && pline !~ ';\s*$' 48 | let ind = ind - &sw 49 | endif 50 | 51 | if line =~ '^\s*})' && pline =~ '\s*,\s*$' 52 | let ind = ind - &sw 53 | endif 54 | 55 | if line =~ '^\s*}();\s*$' && pline =~ '^\s*}\s*$' 56 | let ind = ind - &sw 57 | endif 58 | 59 | if line =~ '^\s*}),\s*$' 60 | let ind = ind - &sw 61 | endif 62 | 63 | if pline =~ '^\s*}\s*$' && line =~ '),\s*$' 64 | let ind = ind - &sw 65 | endif 66 | 67 | if pline =~ '^\s*for\s*' && line =~ ')\s*$' 68 | let ind = ind + &sw 69 | endif 70 | 71 | if line =~ '^\s*}\s*$\|^\s*]\s*$\|\s*},\|\s*]);\s*\|\s*}]\s*$\|\s*};\s*$\|\s*})$\|\s*}).el$' && pline !~ '\s*;\s*$\|\s*]\s*$' && line !~ '^\s*{' && line !~ '\s*{\s*}\s*' 72 | let ind = ind - &sw 73 | endif 74 | 75 | if pline =~ '^\s*/\*' 76 | let ind = ind + 1 77 | endif 78 | 79 | if pline =~ '\*/$' 80 | let ind = ind - 1 81 | endif 82 | return ind 83 | endfunction 84 | -------------------------------------------------------------------------------- /bin/gvim: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This shell script passes all its arguments to the binary inside the Vim.app 4 | # application bundle. If you make links to this script as view, gvim, etc., 5 | # then it will peek at the name used to call it and set options appropriately. 6 | # 7 | # Based on a script by Wout Mertens and suggestions from Laurent Bihanic. 8 | # This version is the fault of Benji Fisher, 16 May 2005. 9 | 10 | # First, check "All the Usual Suspects" for the location of the Vim.app bundle. 11 | # You can short-circuit this by setting the VIM_APP_DIR environment variable 12 | # or by un-commenting and editing the following line: 13 | # VIM_APP_DIR=/Applications 14 | 15 | if [ -z "$VIM_APP_DIR" ] 16 | then 17 | myDir="`dirname "$0"`" 18 | myAppDir="$myDir/../Applications" 19 | for i in ~/Applications ~/Applications/vim $myDir $myDir/vim $myAppDir $myAppDir/vim /Applications /Applications/vim /Applications/Utilities /Applications/Utilities/vim; do 20 | if [ -x "$i/Vim.app" ]; then 21 | VIM_APP_DIR="$i" 22 | break 23 | fi 24 | done 25 | fi 26 | if [ -z "$VIM_APP_DIR" ] 27 | then 28 | echo "Sorry, cannot find Vim.app. Try setting the VIM_APP_DIR environment variable to the directory containing Vim.app." 29 | exit 1 30 | fi 31 | binary="$VIM_APP_DIR/Vim.app/Contents/MacOS/Vim" 32 | 33 | # Next, peek at the name used to invoke this script, and set options 34 | # accordingly. 35 | 36 | name="`basename "$0"`" 37 | gui= 38 | opts= 39 | 40 | # GUI mode, implies forking 41 | case "$name" in g*|rg*) gui=true ;; esac 42 | 43 | # Restricted mode 44 | case "$name" in r*) opts="$opts -Z";; esac 45 | 46 | # vimdiff and view 47 | case "$name" in 48 | *vimdiff) 49 | opts="$opts -dO" 50 | ;; 51 | *view) 52 | opts="$opts -R" 53 | ;; 54 | esac 55 | 56 | # Last step: fire up vim. 57 | # GUI mode will always create a new Vim instance, because Vim can't have 58 | # more than one graphic window yet. 59 | # The program should fork by default when started in GUI mode, but it does 60 | # not; we work around this when this script is invoked as "gvim" or "rgview" 61 | # etc., but not when it is invoked as "vim -g". 62 | if [ "$gui" ]; then 63 | # Note: this isn't perfect, because any error output goes to the 64 | # terminal instead of the console log. 65 | # But if you use open instead, you will need to fully qualify the 66 | # path names for any filenames you specify, which is hard. 67 | exec "$binary" -g $opts ${1:+"$@"} & 68 | else 69 | exec "$binary" $opts ${1:+"$@"} 70 | fi 71 | -------------------------------------------------------------------------------- /.vim/indent/haml.vim: -------------------------------------------------------------------------------- 1 | " Vim indent file 2 | " Language: Haml 3 | " Maintainer: Tim Pope 4 | " Last Change: 2010 May 21 5 | 6 | if exists("b:did_indent") 7 | finish 8 | endif 9 | runtime! indent/ruby.vim 10 | unlet! b:did_indent 11 | let b:did_indent = 1 12 | 13 | setlocal autoindent sw=2 et 14 | setlocal indentexpr=GetHamlIndent() 15 | setlocal indentkeys=o,O,*,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when 16 | 17 | " Only define the function once. 18 | if exists("*GetHamlIndent") 19 | finish 20 | endif 21 | 22 | let s:attributes = '\%({.\{-\}}\|\[.\{-\}\]\)' 23 | let s:tag = '\%([%.#][[:alnum:]_-]\+\|'.s:attributes.'\)*[<>]*' 24 | 25 | if !exists('g:haml_self_closing_tags') 26 | let g:haml_self_closing_tags = 'meta|link|img|hr|br' 27 | endif 28 | 29 | function! GetHamlIndent() 30 | let lnum = prevnonblank(v:lnum-1) 31 | if lnum == 0 32 | return 0 33 | endif 34 | let line = substitute(getline(lnum),'\s\+$','','') 35 | let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') 36 | let lastcol = strlen(line) 37 | let line = substitute(line,'^\s\+','','') 38 | let indent = indent(lnum) 39 | let cindent = indent(v:lnum) 40 | if cline =~# '\v^-\s*%(elsif|else|when)>' 41 | let indent = cindent < indent ? cindent : indent - &sw 42 | endif 43 | let increase = indent + &sw 44 | if indent == indent(lnum) 45 | let indent = cindent <= indent ? -1 : increase 46 | endif 47 | 48 | let group = synIDattr(synID(lnum,lastcol,1),'name') 49 | 50 | if line =~ '^!!!' 51 | return indent 52 | elseif line =~ '^/\%(\[[^]]*\]\)\=$' 53 | return increase 54 | elseif group == 'hamlFilter' 55 | return increase 56 | elseif line =~ '^'.s:tag.'[&!]\=[=~-]\s*\%(\%(if\|else\|elsif\|unless\|case\|when\|while\|until\|for\|begin\|module\|class\|def\)\>\%(.*\\)\@!\|.*do\%(\s*|[^|]*|\)\=\s*$\)' 57 | return increase 58 | elseif line =~ '^'.s:tag.'[&!]\=[=~-].*,\s*$' 59 | return increase 60 | elseif line == '-#' 61 | return increase 62 | elseif group =~? '\v^(hamlSelfCloser)$' || line =~? '^%\v%('.g:haml_self_closing_tags.')>' 63 | return indent 64 | elseif group =~? '\v^%(hamlTag|hamlAttributesDelimiter|hamlObjectDelimiter|hamlClass|hamlId|htmlTagName|htmlSpecialTagName)$' 65 | return increase 66 | elseif synIDattr(synID(v:lnum,1,1),'name') ==? 'hamlRubyFilter' 67 | return GetRubyIndent() 68 | else 69 | return indent 70 | endif 71 | endfunction 72 | 73 | " vim:set sw=2: 74 | -------------------------------------------------------------------------------- /.vim/colors/grb2.vim: -------------------------------------------------------------------------------- 1 | "%% SiSU Vim color file 2 | " Slate Maintainer: Ralph Amissah 3 | " (originally looked at desert Hans Fugal http://hans.fugal.net/vim/colors/desert.vim (2003/05/06) 4 | " 5 | " MODIFIED BY GRB 6 | " 7 | :set background=dark 8 | :highlight clear 9 | if version > 580 10 | hi clear 11 | if exists("syntax_on") 12 | syntax reset 13 | endif 14 | endif 15 | let colors_name = "slate" 16 | :hi Normal guifg=White guibg=grey15 17 | :hi Cursor guibg=khaki guifg=slategrey 18 | :hi VertSplit guibg=#c2bfa5 guifg=grey40 gui=none cterm=reverse 19 | :hi Folded guibg=black guifg=grey40 ctermfg=grey ctermbg=darkgrey 20 | :hi FoldColumn guibg=black guifg=grey20 ctermfg=4 ctermbg=7 21 | :hi IncSearch guifg=green guibg=black cterm=none ctermfg=yellow ctermbg=green 22 | :hi ModeMsg guifg=goldenrod cterm=none ctermfg=brown 23 | :hi MoreMsg guifg=SeaGreen ctermfg=darkgreen 24 | :hi NonText guifg=RoyalBlue guibg=grey15 cterm=bold ctermfg=blue 25 | :hi Question guifg=springgreen ctermfg=green 26 | :hi Search guibg=peru guifg=wheat cterm=none ctermfg=grey ctermbg=blue 27 | :hi SpecialKey guifg=yellowgreen ctermfg=darkgreen 28 | :hi StatusLine guibg=#c2bfa5 guifg=black gui=none cterm=bold,reverse 29 | :hi StatusLineNC guibg=#c2bfa5 guifg=grey40 gui=none cterm=reverse 30 | :hi Title guifg=gold gui=bold cterm=bold ctermfg=yellow 31 | :hi Statement guifg=CornflowerBlue ctermfg=lightblue 32 | :hi Visual gui=none guifg=khaki guibg=olivedrab cterm=reverse 33 | :hi WarningMsg guifg=salmon ctermfg=1 34 | :hi String guifg=SkyBlue ctermfg=darkcyan 35 | :hi Comment ctermfg=darkgray guifg=grey40 36 | :hi Constant guifg=#ffa0a0 ctermfg=brown 37 | :hi Special guifg=darkkhaki ctermfg=brown 38 | :hi Identifier guifg=salmon ctermfg=red 39 | :hi Include guifg=red ctermfg=red 40 | :hi PreProc guifg=red guibg=white ctermfg=red 41 | :hi Operator guifg=Red ctermfg=Red 42 | :hi Define guifg=gold gui=bold ctermfg=yellow 43 | :hi Type guifg=CornflowerBlue ctermfg=2 44 | :hi Function guifg=navajowhite ctermfg=brown 45 | :hi Structure guifg=green ctermfg=green 46 | :hi LineNr guifg=grey50 ctermfg=3 47 | :hi Ignore guifg=grey40 cterm=bold ctermfg=7 48 | :hi Todo guifg=orangered guibg=yellow2 49 | :hi Directory ctermfg=darkcyan 50 | :hi ErrorMsg cterm=bold guifg=White guibg=Red cterm=bold ctermfg=7 ctermbg=1 51 | :hi VisualNOS cterm=bold,underline 52 | :hi WildMenu ctermfg=0 ctermbg=3 53 | :hi DiffAdd ctermbg=4 54 | :hi DiffChange ctermbg=5 55 | :hi DiffDelete cterm=bold ctermfg=4 ctermbg=6 56 | :hi DiffText cterm=bold ctermbg=1 57 | :hi Underlined cterm=underline ctermfg=5 58 | :hi Error guifg=White guibg=Red cterm=bold ctermfg=7 ctermbg=1 59 | :hi SpellErrors guifg=White guibg=Red cterm=bold ctermfg=7 ctermbg=1 60 | -------------------------------------------------------------------------------- /.vim/colors/pyte.vim: -------------------------------------------------------------------------------- 1 | 2 | set background=light 3 | 4 | hi clear 5 | if exists("syntax_on") 6 | syntax reset 7 | endif 8 | 9 | let colors_name = "pyte" 10 | 11 | if version >= 700 12 | hi CursorLine guibg=#f6f6f6 13 | hi CursorColumn guibg=#eaeaea 14 | hi MatchParen guifg=white guibg=#80a090 gui=bold 15 | 16 | "Tabpages 17 | hi TabLine guifg=black guibg=#b0b8c0 gui=italic 18 | hi TabLineFill guifg=#9098a0 19 | hi TabLineSel guifg=black guibg=#f0f0f0 gui=italic,bold 20 | 21 | "P-Menu (auto-completion) 22 | hi Pmenu guifg=white guibg=#808080 23 | "PmenuSel 24 | "PmenuSbar 25 | "PmenuThumb 26 | endif 27 | " 28 | " Html-Titles 29 | hi Title guifg=#202020 gui=bold 30 | hi Underlined guifg=#202020 gui=underline 31 | 32 | 33 | hi Cursor guifg=black guibg=#b0b4b8 34 | hi lCursor guifg=black guibg=white 35 | hi LineNr guifg=#ffffff guibg=#c0d0e0 36 | 37 | hi Normal guifg=#202020 guibg=#f0f0f0 38 | 39 | hi StatusLine guifg=white guibg=#8090a0 gui=bold,italic 40 | hi StatusLineNC guifg=#506070 guibg=#a0b0c0 gui=italic 41 | hi VertSplit guifg=#a0b0c0 guibg=#a0b0c0 gui=NONE 42 | 43 | hi Folded guifg=#708090 guibg=#c0d0e0 44 | 45 | hi NonText guifg=#c0c0c0 guibg=#e0e0e0 46 | " Kommentare 47 | hi Comment guifg=#a0b0c0 gui=italic 48 | 49 | " Konstanten 50 | hi Constant guifg=#a07040 51 | hi String guifg=#4070a0 52 | hi Number guifg=#40a070 53 | hi Float guifg=#70a040 54 | "hi Statement guifg=#0070e0 gui=NONE 55 | " Python: def and so on, html: tag-names 56 | hi Statement guifg=#007020 gui=bold 57 | 58 | 59 | " HTML: arguments 60 | hi Type guifg=#e5a00d gui=italic 61 | " Python: Standard exceptions, True&False 62 | hi Structure guifg=#007020 gui=italic 63 | hi Function guifg=#06287e gui=italic 64 | 65 | hi Identifier guifg=#5b3674 gui=italic 66 | 67 | hi Repeat guifg=#7fbf58 gui=bold 68 | hi Conditional guifg=#4c8f2f gui=bold 69 | 70 | " Cheetah: #-Symbol, function-names 71 | hi PreProc guifg=#1060a0 gui=NONE 72 | " Cheetah: def, for and so on, Python: Decorators 73 | hi Define guifg=#1060a0 gui=bold 74 | 75 | hi Error guifg=red guibg=white gui=bold,underline 76 | hi Todo guifg=#a0b0c0 guibg=NONE gui=italic,bold,underline 77 | 78 | " Python: %(...)s - constructs, encoding 79 | hi Special guifg=#70a0d0 gui=italic 80 | 81 | hi Operator guifg=#408010 82 | 83 | " color of s etc... 84 | hi SpecialKey guifg=#d8a080 guibg=#e8e8e8 gui=italic 85 | 86 | " Diff 87 | hi DiffChange guifg=NONE guibg=#e0e0e0 gui=italic,bold 88 | hi DiffText guifg=NONE guibg=#f0c8c8 gui=italic,bold 89 | hi DiffAdd guifg=NONE guibg=#c0e0d0 gui=italic,bold 90 | hi DiffDelete guifg=NONE guibg=#f0e0b0 gui=italic,bold 91 | 92 | 93 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | . ~/bin/bash_colors.sh 2 | 3 | # Add paths that should have been there by default 4 | export PATH=${PATH}:/usr/local/bin 5 | export PATH="~/bin:$PATH" 6 | export PATH="$PATH:~/.gem/ruby/1.8/bin" 7 | 8 | # Add postgres to the path 9 | export PATH=$PATH:/usr/local/pgsql/bin 10 | export PATH=$PATH:/Library/PostgreSQL/8.3/bin 11 | 12 | # Unbreak broken, non-colored terminal 13 | export TERM='xterm-color' 14 | alias ls='ls -G' 15 | alias ll='ls -lG' 16 | export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd" 17 | export GREP_OPTIONS="--color" 18 | 19 | # Erase duplicates in history 20 | export HISTCONTROL=erasedups 21 | # Store 10k history entries 22 | export HISTSIZE=10000 23 | # Append to the history file when exiting instead of overwriting it 24 | shopt -s histappend 25 | 26 | # ACTUAL CUSTOMIZATION OH NOES! 27 | function minutes_since_last_commit { 28 | now=`date +%s` 29 | last_commit=`git log --pretty=format:'%at' -1` 30 | seconds_since_last_commit=$((now-last_commit)) 31 | minutes_since_last_commit=$((seconds_since_last_commit/60)) 32 | echo $minutes_since_last_commit 33 | } 34 | grb_git_prompt() { 35 | local g="$(__gitdir)" 36 | if [ -n "$g" ]; then 37 | local MINUTES_SINCE_LAST_COMMIT=`minutes_since_last_commit` 38 | if [ "$MINUTES_SINCE_LAST_COMMIT" -gt 30 ]; then 39 | local COLOR=${RED} 40 | elif [ "$MINUTES_SINCE_LAST_COMMIT" -gt 10 ]; then 41 | local COLOR=${YELLOW} 42 | else 43 | local COLOR=${GREEN} 44 | fi 45 | local SINCE_LAST_COMMIT="${COLOR}$(minutes_since_last_commit)m${NORMAL}" 46 | # The __git_ps1 function inserts the current git branch where %s is 47 | local GIT_PROMPT=`__git_ps1 "(%s|${SINCE_LAST_COMMIT})"` 48 | echo ${GIT_PROMPT} 49 | fi 50 | } 51 | PS1="\h:\W\$(grb_git_prompt) \u\$ " 52 | gd() { git diff $* | view -; } 53 | gdc() { gd --cached $*; } 54 | alias pygrep="grep --include='*.py' $*" 55 | alias rbgrep="grep --include='*.rb' $*" 56 | 57 | activate_virtualenv() { 58 | if [ -f env/bin/activate ]; then . env/bin/activate; 59 | elif [ -f ../env/bin/activate ]; then . ../env/bin/activate; 60 | elif [ -f ../../env/bin/activate ]; then . ../../env/bin/activate; 61 | elif [ -f ../../../env/bin/activate ]; then . ../../../env/bin/activate; 62 | fi 63 | } 64 | 65 | python_module_dir () { 66 | echo "$(python -c "import os.path as _, ${1}; \ 67 | print _.dirname(_.realpath(${1}.__file__[:-1]))" 68 | )" 69 | } 70 | 71 | # MacPorts Installer addition on 2010-04-21_at_09:59:50: adding an appropriate PATH variable for use with MacPorts. 72 | export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin:$PATH 73 | # Finished adapting your PATH environment variable for use with MacPorts. 74 | 75 | source ~/bin/git-completion.bash 76 | 77 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | setopt promptsubst 2 | autoload -U promptinit 3 | promptinit 4 | prompt grb 5 | 6 | autoload -U compinit 7 | compinit 8 | 9 | # Add paths that should have been there by default 10 | export PATH=/usr/local/sbin:/usr/local/bin:${PATH} 11 | export PATH="$HOME/bin:$PATH" 12 | export PATH="$PATH:~/.gem/ruby/1.8/bin" 13 | 14 | # Add postgres to the path 15 | export PATH=$PATH:/usr/local/pgsql/bin 16 | export PATH=$PATH:/Library/PostgreSQL/8.3/bin 17 | 18 | # Unbreak broken, non-colored terminal 19 | export TERM='xterm-color' 20 | alias ls='ls -G' 21 | alias ll='ls -lG' 22 | alias duh='du -csh' 23 | export LSCOLORS="ExGxBxDxCxEgEdxbxgxcxd" 24 | export GREP_OPTIONS="--color" 25 | 26 | # Unbreak history 27 | export HISTSIZE=100000 28 | export HISTFILE="$HOME/.history" 29 | export SAVEHIST=$HISTSIZE 30 | 31 | # Unbreak Python's error-prone .pyc file generation 32 | export PYTHONDONTWRITEBYTECODE=1 33 | 34 | export WORDCHARS='*?[]~&;!$%^<>' 35 | 36 | export ACK_COLOR_MATCH='red' 37 | 38 | # ACTUAL CUSTOMIZATION OH NOES! 39 | gd() { git diff $* | view -; } 40 | gdc() { gd --cached $*; } 41 | alias pygrep="grep --include='*.py' $*" 42 | alias rbgrep="grep --include='*.rb' $*" 43 | alias r=rails 44 | alias t="script/test $*" 45 | alias c="cucumber $*" 46 | alias sr="screen -r" 47 | alias gx="gitx" 48 | alias gxa="gitx --all" 49 | function mcd() { mkdir -p $1 && cd $1 } 50 | alias :q="echo YOU FAIL" 51 | function cdf() { cd *$1*/ } # stolen from @topfunky 52 | function das() { 53 | cd ~/proj/destroyallsoftware.com/destroyallsoftware.com 54 | pwd 55 | export RUBY_HEAP_MIN_SLOTS=1000000 56 | export RUBY_HEAP_SLOTS_INCREMENT=1000000 57 | export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 58 | export RUBY_GC_MALLOC_LIMIT=1000000000 59 | export RUBY_HEAP_FREE_MIN=500000 60 | . /Volumes/misc/filing/business/destroy\ all\ software\ llc/s3.sh 61 | . /Volumes/misc/filing/business/destroy\ all\ software\ llc/braintree.sh 62 | } 63 | 64 | activate_virtualenv() { 65 | if [ -f env/bin/activate ]; then . env/bin/activate; 66 | elif [ -f ../env/bin/activate ]; then . ../env/bin/activate; 67 | elif [ -f ../../env/bin/activate ]; then . ../../env/bin/activate; 68 | elif [ -f ../../../env/bin/activate ]; then . ../../../env/bin/activate; 69 | fi 70 | } 71 | 72 | python_module_dir () { 73 | echo "$(python -c "import os.path as _, ${1}; \ 74 | print _.dirname(_.realpath(${1}.__file__[:-1]))" 75 | )" 76 | } 77 | 78 | # Set up rvm 79 | [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm 80 | 81 | # MacPorts Installer addition on 2010-04-21_at_09:59:50: adding an appropriate PATH variable for use with MacPorts. 82 | export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin:/opt/local/lib/mysql5/bin:$PATH 83 | # Finished adapting your PATH environment variable for use with MacPorts. 84 | 85 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. 86 | 87 | -------------------------------------------------------------------------------- /.emacs-lisp/pycomplete.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | Python dot expression completion using Pymacs. 4 | 5 | This almost certainly needs work, but if you add 6 | 7 | (require 'pycomplete) 8 | 9 | to your .xemacs/init.el file (untried w/ GNU Emacs so far) and have Pymacs 10 | installed, when you hit M-TAB it will try to complete the dot expression 11 | before point. For example, given this import at the top of the file: 12 | 13 | import time 14 | 15 | typing "time.cl" then hitting M-TAB should complete "time.clock". 16 | 17 | This is unlikely to be done the way Emacs completion ought to be done, but 18 | it's a start. Perhaps someone with more Emacs mojo can take this stuff and 19 | do it right. 20 | 21 | See pycomplete.el for the Emacs Lisp side of things. 22 | """ 23 | 24 | import sys 25 | import os.path 26 | 27 | try: 28 | x = set 29 | except NameError: 30 | from sets import Set as set 31 | else: 32 | del x 33 | 34 | def get_all_completions(s, imports=None): 35 | """Return contextual completion of s (string of >= zero chars). 36 | 37 | If given, imports is a list of import statements to be executed first. 38 | """ 39 | locald = {} 40 | if imports is not None: 41 | for stmt in imports: 42 | try: 43 | exec stmt in globals(), locald 44 | except TypeError: 45 | raise TypeError, "invalid type: %s" % stmt 46 | 47 | dots = s.split(".") 48 | if not s or len(dots) == 1: 49 | keys = set() 50 | keys.update(locald.keys()) 51 | keys.update(globals().keys()) 52 | import __builtin__ 53 | keys.update(dir(__builtin__)) 54 | keys = list(keys) 55 | keys.sort() 56 | if s: 57 | return [k for k in keys if k.startswith(s)] 58 | else: 59 | return keys 60 | 61 | sym = None 62 | for i in range(1, len(dots)): 63 | s = ".".join(dots[:i]) 64 | try: 65 | sym = eval(s, globals(), locald) 66 | except NameError: 67 | try: 68 | sym = __import__(s, globals(), locald, []) 69 | except ImportError: 70 | return [] 71 | if sym is not None: 72 | s = dots[-1] 73 | return [k for k in dir(sym) if k.startswith(s)] 74 | 75 | def pycomplete(s, imports=None): 76 | completions = get_all_completions(s, imports) 77 | dots = s.split(".") 78 | return os.path.commonprefix([k[len(dots[-1]):] for k in completions]) 79 | 80 | if __name__ == "__main__": 81 | print " ->", pycomplete("") 82 | print "sys.get ->", pycomplete("sys.get") 83 | print "sy ->", pycomplete("sy") 84 | print "sy (sys in context) ->", pycomplete("sy", imports=["import sys"]) 85 | print "foo. ->", pycomplete("foo.") 86 | print "Enc (email * imported) ->", 87 | print pycomplete("Enc", imports=["from email import *"]) 88 | print "E (email * imported) ->", 89 | print pycomplete("E", imports=["from email import *"]) 90 | 91 | print "Enc ->", pycomplete("Enc") 92 | print "E ->", pycomplete("E") 93 | 94 | # Local Variables : 95 | # pymacs-auto-reload : t 96 | # End : 97 | -------------------------------------------------------------------------------- /.emacs-lisp/mmm-cweb.el: -------------------------------------------------------------------------------- 1 | ;;; mmm-cweb.el --- MMM submode class for CWeb programs 2 | 3 | ;; Copyright (C) 2001 by Alan Shutko 4 | 5 | ;; Author: Alan Shutko 6 | ;; Version: $Id: mmm-cweb.el,v 1.3 2002/11/12 02:44:06 alanshutko Exp $ 7 | 8 | ;;{{{ GPL 9 | 10 | ;; This file is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation; either version 2, or (at your option) 13 | ;; any later version. 14 | 15 | ;; This file is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to 22 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | ;; Boston, MA 02111-1307, USA. 24 | 25 | ;;}}} 26 | 27 | ;;; Commentary: 28 | 29 | ;; This file contains the definition of an MMM Mode submode class for 30 | ;; editing CWeb programs. 31 | 32 | ;;; Code: 33 | 34 | (require 'mmm-compat) 35 | (require 'mmm-vars) 36 | (require 'mmm-auto) 37 | 38 | (defvar mmm-cweb-section-tags 39 | '("@ " "@*")) 40 | 41 | (defvar mmm-cweb-section-regexp 42 | (concat "^" (mmm-regexp-opt mmm-cweb-section-tags t))) 43 | 44 | (defvar mmm-cweb-c-part-tags 45 | '("@c" "@>=" "@>+=" "@p")) 46 | 47 | (defvar mmm-cweb-c-part-regexp 48 | (concat (mmm-regexp-opt mmm-cweb-c-part-tags t))) 49 | 50 | (defun mmm-cweb-in-limbo (pos) 51 | "Check to see if POS is in limbo, ie before any cweb sections." 52 | (save-match-data 53 | (save-excursion 54 | (goto-char pos) 55 | (not (re-search-backward mmm-cweb-section-regexp nil t))))) 56 | 57 | (defun mmm-cweb-verify-brief-c () 58 | "Verify function for cweb-brief-c class. 59 | Checks whether the match is in limbo." 60 | (not (mmm-cweb-in-limbo (match-beginning 0)))) 61 | 62 | (mmm-add-group 63 | 'cweb 64 | `( 65 | (cweb-c-part 66 | :submode c-mode 67 | :front ,mmm-cweb-c-part-regexp 68 | :back ,mmm-cweb-section-regexp) 69 | (cweb-label 70 | :submode tex-mode 71 | :front "@<" 72 | :back "@>" 73 | :face mmm-comment-submode-face 74 | :insert ((?l cweb-label nil @ "@<" @ "@>"))) 75 | (cweb-brief-c 76 | :submode c-mode 77 | :front "[^\\|]\\(|\\)[^|]" 78 | :front-match 1 79 | :front-verify mmm-cweb-verify-brief-c 80 | ; :front-offset -1 81 | :back "[^\\|]\\(|\\)" 82 | :back-match 1 83 | ; :back-offset 1 84 | :end-not-begin t 85 | :insert ((?| cweb-c-in-tex nil "|" @ "|"))) 86 | (cweb-comment 87 | :submode tex-mode 88 | :front "/[*]" 89 | :back "[*]/" 90 | :face mmm-comment-submode-face) 91 | )) 92 | 93 | ;; (add-to-list 'mmm-mode-ext-classes-alist 94 | ;; '(plain-tex-mode "\\.w\\'" cweb)) 95 | ;; (add-to-list 'mmm-mode-ext-classes-alist 96 | ;; '(latex-mode "\\.w\\'" cweb)) 97 | ;; (add-to-list 'auto-mode-alist '("\\.w\\'" . tex-mode)) 98 | 99 | (provide 'mmm-cweb) 100 | 101 | ;;; mmm-cweb.el ends here -------------------------------------------------------------------------------- /.vim/.VimballRecord: -------------------------------------------------------------------------------- 1 | snippy_bundles.vba: call delete('/Users/grb/.vim/after/ftplugin/actionscript_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/aspvbs_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/c_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/css_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/django_model_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/django_template_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/f-script_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/haskell_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/html_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/java_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/javascript_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/latex_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/logo_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/markdown_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/movable_type_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/objc_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/ocaml_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/perl_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/php_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/phpdoc_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/propel_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/python_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/rails_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/ruby_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/sh_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/slate_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/smarty_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/symfony_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/tcl_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/template_toolkit_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/tex_snippets.vim')|call delete('/Users/grb/.vim/after/ftplugin/xhtml_snippets.vim') 2 | snippy_plugin.vba: call delete('/Users/grb/.vim/plugin/snippetsEmu.vim')|call delete('/Users/grb/.vim/doc/snippets_emu.txt') 3 | command-t.vba: call delete('/Users/grb/.vim/ruby/command-t/base.rb')|call delete('/Users/grb/.vim/ruby/command-t/controller.rb')|call delete('/Users/grb/.vim/ruby/command-t/extconf.rb')|call delete('/Users/grb/.vim/ruby/command-t/match_window.rb')|call delete('/Users/grb/.vim/ruby/command-t/prompt.rb')|call delete('/Users/grb/.vim/ruby/command-t/scanner/base.rb')|call delete('/Users/grb/.vim/ruby/command-t/scanner/ruby.rb')|call delete('/Users/grb/.vim/ruby/command-t/scanner.rb')|call delete('/Users/grb/.vim/ruby/command-t/settings.rb')|call delete('/Users/grb/.vim/ruby/command-t/stub.rb')|call delete('/Users/grb/.vim/ruby/vim/screen.rb')|call delete('/Users/grb/.vim/ruby/vim/window.rb')|call delete('/Users/grb/.vim/ruby/vim.rb')|call delete('/Users/grb/.vim/ruby/command-t/ext.c')|call delete('/Users/grb/.vim/ruby/command-t/match.c')|call delete('/Users/grb/.vim/ruby/command-t/matcher.c')|call delete('/Users/grb/.vim/ruby/command-t/ext.h')|call delete('/Users/grb/.vim/ruby/command-t/match.h')|call delete('/Users/grb/.vim/ruby/command-t/matcher.h')|call delete('/Users/grb/.vim/ruby/command-t/ruby_compat.h')|call delete('/Users/grb/.vim/ruby/command-t/depend')|call delete('/Users/grb/.vim/doc/command-t.txt')|call delete('/Users/grb/.vim/plugin/command-t.vim') 4 | -------------------------------------------------------------------------------- /bin/nosy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | ''' 4 | Watch for changes in all .py files. If changes, run nosetests. 5 | ''' 6 | 7 | # By Gary Bernhardt, http://extracheese.org 8 | # Based on original nosy.py by Jeff Winkler, http://jeffwinkler.net 9 | 10 | 11 | import sys, glob, os, stat, time 12 | import subprocess 13 | import re 14 | 15 | 16 | FILE_REGEX = re.compile(r'(py|txt|html|rb|feature|README)$') 17 | STAT_INTERVAL = .25 # seconds 18 | CRAWL_INTERVAL = 10 # seconds 19 | 20 | 21 | class Crawler: 22 | def __init__(self): 23 | self.last_crawl = 0 24 | self.filenames = [] 25 | 26 | def crawl(self): 27 | # Only crawl if enough time has passed since the last crawl 28 | if time.time() - self.last_crawl < CRAWL_INTERVAL: 29 | return self.filenames 30 | 31 | self.last_crawl = time.time() 32 | 33 | # Build a list of all directories that are children of this one 34 | paths = ['.'] 35 | for dirpath, _, filenames in os.walk('.'): 36 | paths += [os.path.join(dirpath, filename) 37 | for filename in filenames] 38 | 39 | # Return all files in one of those directories that match the regex 40 | filenames = set([path 41 | for path in paths 42 | if re.search(FILE_REGEX, path)]) 43 | self.filenames = filenames 44 | return self.filenames 45 | 46 | def checksum(self): 47 | """ 48 | Return a dictionary that represents the current state of this 49 | directory 50 | """ 51 | def stat_string(path): 52 | stat = os.stat(path) 53 | return '%s,%s' % (str(stat.st_size), str(stat.st_mtime)) 54 | 55 | return dict((path, stat_string(path)) 56 | for path in self.crawl() 57 | if os.path.exists(path)) 58 | 59 | 60 | iterations = 0 61 | 62 | 63 | def print_changes(changed_paths): 64 | global iterations 65 | iterations += 1 66 | 67 | print 68 | print 69 | print 70 | print '----- Iteration', iterations, '(%s)' % time.ctime() 71 | 72 | if changed_paths: 73 | print ' Changes:', ', '.join(sorted(changed_paths)) 74 | 75 | 76 | def change_generator(): 77 | yield [] 78 | crawler = Crawler() 79 | old_checksum = crawler.checksum() 80 | 81 | while True: 82 | time.sleep(STAT_INTERVAL) 83 | new_checksum = crawler.checksum() 84 | 85 | if new_checksum != old_checksum: 86 | # Wait and recaculate the checksum, so if multiple files are being 87 | # written we get them all in one iteration 88 | time.sleep(0.2) 89 | new_checksum = crawler.checksum() 90 | 91 | old_keys = set(old_checksum.keys()) 92 | new_keys = set(new_checksum.keys()) 93 | common_keys = old_keys.intersection(new_keys) 94 | 95 | # Add any files that exist in only one checksum 96 | changes = old_keys.symmetric_difference(new_keys) 97 | # Add any files that exist in both but changed 98 | changes.update([key for key in common_keys 99 | if new_checksum[key] != old_checksum[key]]) 100 | 101 | old_checksum = new_checksum 102 | yield changes 103 | 104 | 105 | def main(): 106 | old_checksum = None 107 | 108 | for changed_paths in change_generator(): 109 | print_changes(changed_paths) 110 | os.system(' '.join(sys.argv[1:])) 111 | 112 | if __name__ == '__main__': 113 | main() 114 | 115 | -------------------------------------------------------------------------------- /.vim/plugin/scratch.vim: -------------------------------------------------------------------------------- 1 | " File: scratch.vim 2 | " Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) 3 | " Version: 1.0 4 | " Last Modified: June 3, 2003 5 | " 6 | " Overview 7 | " -------- 8 | " You can use the scratch plugin to create a temporary scratch buffer to store 9 | " and edit text that will be discarded when you quit/exit vim. The contents 10 | " of the scratch buffer are not saved/stored in a file. 11 | " 12 | " Installation 13 | " ------------ 14 | " 1. Copy the scratch.vim plugin to the $HOME/.vim/plugin directory. Refer to 15 | " the following Vim help topics for more information about Vim plugins: 16 | " 17 | " :help add-plugin 18 | " :help add-global-plugin 19 | " :help runtimepath 20 | " 21 | " 2. Restart Vim. 22 | " 23 | " Usage 24 | " ----- 25 | " You can use the following command to open/edit the scratch buffer: 26 | " 27 | " :Scratch 28 | " 29 | " To open the scratch buffer in a new split window, use the following command: 30 | " 31 | " :Sscratch 32 | " 33 | " When you close the scratch buffer window, the buffer will retain the 34 | " contents. You can again edit the scratch buffer by openeing it using one of 35 | " the above commands. There is no need to save the scatch buffer. 36 | " 37 | " When you quit/exit Vim, the contents of the scratch buffer will be lost. 38 | " You will not be prompted to save the contents of the modified scratch 39 | " buffer. 40 | " 41 | " You can have only one scratch buffer open in a single Vim instance. If the 42 | " current buffer has unsaved modifications, then the scratch buffer will be 43 | " opened in a new window 44 | " 45 | " ****************** Do not modify after this line ************************ 46 | if exists('loaded_scratch') || &cp 47 | finish 48 | endif 49 | let loaded_scratch=1 50 | 51 | " Scratch buffer name 52 | let ScratchBufferName = "__Scratch__" 53 | 54 | " ScratchBufferOpen 55 | " Open the scratch buffer 56 | function! s:ScratchBufferOpen(new_win) 57 | let split_win = a:new_win 58 | 59 | " If the current buffer is modified then open the scratch buffer in a new 60 | " window 61 | if !split_win && &modified 62 | let split_win = 1 63 | endif 64 | 65 | " Check whether the scratch buffer is already created 66 | let scr_bufnum = bufnr(g:ScratchBufferName) 67 | if scr_bufnum == -1 68 | " open a new scratch buffer 69 | if split_win 70 | exe "new " . g:ScratchBufferName 71 | else 72 | exe "edit " . g:ScratchBufferName 73 | endif 74 | else 75 | " Scratch buffer is already created. Check whether it is open 76 | " in one of the windows 77 | let scr_winnum = bufwinnr(scr_bufnum) 78 | if scr_winnum != -1 79 | " Jump to the window which has the scratch buffer if we are not 80 | " already in that window 81 | if winnr() != scr_winnum 82 | exe scr_winnum . "wincmd w" 83 | endif 84 | else 85 | " Create a new scratch buffer 86 | if split_win 87 | exe "split +buffer" . scr_bufnum 88 | else 89 | exe "buffer " . scr_bufnum 90 | endif 91 | endif 92 | endif 93 | endfunction 94 | 95 | " ScratchMarkBuffer 96 | " Mark a buffer as scratch 97 | function! s:ScratchMarkBuffer() 98 | setlocal buftype=nofile 99 | setlocal bufhidden=hide 100 | setlocal noswapfile 101 | setlocal buflisted 102 | endfunction 103 | 104 | autocmd BufNewFile __Scratch__ call s:ScratchMarkBuffer() 105 | 106 | " Command to edit the scratch buffer in the current window 107 | command! -nargs=0 Scratch call s:ScratchBufferOpen(0) 108 | " Command to open the scratch buffer in a new split window 109 | command! -nargs=0 Sscratch call s:ScratchBufferOpen(1) 110 | 111 | -------------------------------------------------------------------------------- /.vim/ftplugin/cucumber.vim: -------------------------------------------------------------------------------- 1 | " Vim filetype plugin 2 | " Language: Cucumber 3 | " Maintainer: Tim Pope 4 | 5 | " Only do this when not done yet for this buffer 6 | if (exists("b:did_ftplugin")) 7 | finish 8 | endif 9 | let b:did_ftplugin = 1 10 | 11 | setlocal formatoptions-=t formatoptions+=croql 12 | setlocal comments=:# commentstring=#\ %s 13 | setlocal omnifunc=CucumberComplete 14 | 15 | let b:undo_ftplugin = "setl fo< com< cms< ofu<" 16 | 17 | let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') 18 | 19 | if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") 20 | nmap :exe jump('edit',v:count) 21 | nmap ] :exe jump('split',v:count) 22 | nmap :exe jump('split',v:count) 23 | nmap } :exe jump('pedit',v:count) 24 | let b:undo_ftplugin .= "| sil! iunmap! | sil! iunmap! ]| sil! iunmap! | sil! iunmap! }" 25 | endif 26 | 27 | function! s:jump(command,count) 28 | let steps = s:steps(getline('.')) 29 | if len(steps) == 0 || len(steps) < a:count 30 | return 'echoerr "No matching step found"' 31 | elseif len(steps) > 1 && !a:count 32 | return 'echoerr "Multiple matching steps found"' 33 | else 34 | let c = a:count ? a:count-1 : 0 35 | return a:command.' +'.steps[c][1].' '.escape(steps[c][0],' %#') 36 | endif 37 | endfunction 38 | 39 | function! s:allsteps() 40 | let step_pattern = '\C^\s*\%(Giv\|[WT]h\)en\>\s*\zs.\{-\}\ze\s*\%(do\|{\)\s*\%(|[A-Za-z0-9_,() *]*|\s*\)\=$' 41 | let steps = [] 42 | for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n") 43 | let lines = readfile(file) 44 | let num = 0 45 | for line in lines 46 | let num += 1 47 | if line =~ step_pattern 48 | let type = matchstr(line,'\w\+') 49 | let steps += [[file,num,type,matchstr(line,step_pattern)]] 50 | endif 51 | endfor 52 | endfor 53 | return steps 54 | endfunction 55 | 56 | function! s:steps(step) 57 | let step = matchstr(a:step,'^\s*\k*\s*\zs.\{-\}\s*$') 58 | return filter(s:allsteps(),'s:stepmatch(v:val[3],step)') 59 | endfunction 60 | 61 | function! s:stepmatch(receiver,target) 62 | if a:receiver =~ '^[''"].*[''"]$' 63 | let pattern = '^'.escape(substitute(a:receiver[1:-2],'$\w\+','(.*)','g'),'/').'$' 64 | elseif a:receiver =~ '^/.*/$' 65 | let pattern = a:receiver[1:-2] 66 | elseif a:receiver =~ '^%r..*.$' 67 | let pattern = escape(a:receiver[3:-2],'/') 68 | else 69 | return 0 70 | endif 71 | try 72 | let vimpattern = substitute(substitute(pattern,'\\\@ 3 | " Version: 1.2 4 | 5 | " Install in ~/.vim/autoload (or ~\vimfiles\autoload). 6 | " 7 | " API is documented below. 8 | 9 | if exists("g:loaded_pathogen") || &cp 10 | finish 11 | endif 12 | let g:loaded_pathogen = 1 13 | 14 | " Split a path into a list. 15 | function! pathogen#split(path) abort " {{{1 16 | if type(a:path) == type([]) | return a:path | endif 17 | let split = split(a:path,'\\\@ output 71 | silent filetype 72 | redir END 73 | let result = {} 74 | let result.detection = match(output,'detection:ON') >= 0 75 | let result.indent = match(output,'indent:ON') >= 0 76 | let result.plugin = match(output,'plugin:ON') >= 0 77 | return result 78 | endfunction " }}}1 79 | 80 | " \ on Windows unless shellslash is set, / everywhere else. 81 | function! pathogen#separator() abort " {{{1 82 | return !exists("+shellslash") || &shellslash ? '/' : '\' 83 | endfunction " }}}1 84 | 85 | " Convenience wrapper around glob() which returns a list. 86 | function! pathogen#glob(pattern) abort " {{{1 87 | let files = split(glob(a:pattern),"\n") 88 | return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")') 89 | endfunction "}}}1 90 | 91 | " Like pathogen#glob(), only limit the results to directories. 92 | function! pathogen#glob_directories(pattern) abort " {{{1 93 | return filter(pathogen#glob(a:pattern),'isdirectory(v:val)') 94 | endfunction "}}}1 95 | 96 | " Prepend all subdirectories of path to the rtp, and append all after 97 | " directories in those subdirectories. 98 | function! pathogen#runtime_prepend_subdirectories(path) " {{{1 99 | let sep = pathogen#separator() 100 | let before = pathogen#glob_directories(a:path.sep."*[^~]") 101 | let after = pathogen#glob_directories(a:path.sep."*[^~]".sep."after") 102 | let rtp = pathogen#split(&rtp) 103 | let path = expand(a:path) 104 | call filter(rtp,'v:val[0:strlen(path)-1] !=# path') 105 | let &rtp = pathogen#join(pathogen#uniq(before + rtp + after)) 106 | return &rtp 107 | endfunction " }}}1 108 | 109 | " For each directory in rtp, check for a subdirectory named dir. If it 110 | " exists, add all subdirectories of that subdirectory to the rtp, immediately 111 | " after the original directory. If no argument is given, 'bundle' is used. 112 | " Repeated calls with the same arguments are ignored. 113 | function! pathogen#runtime_append_all_bundles(...) " {{{1 114 | let sep = pathogen#separator() 115 | let name = a:0 ? a:1 : 'bundle' 116 | let list = [] 117 | for dir in pathogen#split(&rtp) 118 | if dir =~# '\ 4 | " URL: http://plasticboy.com/markdown-vim-mode/ 5 | " Version: 9 6 | " Last Change: 2009 May 18 7 | " Remark: Uses HTML syntax file 8 | " Remark: I don't do anything with angle brackets (<>) because that would too easily 9 | " easily conflict with HTML syntax 10 | " TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) 11 | 12 | 13 | " Read the HTML syntax to start with 14 | if version < 600 15 | so :p:h/html.vim 16 | else 17 | runtime! syntax/html.vim 18 | unlet b:current_syntax 19 | endif 20 | 21 | if version < 600 22 | syntax clear 23 | elseif exists("b:current_syntax") 24 | finish 25 | endif 26 | 27 | " don't use standard HiLink, it will not work with included syntax files 28 | if version < 508 29 | command! -nargs=+ HtmlHiLink hi link 30 | else 31 | command! -nargs=+ HtmlHiLink hi def link 32 | endif 33 | 34 | syn spell toplevel 35 | syn case ignore 36 | syn sync linebreaks=1 37 | 38 | "additions to HTML groups 39 | syn region htmlBold start=/\\\@) 51 | syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite 52 | syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline 53 | syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained 54 | syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained 55 | syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained 56 | 57 | "define Markdown groups 58 | syn match mkdLineContinue ".$" contained 59 | syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ 60 | syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ 61 | syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ 62 | syn match mkdRule /^\s*-\{3,}$/ 63 | syn match mkdRule /^\s*\*\{3,5}$/ 64 | syn match mkdListItem "^\s*[-*+]\s\+" 65 | syn match mkdListItem "^\s*\d\+\.\s\+" 66 | syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ 67 | syn match mkdLineBreak / \+$/ 68 | syn region mkdCode start=/\\\@/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell 71 | syn region mkdCode start="]*>" end="" 72 | syn region mkdCode start="]*>" end="" 73 | 74 | "HTML headings 75 | syn region htmlH1 start="^\s*#" end="\($\|#\+\)" contains=@Spell 76 | syn region htmlH2 start="^\s*##" end="\($\|#\+\)" contains=@Spell 77 | syn region htmlH3 start="^\s*###" end="\($\|#\+\)" contains=@Spell 78 | syn region htmlH4 start="^\s*####" end="\($\|#\+\)" contains=@Spell 79 | syn region htmlH5 start="^\s*#####" end="\($\|#\+\)" contains=@Spell 80 | syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contains=@Spell 81 | syn match htmlH1 /^.\+\n=\+$/ contains=@Spell 82 | syn match htmlH2 /^.\+\n-\+$/ contains=@Spell 83 | 84 | "highlighting for Markdown groups 85 | HtmlHiLink mkdString String 86 | HtmlHiLink mkdCode String 87 | HtmlHiLink mkdBlockquote Comment 88 | HtmlHiLink mkdLineContinue Comment 89 | HtmlHiLink mkdListItem Identifier 90 | HtmlHiLink mkdRule Identifier 91 | HtmlHiLink mkdLineBreak Todo 92 | HtmlHiLink mkdLink htmlLink 93 | HtmlHiLink mkdURL htmlString 94 | HtmlHiLink mkdID Identifier 95 | HtmlHiLink mkdLinkDef mkdID 96 | HtmlHiLink mkdLinkDefTarget mkdURL 97 | HtmlHiLink mkdLinkTitle htmlString 98 | 99 | HtmlHiLink mkdDelimiter Delimiter 100 | 101 | let b:current_syntax = "mkd" 102 | 103 | delcommand HtmlHiLink 104 | " vim: ts=8 105 | -------------------------------------------------------------------------------- /.vim/syntax/sass.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Sass 3 | " Maintainer: Tim Pope 4 | " Filenames: *.sass 5 | " Last Change: 2010 Aug 09 6 | 7 | if exists("b:current_syntax") 8 | finish 9 | endif 10 | 11 | runtime! syntax/css.vim 12 | 13 | syn case ignore 14 | 15 | syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp 16 | syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp 17 | 18 | syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP 19 | 20 | syn match sassProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=sassCssAttribute contained containedin=sassDefinition 21 | syn match sassProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+:\|:[[:alnum:]-]\+\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute 22 | syn match sassProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=css.*Prop skipwhite nextgroup=sassCssAttribute 23 | syn match sassCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@sassCssAttributes,sassVariable,sassFunction,sassInterpolation 24 | syn match sassDefault "!default\>" contained 25 | syn match sassVariable "!\%(important\>\|default\>\)\@![[:alnum:]_-]\+" 26 | syn match sassVariable "$[[:alnum:]_-]\+" 27 | syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=\%(||\)\==" nextgroup=sassCssAttribute skipwhite 28 | syn match sassVariableAssignment "\%([!$][[:alnum:]_-]\+\s*\)\@<=:" nextgroup=sassCssAttribute skipwhite 29 | 30 | syn match sassFunction "\<\%(rgb\|rgba\|red\|green\|blue\|mix\)\>(\@=" contained 31 | syn match sassFunction "\<\%(hsl\|hsla\|hue\|saturation\|lightness\|adjust-hue\|lighten\|darken\|saturate\|desaturate\|grayscale\|complement\)\>(\@=" contained 32 | syn match sassFunction "\<\%(alpha\|opacity\|rgba\|opacify\|fade-in\|transparentize\|fade-out\)\>(\@=" contained 33 | syn match sassFunction "\<\%(unquote\|quote\)\>(\@=" contained 34 | syn match sassFunction "\<\%(percentage\|round\|ceil\|floor\|abs\)\>(\@=" contained 35 | syn match sassFunction "\<\%(type-of\|unit\|unitless\|comparable\)\>(\@=" contained 36 | 37 | syn region sassInterpolation matchgroup=sassInterpolationDelimiter start="#{" end="}" contains=@sassCssAttributes,sassVariable,sassFunction containedin=cssStringQ,cssStringQQ,sassProperty 38 | 39 | syn match sassMixinName "[[:alnum:]_-]\+" contained nextgroup=sassCssAttribute 40 | syn match sassMixin "^=" nextgroup=sassMixinName 41 | syn match sassMixin "\%([{};]\s*\|^\s*\)\@<=@mixin" nextgroup=sassMixinName skipwhite 42 | syn match sassMixing "^\s\+\zs+" nextgroup=sassMixinName 43 | syn match sassMixing "\%([{};]\s*\|^\s*\)\@<=@include" nextgroup=sassMixinName skipwhite 44 | syn match sassExtend "\%([{};]\s*\|^\s*\)\@<=@extend" 45 | 46 | syn match sassEscape "^\s*\zs\\" 47 | syn match sassIdChar "#[[:alnum:]_-]\@=" nextgroup=sassId 48 | syn match sassId "[[:alnum:]_-]\+" contained 49 | syn match sassClassChar "\.[[:alnum:]_-]\@=" nextgroup=sassClass 50 | syn match sassClass "[[:alnum:]_-]\+" contained 51 | syn match sassAmpersand "&" 52 | 53 | " TODO: Attribute namespaces 54 | " TODO: Arithmetic (including strings and concatenation) 55 | 56 | syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssURL,cssUnicodeEscape,cssMediaType 57 | syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction 58 | syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction 59 | syn region sassControlLine matchgroup=sassControl start="@\%(if\|else\%(\s\+if\)\=\|while\|for\)\>" end="[{};]\@=\|$" contains=sassFor,@sassCssAttributes,sassVariable,sassFunction 60 | syn keyword sassFor from to through contained 61 | 62 | syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained 63 | syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell 64 | syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell 65 | 66 | hi def link sassCssComment sassComment 67 | hi def link sassComment Comment 68 | hi def link sassDefault cssImportant 69 | hi def link sassVariable Identifier 70 | hi def link sassFunction Function 71 | hi def link sassMixing PreProc 72 | hi def link sassMixin PreProc 73 | hi def link sassExtend PreProc 74 | hi def link sassTodo Todo 75 | hi def link sassInclude Include 76 | hi def link sassDebug sassControl 77 | hi def link sassWarn sassControl 78 | hi def link sassControl PreProc 79 | hi def link sassFor PreProc 80 | hi def link sassEscape Special 81 | hi def link sassIdChar Special 82 | hi def link sassClassChar Special 83 | hi def link sassInterpolationDelimiter Delimiter 84 | hi def link sassAmpersand Character 85 | hi def link sassId Identifier 86 | hi def link sassClass Type 87 | 88 | let b:current_syntax = "sass" 89 | 90 | " vim:set sw=2: 91 | -------------------------------------------------------------------------------- /.vim/colors/autumnleaf.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Maintainer: Anders Korte 3 | " Last Change: 17 Oct 2004 4 | 5 | " AutumnLeaf color scheme 1.0 6 | 7 | set background=light 8 | 9 | hi clear 10 | 11 | if exists("syntax_on") 12 | syntax reset 13 | endif 14 | 15 | let colors_name="AutumnLeaf" 16 | 17 | 18 | " Colors for the User Interface. 19 | 20 | hi Cursor guibg=#aa7733 guifg=#ffeebb gui=bold 21 | hi Normal guibg=#fffdfa guifg=black gui=none 22 | hi NonText guibg=#eafaea guifg=#000099 gui=bold 23 | hi Visual guibg=#fff8cc guifg=black gui=none 24 | " hi VisualNOS 25 | 26 | hi Linenr guibg=bg guifg=#999999 gui=none 27 | 28 | " Uncomment these if you use Diff...?? 29 | " hi DiffText guibg=#cc0000 guifg=white gui=none 30 | " hi DiffAdd guibg=#0000cc guifg=white gui=none 31 | " hi DiffChange guibg=#990099 guifg=white gui=none 32 | " hi DiffDelete guibg=#888888 guifg=#333333 gui=none 33 | 34 | hi Directory guibg=bg guifg=#337700 gui=none 35 | 36 | hi IncSearch guibg=#c8e8ff guifg=black gui=none 37 | hi Search guibg=#c8e8ff guifg=black gui=none 38 | hi SpecialKey guibg=bg guifg=fg gui=none 39 | hi Titled guibg=bg guifg=fg gui=none 40 | 41 | hi ErrorMsg guibg=bg guifg=#cc0000 gui=bold 42 | hi ModeMsg guibg=bg guifg=#003399 gui=none 43 | hi link MoreMsg ModeMsg 44 | hi link Question ModeMsg 45 | hi WarningMsg guibg=bg guifg=#cc0000 gui=bold 46 | 47 | hi StatusLine guibg=#ffeebb guifg=black gui=bold 48 | hi StatusLineNC guibg=#aa8866 guifg=#f8e8cc gui=none 49 | hi VertSplit guibg=#aa8866 guifg=#ffe0bb gui=none 50 | 51 | " hi Folded 52 | " hi FoldColumn 53 | " hi SignColumn 54 | 55 | 56 | " Colors for Syntax Highlighting. 57 | 58 | hi Comment guibg=#ddeedd guifg=#002200 gui=none 59 | 60 | hi Constant guibg=bg guifg=#003399 gui=bold 61 | hi String guibg=bg guifg=#003399 gui=italic 62 | hi Character guibg=bg guifg=#003399 gui=italic 63 | hi Number guibg=bg guifg=#003399 gui=bold 64 | hi Boolean guibg=bg guifg=#003399 gui=bold 65 | hi Float guibg=bg guifg=#003399 gui=bold 66 | 67 | hi Identifier guibg=bg guifg=#003399 gui=none 68 | hi Function guibg=bg guifg=#0055aa gui=bold 69 | hi Statement guibg=bg guifg=#003399 gui=none 70 | 71 | hi Conditional guibg=bg guifg=#aa7733 gui=bold 72 | hi Repeat guibg=bg guifg=#aa5544 gui=bold 73 | hi link Label Conditional 74 | hi Operator guibg=bg guifg=#aa7733 gui=bold 75 | hi link Keyword Statement 76 | hi Exception guibg=bg guifg=#228877 gui=bold 77 | 78 | hi PreProc guibg=bg guifg=#aa7733 gui=bold 79 | hi Include guibg=bg guifg=#558811 gui=bold 80 | hi link Define Include 81 | hi link Macro Include 82 | hi link PreCondit Include 83 | 84 | hi Type guibg=bg guifg=#007700 gui=bold 85 | hi link StorageClass Type 86 | hi link Structure Type 87 | hi Typedef guibg=bg guifg=#009900 gui=italic 88 | 89 | hi Special guibg=bg guifg=fg gui=none 90 | hi SpecialChar guibg=bg guifg=fg gui=bold 91 | hi Tag guibg=bg guifg=#003399 gui=bold 92 | hi link Delimiter Special 93 | hi SpecialComment guibg=#dddddd guifg=#aa0000 gui=none 94 | hi link Debug Special 95 | 96 | hi Underlined guibg=bg guifg=blue gui=underline 97 | 98 | hi Title guibg=bg guifg=fg gui=bold 99 | hi Ignore guibg=bg guifg=#999999 gui=none 100 | hi Error guibg=red guifg=white gui=none 101 | hi Todo guibg=bg guifg=#aa0000 gui=none 102 | 103 | 104 | 105 | " The same in cterm colors. 106 | hi Cursor ctermbg=6 ctermfg=14 107 | hi Normal ctermbg=15 ctermfg=0 108 | hi NonText ctermbg=10 ctermfg=1 109 | hi Visual ctermbg=14 ctermfg=0 110 | " hi VisualNOS 111 | hi Linenr ctermbg=bg ctermfg=7 112 | " hi DiffText ctermbg=4 ctermfg=15 113 | " hi DiffAdd ctermbg=1 ctermfg=15 114 | " hi DiffChange ctermbg=5 ctermfg=15 115 | " hi DiffDelete ctermbg=7 ctermfg=8 116 | hi Directory ctermbg=bg ctermfg=2 117 | hi IncSearch ctermbg=9 ctermfg=0 118 | hi Search ctermbg=9 ctermfg=0 119 | hi SpecialKey ctermbg=bg ctermfg=fg 120 | hi Titled ctermbg=bg ctermfg=fg 121 | hi ErrorMsg ctermbg=bg ctermfg=12 122 | hi ModeMsg ctermbg=bg ctermfg=9 123 | hi WarningMsg ctermbg=bg ctermfg=12 124 | hi StatusLine ctermbg=14 ctermfg=0 125 | hi StatusLineNC ctermbg=6 ctermfg=14 126 | hi VertSplit ctermbg=6 ctermfg=14 127 | " hi Folded 128 | " hi FoldColumn 129 | " hi SignColumn 130 | hi Comment ctermbg=10 ctermfg=2 131 | hi Constant ctermbg=bg ctermfg=9 132 | hi String ctermbg=bg ctermfg=9 cterm=italic 133 | hi Character ctermbg=bg ctermfg=9 cterm=italic 134 | hi Number ctermbg=bg ctermfg=9 cterm=bold 135 | hi Boolean ctermbg=bg ctermfg=9 cterm=bold 136 | hi Float ctermbg=bg ctermfg=9 cterm=bold 137 | hi Function ctermbg=bg ctermfg=9 cterm=bold 138 | hi Statement ctermbg=bg ctermfg=9 cterm=bold 139 | hi Conditional ctermbg=bg ctermfg=6 cterm=bold 140 | hi Repeat ctermbg=bg ctermfg=6 cterm=bold 141 | hi Operator ctermbg=bg ctermfg=6 cterm=bold 142 | hi Exception ctermbg=bg ctermfg=2 cterm=bold 143 | hi PreProc ctermbg=bg ctermfg=6 144 | hi Include ctermbg=bg ctermfg=2 cterm=bold 145 | hi Type ctermbg=bg ctermfg=2 cterm=bold 146 | hi Typedef ctermbg=bg ctermfg=2 cterm=italic 147 | hi Special ctermbg=bg ctermfg=fg cterm=bold 148 | hi Tag ctermbg=bg ctermfg=9 cterm=bold 149 | hi SpecialComment ctermbg=7 ctermfg=4 150 | hi Underlined ctermbg=bg ctermfg=9 cterm=underline 151 | hi Title ctermbg=bg ctermfg=fg cterm=bold 152 | hi Ignore ctermbg=bg ctermfg=7 153 | hi Error ctermbg=12 ctermfg=15 154 | hi Todo ctermbg=bg ctermfg=15 155 | -------------------------------------------------------------------------------- /.zsh/func/zgitinit: -------------------------------------------------------------------------------- 1 | ## 2 | ## Load with `autoload -U zgitinit; zgitinit' 3 | ## 4 | 5 | typeset -gA zgit_info 6 | zgit_info=() 7 | 8 | zgit_chpwd_hook() { 9 | zgit_info_update 10 | } 11 | 12 | zgit_preexec_hook() { 13 | if [[ $2 == git\ * ]] || [[ $2 == *\ git\ * ]]; then 14 | zgit_precmd_do_update=1 15 | fi 16 | } 17 | 18 | zgit_precmd_hook() { 19 | if [ $zgit_precmd_do_update ]; then 20 | unset zgit_precmd_do_update 21 | zgit_info_update 22 | fi 23 | } 24 | 25 | zgit_info_update() { 26 | zgit_info=() 27 | 28 | local gitdir="$(git rev-parse --git-dir 2>/dev/null)" 29 | if [ $? -ne 0 ] || [ -z "$gitdir" ]; then 30 | return 31 | fi 32 | 33 | zgit_info[dir]=$gitdir 34 | zgit_info[bare]=$(git rev-parse --is-bare-repository) 35 | zgit_info[inwork]=$(git rev-parse --is-inside-work-tree) 36 | } 37 | 38 | zgit_isgit() { 39 | if [ -z "$zgit_info[dir]" ]; then 40 | return 1 41 | else 42 | return 0 43 | fi 44 | } 45 | 46 | zgit_inworktree() { 47 | zgit_isgit || return 48 | if [ "$zgit_info[inwork]" = "true" ]; then 49 | return 0 50 | else 51 | return 1 52 | fi 53 | } 54 | 55 | zgit_isbare() { 56 | zgit_isgit || return 57 | if [ "$zgit_info[bare]" = "true" ]; then 58 | return 0 59 | else 60 | return 1 61 | fi 62 | } 63 | 64 | zgit_head() { 65 | zgit_isgit || return 1 66 | 67 | if [ -z "$zgit_info[head]" ]; then 68 | local name='' 69 | name=$(git symbolic-ref -q HEAD) 70 | if [ $? -eq 0 ]; then 71 | if [[ $name == refs/(heads|tags)/* ]]; then 72 | name=${name#refs/(heads|tags)/} 73 | fi 74 | else 75 | name=$(git name-rev --name-only --no-undefined --always HEAD) 76 | if [ $? -ne 0 ]; then 77 | return 1 78 | elif [[ $name == remotes/* ]]; then 79 | name=${name#remotes/} 80 | fi 81 | fi 82 | zgit_info[head]=$name 83 | fi 84 | 85 | echo $zgit_info[head] 86 | } 87 | 88 | zgit_branch() { 89 | zgit_isgit || return 1 90 | zgit_isbare && return 1 91 | 92 | if [ -z "$zgit_info[branch]" ]; then 93 | local branch=$(git symbolic-ref HEAD 2>/dev/null) 94 | if [ $? -eq 0 ]; then 95 | branch=${branch##*/} 96 | else 97 | branch=$(git name-rev --name-only --always HEAD) 98 | fi 99 | zgit_info[branch]=$branch 100 | fi 101 | 102 | echo $zgit_info[branch] 103 | return 0 104 | } 105 | 106 | zgit_tracking_remote() { 107 | zgit_isgit || return 1 108 | zgit_isbare && return 1 109 | 110 | local branch 111 | if [ -n "$1" ]; then 112 | branch=$1 113 | elif [ -z "$zgit_info[branch]" ]; then 114 | branch=$(zgit_branch) 115 | [ $? -ne 0 ] && return 1 116 | else 117 | branch=$zgit_info[branch] 118 | fi 119 | 120 | local k="tracking_$branch" 121 | local remote 122 | if [ -z "$zgit_info[$k]" ]; then 123 | remote=$(git config branch.$branch.remote) 124 | zgit_info[$k]=$remote 125 | fi 126 | 127 | echo $zgit_info[$k] 128 | return 0 129 | } 130 | 131 | zgit_tracking_merge() { 132 | zgit_isgit || return 1 133 | zgit_isbare && return 1 134 | 135 | local branch 136 | if [ -z "$zgit_info[branch]" ]; then 137 | branch=$(zgit_branch) 138 | [ $? -ne 0 ] && return 1 139 | else 140 | branch=$zgit_info[branch] 141 | fi 142 | 143 | local remote=$(zgit_tracking_remote $branch) 144 | [ $? -ne 0 ] && return 1 145 | if [ -n "$remote" ]; then # tracking branch 146 | local merge=$(git config branch.$branch.merge) 147 | if [ $remote != "." ]; then 148 | merge=$remote/$(basename $merge) 149 | fi 150 | echo $merge 151 | return 0 152 | else 153 | return 1 154 | fi 155 | } 156 | 157 | zgit_isindexclean() { 158 | zgit_isgit || return 1 159 | if git diff --quiet --cached 2>/dev/null; then 160 | return 0 161 | else 162 | return 1 163 | fi 164 | } 165 | 166 | zgit_isworktreeclean() { 167 | zgit_isgit || return 1 168 | if git diff --quiet 2>/dev/null; then 169 | return 0 170 | else 171 | return 1 172 | fi 173 | } 174 | 175 | zgit_hasuntracked() { 176 | zgit_isgit || return 1 177 | local -a flist 178 | flist=($(git ls-files --others --exclude-standard)) 179 | if [ $#flist -gt 0 ]; then 180 | return 0 181 | else 182 | return 1 183 | fi 184 | } 185 | 186 | zgit_hasunmerged() { 187 | zgit_isgit || return 1 188 | local -a flist 189 | flist=($(git ls-files -u)) 190 | if [ $#flist -gt 0 ]; then 191 | return 0 192 | else 193 | return 1 194 | fi 195 | } 196 | 197 | zgit_svnhead() { 198 | zgit_isgit || return 1 199 | 200 | local commit=$1 201 | if [ -z "$commit" ]; then 202 | commit='HEAD' 203 | fi 204 | 205 | git show --raw $commit | \ 206 | grep git-svn-id | \ 207 | sed -re 's/^\s*git-svn-id: .*@([0-9]+).*$/\1/' 208 | } 209 | 210 | zgit_rebaseinfo() { 211 | zgit_isgit || return 1 212 | if [ -d $zgit_info[dir]/rebase-merge ]; then 213 | dotest=$zgit_info[dir]/rebase-merge 214 | elif [ -d $zgit_info[dir]/.dotest-merge ]; then 215 | dotest=$zgit_info[dir]/.dotest-merge 216 | elif [ -d .dotest ]; then 217 | dotest=.dotest 218 | else 219 | return 1 220 | fi 221 | 222 | zgit_info[dotest]=$dotest 223 | 224 | zgit_info[rb_onto]=$(cat "$dotest/onto") 225 | zgit_info[rb_upstream]=$(cat "$dotest/upstream") 226 | if [ -f "$dotest/orig-head" ]; then 227 | zgit_info[rb_head]=$(cat "$dotest/orig-head") 228 | elif [ -f "$dotest/head" ]; then 229 | zgit_info[rb_head]=$(cat "$dotest/head") 230 | fi 231 | zgit_info[rb_head_name]=$(cat "$dotest/head-name") 232 | 233 | return 0 234 | } 235 | 236 | zgitinit() { 237 | typeset -ga chpwd_functions 238 | typeset -ga preexec_functions 239 | typeset -ga precmd_functions 240 | chpwd_functions+='zgit_chpwd_hook' 241 | preexec_functions+='zgit_preexec_hook' 242 | precmd_functions+='zgit_precmd_hook' 243 | } 244 | 245 | zgitinit 246 | zgit_info_update 247 | 248 | # vim:set ft=zsh: 249 | -------------------------------------------------------------------------------- /.emacs-lisp/mmm-utils.el: -------------------------------------------------------------------------------- 1 | ;;; mmm-utils.el --- Coding Utilities for MMM Mode 2 | 3 | ;; Copyright (C) 2000 by Michael Abraham Shulman 4 | 5 | ;; Author: Michael Abraham Shulman 6 | ;; Version: $Id: mmm-utils.el,v 1.14 2003/03/09 17:04:04 viritrilbia Exp $ 7 | 8 | ;;{{{ GPL 9 | 10 | ;; This file is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation; either version 2, or (at your option) 13 | ;; any later version. 14 | 15 | ;; This file is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to 22 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | ;; Boston, MA 02111-1307, USA. 24 | 25 | ;;}}} 26 | 27 | ;;; Commentary: 28 | 29 | ;; This file provides a number of macros and other coding utilities 30 | ;; for MMM Mode. 31 | 32 | ;;; Code: 33 | 34 | (require 'cl) 35 | 36 | ;;{{{ Valid Buffer 37 | 38 | ;; We used to wrap almost everything in this, but I realized that 39 | ;; only `mmm-mode-on' really needs it. Kept it as a macro, though, 40 | ;; for modularity and in case we need it somewhere else. 41 | (defmacro mmm-valid-buffer (&rest body) 42 | "Execute BODY if in a valid buffer for MMM Mode to be enabled. This 43 | means not hidden, not a minibuffer, not in batch mode, and not in of 44 | `mmm-never-modes'." 45 | `(unless (or (eq (aref (buffer-name) 0) ?\ ) 46 | (window-minibuffer-p (selected-window)) 47 | (memq major-mode mmm-never-modes) 48 | noninteractive 49 | ;; Unnecessary as now hidden 50 | ;;; (equal (buffer-name) mmm-temp-buffer-name) 51 | ) 52 | ,@body)) 53 | 54 | ;;;(def-edebug-spec mmm-valid-buffer t) 55 | 56 | ;;}}} 57 | ;;{{{ Save Everything 58 | 59 | ;; Never trust callback functions to preserve anything. 60 | (defmacro mmm-save-all (&rest body) 61 | "Execute BODY forms, then restoring point, mark, current buffer, 62 | restrictions, and match data." 63 | `(save-excursion 64 | (save-restriction 65 | (save-match-data 66 | ,@body)))) 67 | 68 | ;;;(def-edebug-spec mmm-save-all t) 69 | 70 | ;;}}} 71 | ;;{{{ String Formatting 72 | 73 | (defun mmm-format-string (string arg-pairs) 74 | "Format STRING by replacing arguments as specified by ARG-PAIRS. 75 | Each element of ARG-PAIRS is \(REGEXP . STR) where each STR is to be 76 | substituted for the corresponding REGEXP wherever it matches." 77 | (let ((case-fold-search nil)) 78 | (save-match-data 79 | (dolist (pair arg-pairs) 80 | (while (string-match (car pair) string) 81 | (setq string (replace-match (cdr pair) t t string)))))) 82 | string) 83 | 84 | (defun mmm-format-matches (string &optional on-string) 85 | "Format STRING by matches from the current match data. 86 | Strings like ~N are replaced by the Nth subexpression from the last 87 | global match. Does nothing if STRING is not a string. 88 | 89 | ON-STRING, if supplied, means to use the match data from a 90 | `string-match' on that string, rather than the global match data." 91 | (when (stringp string) 92 | (let ((old-data (match-data)) 93 | subexp) 94 | (save-match-data 95 | (while (string-match "~\\([0-9]\\)" string) 96 | (setq subexp (string-to-int (match-string-no-properties 1 string)) 97 | string (replace-match 98 | (save-match-data 99 | (set-match-data old-data) 100 | (match-string-no-properties subexp on-string)) 101 | t t string)))))) 102 | string) 103 | 104 | ;;}}} 105 | ;;{{{ Save Keywords 106 | 107 | (defmacro mmm-save-keyword (param) 108 | "If the value of PARAM as a variable is non-nil, return the list 109 | \(:PARAM (symbol-value PARAM)), otherwise NIL. Best used only when it 110 | is important that nil values disappear." 111 | `(if (and (boundp ',param) ,param) 112 | (list (intern (concat ":" (symbol-name ',param))) ,param) 113 | nil)) 114 | 115 | (defmacro mmm-save-keywords (&rest params) 116 | "Return a list saving the non-nil elements of PARAMS. E.g. 117 | \(let \(\(a 1) \(c 2)) \(mmm-save-keywords a b c)) ==> \(:a 1 :c 2) 118 | Use of this macro can make code more readable when there are a lot of 119 | PARAMS, but less readable when there are only a few. Also best used 120 | only when it is important that nil values disappear." 121 | `(append ,@(mapcar #'(lambda (param) 122 | (macroexpand `(mmm-save-keyword ,param))) 123 | params))) 124 | 125 | ;;}}} 126 | ;;{{{ Looking Back At 127 | 128 | (defun mmm-looking-back-at (regexp &optional bound) 129 | "Return t if text before point matches REGEXP. 130 | Modifies the match data. If supplied, BOUND means not to look farther 131 | back that that many characters before point. Otherwise, it defaults to 132 | \(length REGEXP), which is good enough when REGEXP is a simple 133 | string." 134 | (eq (point) 135 | (save-excursion 136 | (and (re-search-backward regexp 137 | (- (point) (or bound (length regexp))) 138 | t) 139 | (match-end 0))))) 140 | 141 | ;;}}} 142 | ;;{{{ Markers 143 | 144 | ;; Mostly for remembering interactively made regions 145 | (defun mmm-make-marker (pos beg-p sticky-p) 146 | "Make, and return, a marker at POS that is or isn't sticky. 147 | BEG-P represents whether the marker delimits the beginning of a 148 | region \(or the end of it). STICKY-P is whether it should be sticky, 149 | i.e. whether text inserted at the marker should be inside the region." 150 | (let ((mkr (set-marker (make-marker) pos))) 151 | (set-marker-insertion-type mkr (if beg-p (not sticky-p) sticky-p)) 152 | mkr)) 153 | 154 | ;;}}} 155 | 156 | (provide 'mmm-utils) 157 | 158 | ;;; mmm-utils.el ends here -------------------------------------------------------------------------------- /.emacs-lisp/mmm-mason.el: -------------------------------------------------------------------------------- 1 | ;;; mmm-mason.el --- MMM submode class for Mason components 2 | 3 | ;; Copyright (C) 2000 by Michael Abraham Shulman 4 | 5 | ;; Author: Michael Abraham Shulman 6 | ;; Version: $Id: mmm-mason.el,v 1.13 2003/03/09 17:04:03 viritrilbia Exp $ 7 | 8 | ;;{{{ GPL 9 | 10 | ;; This file is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation; either version 2, or (at your option) 13 | ;; any later version. 14 | 15 | ;; This file is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to 22 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | ;; Boston, MA 02111-1307, USA. 24 | 25 | ;;}}} 26 | 27 | ;;; Commentary: 28 | 29 | ;; This file contains the definition of an MMM Mode submode class for 30 | ;; editing Mason components. See the file README.Mason for more 31 | ;; details. 32 | 33 | ;;; Code: 34 | 35 | (require 'mmm-compat) 36 | (require 'mmm-vars) 37 | (require 'mmm-auto) 38 | 39 | ;;{{{ Perl Tags 40 | 41 | (defvar mmm-mason-perl-tags 42 | '("perl" "init" "cleanup" "once" "filter" "shared" 43 | "perl_init" "perl_cleanup" "perl_once" "perl_filter")) 44 | 45 | (defvar mmm-mason-pseudo-perl-tags 46 | '("args" "perl_args" "attr" "flags")) 47 | 48 | (defvar mmm-mason-non-perl-tags 49 | '("doc" "perl_doc" "text" "perl_text" "def" "perl_def" "method")) 50 | 51 | (defvar mmm-mason-perl-tags-regexp 52 | (concat "<%" (mmm-regexp-opt mmm-mason-perl-tags t) ">") 53 | "Matches tags beginning Mason sections containing Perl code. 54 | Saves the name of the tag matched.") 55 | 56 | (defvar mmm-mason-pseudo-perl-tags-regexp 57 | (concat "<%" (mmm-regexp-opt mmm-mason-pseudo-perl-tags t) ">") 58 | "Match tags beginning Mason sections that look like Perl but aren't. 59 | Saves the name of the tag matched.") 60 | 61 | (defvar mmm-mason-tag-names-regexp 62 | (regexp-opt (append mmm-mason-perl-tags mmm-mason-non-perl-tags) t) 63 | "Matches any Mason tag name after the \"<%\". Used to verify that a 64 | \"<%\" sequence starts an inline section.") 65 | 66 | (defun mmm-mason-verify-inline () 67 | (not (looking-at mmm-mason-tag-names-regexp))) 68 | 69 | ;;}}} 70 | ;;{{{ Add Classes 71 | 72 | (mmm-add-group 73 | 'mason 74 | `((mason-text 75 | :submode nil 76 | :front "<%text>" 77 | :back "" 78 | :insert ((?t mason-<%text> nil @ "<%text>" @ "\n" 79 | _ "\n" @ "" @))) 80 | (mason-doc 81 | :submode text-mode 82 | :face mmm-comment-submode-face 83 | :front "<%doc>" 84 | :back "" 85 | :face nil 86 | :insert ((?d mason-<%doc> nil @ "<%doc>" @ "\n" 87 | _ "\n" @ "" @))) 88 | (mason-perl 89 | :submode perl 90 | :match-face (("<%perl>" . mmm-code-submode-face) 91 | ("<%init>" . mmm-init-submode-face) 92 | ("<%cleanup>" . mmm-cleanup-submode-face) 93 | ("<%once>" . mmm-init-submode-face) 94 | ("<%filter>" . mmm-special-submode-face) 95 | ("<%shared>" . mmm-init-submode-face)) 96 | :front ,mmm-mason-perl-tags-regexp 97 | :back "" 98 | :save-matches 1 99 | :match-name "~1" 100 | :save-name 1 101 | :insert ((?, mason-<%TAG> "Perl section: " @ "<%" str ">" @ 102 | ";\n" _ "\n" @ "" @) 103 | (?< mason-<%TAG> ?, . nil) 104 | (?p mason-<%perl> ?, . "perl") 105 | (?i mason-<%init> ?, . "init") 106 | (?c mason-<%cleanup> ?, . "cleanup") 107 | (?o mason-<%once> ?, . "once") 108 | (?l mason-<%filter> ?, . "filter") 109 | (?s mason-<%shared> ?, . "shared"))) 110 | (mason-pseudo-perl 111 | :submode perl 112 | :face mmm-declaration-submode-face 113 | :front ,mmm-mason-pseudo-perl-tags-regexp 114 | :back "" 115 | :save-matches 1 116 | :insert ((?. mason-pseudo-<%TAG> "Pseudo-perl section: " @ "<%" str ">" @ 117 | "\n" _ "\n" @ "" @) 118 | (?> mason-pseudo-<%TAG> ?, . nil) 119 | (?a mason-<%args> ?. . "args") 120 | (?f mason-<%flags> ?. . "flags") 121 | (?r mason-<%attr> ?. . "attr"))) 122 | (mason-inline 123 | :submode perl 124 | :face mmm-output-submode-face 125 | :front "<%" 126 | :front-verify mmm-mason-verify-inline 127 | :back "%>" 128 | :insert ((?% mason-<%-%> nil @ "<%" @ " " _ " " @ "%>" @) 129 | (?5 mason-<%-%> ?% . nil))) 130 | (mason-call 131 | :submode perl 132 | :face mmm-special-submode-face 133 | :front "<&" 134 | :back "&>" 135 | :insert ((?& mason-<&-&> nil @ "<&" @ " " _ " " @ "&>" @) 136 | (?7 mason-<&-&> ?% . nil))) 137 | (mason-one-line-comment 138 | :submode text-mode 139 | :face mmm-comment-submode-face 140 | :front "^%#" 141 | :back "\n" 142 | :insert ((?# mason-%-comment nil (mmm-mason-start-line) 143 | @ "%" @ "# " _ @ '(mmm-mason-end-line) "\n" @) 144 | (?3 mason-%-comment ?# . nil))) 145 | (mason-one-line 146 | :submode perl 147 | :face mmm-code-submode-face 148 | :front "^%" 149 | :back "\n" 150 | :insert ((return mason-%-line nil (mmm-mason-start-line) 151 | @ "%" @ " " _ @ '(mmm-mason-end-line) "\n" @))))) 152 | 153 | ;;}}} 154 | ;;{{{ One-line Sections 155 | 156 | (defun mmm-mason-start-line () 157 | (if (bolp) 158 | "" 159 | "\n")) 160 | 161 | (defun mmm-mason-end-line () 162 | (if (eolp) 163 | (delete-char 1))) 164 | 165 | ;;}}} 166 | ;;{{{ Set Mode Line 167 | 168 | (defun mmm-mason-set-mode-line () 169 | (setq mmm-buffer-mode-display-name "Mason")) 170 | (add-hook 'mmm-mason-class-hook 'mmm-mason-set-mode-line) 171 | 172 | ;;}}} 173 | 174 | (provide 'mmm-mason) 175 | 176 | ;;; mmm-mason.el ends here -------------------------------------------------------------------------------- /.vim/indent/python.vim: -------------------------------------------------------------------------------- 1 | " Python indent file 2 | " Language: Python 3 | " Maintainer: Eric Mc Sween 4 | " Original Author: David Bustos 5 | " Last Change: 2004 Jun 07 6 | 7 | " Only load this indent file when no other was loaded. 8 | if exists("b:did_indent") 9 | finish 10 | endif 11 | let b:did_indent = 1 12 | 13 | setlocal expandtab 14 | setlocal nolisp 15 | setlocal autoindent 16 | setlocal indentexpr=GetPythonIndent(v:lnum) 17 | setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except 18 | 19 | let s:maxoff = 50 20 | 21 | " Find backwards the closest open parenthesis/bracket/brace. 22 | function! s:SearchParensPair() 23 | let line = line('.') 24 | let col = col('.') 25 | 26 | " Skip strings and comments and don't look too far 27 | let skip = "line('.') < " . (line - s:maxoff) . " ? dummy :" . 28 | \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' . 29 | \ '"string\\|comment"' 30 | 31 | " Search for parentheses 32 | call cursor(line, col) 33 | let parlnum = searchpair('(', '', ')', 'bW', skip) 34 | let parcol = col('.') 35 | 36 | " Search for brackets 37 | call cursor(line, col) 38 | let par2lnum = searchpair('\[', '', '\]', 'bW', skip) 39 | let par2col = col('.') 40 | 41 | " Search for braces 42 | call cursor(line, col) 43 | let par3lnum = searchpair('{', '', '}', 'bW', skip) 44 | let par3col = col('.') 45 | 46 | " Get the closest match 47 | if par2lnum > parlnum || (par2lnum == parlnum && par2col > parcol) 48 | let parlnum = par2lnum 49 | let parcol = par2col 50 | endif 51 | if par3lnum > parlnum || (par3lnum == parlnum && par3col > parcol) 52 | let parlnum = par3lnum 53 | let parcol = par3col 54 | endif 55 | 56 | " Put the cursor on the match 57 | if parlnum > 0 58 | call cursor(parlnum, parcol) 59 | endif 60 | return parlnum 61 | endfunction 62 | 63 | " Find the start of a multi-line statement 64 | function! s:StatementStart(lnum) 65 | let lnum = a:lnum 66 | while 1 67 | if getline(lnum - 1) =~ '\\$' 68 | let lnum = lnum - 1 69 | else 70 | call cursor(lnum, 1) 71 | let maybe_lnum = s:SearchParensPair() 72 | if maybe_lnum < 1 73 | return lnum 74 | else 75 | let lnum = maybe_lnum 76 | endif 77 | endif 78 | endwhile 79 | endfunction 80 | 81 | " Find the block starter that matches the current line 82 | function! s:BlockStarter(lnum, block_start_re) 83 | let lnum = a:lnum 84 | let maxindent = 10000 " whatever 85 | while lnum > 1 86 | let lnum = prevnonblank(lnum - 1) 87 | if indent(lnum) < maxindent 88 | if getline(lnum) =~ a:block_start_re 89 | return lnum 90 | else 91 | let maxindent = indent(lnum) 92 | " It's not worth going further if we reached the top level 93 | if maxindent == 0 94 | return -1 95 | endif 96 | endif 97 | endif 98 | endwhile 99 | return -1 100 | endfunction 101 | 102 | function! GetPythonIndent(lnum) 103 | 104 | " First line has indent 0 105 | if a:lnum == 1 106 | return 0 107 | endif 108 | 109 | " If we can find an open parenthesis/bracket/brace, line up with it. 110 | call cursor(a:lnum, 1) 111 | let parlnum = s:SearchParensPair() 112 | if parlnum > 0 113 | let parcol = col('.') 114 | let closing_paren = match(getline(a:lnum), '^\s*[])}]') != -1 115 | if match(getline(parlnum), '[([{]\s*$', parcol - 1) != -1 116 | if closing_paren 117 | return indent(parlnum) 118 | else 119 | return indent(parlnum) + &shiftwidth 120 | endif 121 | else 122 | if closing_paren 123 | return parcol - 1 124 | else 125 | return parcol 126 | endif 127 | endif 128 | endif 129 | 130 | " Examine this line 131 | let thisline = getline(a:lnum) 132 | let thisindent = indent(a:lnum) 133 | 134 | " If the line starts with 'elif' or 'else', line up with 'if' or 'elif' 135 | if thisline =~ '^\s*\(elif\|else\)\>' 136 | let bslnum = s:BlockStarter(a:lnum, '^\s*\(if\|elif\)\>') 137 | if bslnum > 0 138 | return indent(bslnum) 139 | else 140 | return -1 141 | endif 142 | endif 143 | 144 | " If the line starts with 'except' or 'finally', line up with 'try' 145 | " or 'except' 146 | if thisline =~ '^\s*\(except\|finally\)\>' 147 | let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>') 148 | if bslnum > 0 149 | return indent(bslnum) 150 | else 151 | return -1 152 | endif 153 | endif 154 | 155 | " Examine previous line 156 | let plnum = a:lnum - 1 157 | let pline = getline(plnum) 158 | let sslnum = s:StatementStart(plnum) 159 | 160 | " If the previous line is blank, keep the same indentation 161 | if pline =~ '^\s*$' 162 | return -1 163 | endif 164 | 165 | " If this line is explicitly joined, try to find an indentation that looks 166 | " good. 167 | if pline =~ '\\$' 168 | let compound_statement = '^\s*\(if\|while\|for\s.*\sin\|except\)\s*' 169 | let maybe_indent = matchend(getline(sslnum), compound_statement) 170 | if maybe_indent != -1 171 | return maybe_indent 172 | else 173 | return indent(sslnum) + &sw * 2 174 | endif 175 | endif 176 | 177 | " If the previous line ended with a colon, indent relative to 178 | " statement start. 179 | if pline =~ ':\s*$' 180 | return indent(sslnum) + &sw 181 | endif 182 | 183 | " If the previous line was a stop-execution statement or a pass 184 | if getline(sslnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' 185 | " See if the user has already dedented 186 | if indent(a:lnum) > indent(sslnum) - &sw 187 | " If not, recommend one dedent 188 | return indent(sslnum) - &sw 189 | endif 190 | " Otherwise, trust the user 191 | return -1 192 | endif 193 | 194 | " In all other cases, line up with the start of the previous statement. 195 | return indent(sslnum) 196 | endfunction 197 | -------------------------------------------------------------------------------- /.emacs-lisp/mmm-compat.el: -------------------------------------------------------------------------------- 1 | ;;; mmm-compat.el --- MMM Hacks for compatibility with other Emacsen 2 | 3 | ;; Copyright (C) 2000 by Michael Abraham Shulman 4 | 5 | ;; Author: Michael Abraham Shulman 6 | ;; Version: $Id: mmm-compat.el,v 1.9 2003/03/09 17:04:03 viritrilbia Exp $ 7 | 8 | ;;{{{ GPL 9 | 10 | ;; This file is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation; either version 2, or (at your option) 13 | ;; any later version. 14 | 15 | ;; This file is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to 22 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | ;; Boston, MA 02111-1307, USA. 24 | 25 | ;;}}} 26 | 27 | ;;; Commentary: 28 | 29 | ;; This file provides a number of hacks that are necessary for MMM 30 | ;; Mode to function in different Emacsen. MMM Mode is designed for 31 | ;; FSF Emacs 20 and 21, but these hacks usually enable it to work 32 | ;; almost perfectly in Emacs 19 and XEmacs 20 or 21. 33 | 34 | ;;; Code: 35 | 36 | (require 'cl) 37 | 38 | ;;{{{ Emacsen Detection 39 | 40 | (defvar mmm-xemacs (featurep 'xemacs) 41 | "Whether we are running XEmacs.") 42 | 43 | ;;}}} 44 | ;;{{{ Keywords (Emacs 19) 45 | 46 | ;; Emacs 19 doesn't automatically set keyword variables to themselves. 47 | ;; We shouldn't have to do any more than these, since CL automatically 48 | ;; defines all keywords used for function arguments. 49 | (defvar mmm-keywords-used 50 | '(:group :regexp :region :function :insert :classes :private) 51 | "List of extra keywords used by MMM Mode.") 52 | 53 | (dolist (keyword mmm-keywords-used) 54 | (set keyword keyword)) 55 | 56 | ;;}}} 57 | ;;{{{ Customization (Emacs 19) 58 | 59 | (condition-case () 60 | (require 'custom) 61 | (error nil)) 62 | 63 | (unless (and (featurep 'custom) 64 | (fboundp 'custom-declare-variable)) 65 | (defmacro defgroup (&rest args) 66 | nil) 67 | (defmacro defface (var values doc &rest args) 68 | (` (make-face (quote (, var))))) 69 | (defmacro defcustom (var value doc &rest args) 70 | (` (defvar (, var) (, value) (, doc))))) 71 | 72 | ;;}}} 73 | ;;{{{ Regexp-Opt (Emacs 19) 74 | 75 | (condition-case () 76 | (require 'regexp-opt) 77 | (error nil)) 78 | 79 | (unless (and (featurep 'regexp-opt) 80 | (fboundp 'regexp-opt)) 81 | ;; No regexp-opt; create one 82 | (defun regexp-opt (strings &optional paren) 83 | (concat (if paren "\\(" "") 84 | (mapconcat 'regexp-quote strings "\\|") 85 | (if paren "\\)" "")))) 86 | 87 | ;;}}} 88 | ;;{{{ Regexp-Opt (XEmacs) 89 | 90 | (defmacro mmm-regexp-opt (strings paren) 91 | "Act like FSF Emacs' `regexp-opt', whichever Emacs we're in. 92 | XEmacs' `regexp-opt' requires an extra parameter to do grouping." 93 | (if (featurep 'xemacs) 94 | `(regexp-opt ,strings ,paren t) 95 | `(regexp-opt ,strings ,paren))) 96 | 97 | ;;}}} 98 | ;;{{{ Overlays (XEmacs) 99 | 100 | ;; The main thing we use from FSF Emacs that XEmacs doesn't support 101 | ;; are overlays. XEmacs uses extents instead, but comes with a package 102 | ;; to emulate overlays. 103 | (when mmm-xemacs 104 | ;; This does almost everything we need. 105 | (require 'overlay)) 106 | 107 | ;; We also use a couple "special" overlay properties which have 108 | ;; different names for XEmacs extents. 109 | (defvar mmm-evaporate-property 110 | (if (featurep 'xemacs) 'detachable 'evaporate) 111 | "The name of the overlay property controlling evaporation.") 112 | 113 | ;; We don't use this any more, since its behavior is different in FSF 114 | ;; and XEmacs: in the one it replaces the buffer's local map, but in 115 | ;; the other it gets stacked on top of it. Instead we just set the 116 | ;; buffer's local map temporarily. 117 | ;;;(defvar mmm-keymap-property 118 | ;;; (if (featurep 'xemacs) 'keymap 'local-map) 119 | ;;; "The name of the overlay property controlling keymaps.") 120 | 121 | ;;}}} 122 | ;;{{{ Keymaps and Events (XEmacs) 123 | 124 | ;; In XEmacs, keymaps are a primitive type, while in FSF Emacs, they 125 | ;; are a list whose car is the symbol `keymap'. Among other things, 126 | ;; this means that they handle default bindings differently. 127 | (defmacro mmm-set-keymap-default (keymap binding) 128 | (if (featurep 'xemacs) 129 | `(set-keymap-default-binding ,keymap ,binding) 130 | `(define-key ,keymap [t] ,binding))) 131 | 132 | ;; In XEmacs, events are a primitive type, while in FSF Emacs, they 133 | ;; are represented by characters or vectors. We treat them as vectors. 134 | ;; We can use `event-modifiers' in both Emacsen to extract the 135 | ;; modifiers, but the function to extract the basic key is different. 136 | (defmacro mmm-event-key (event) 137 | (if (featurep 'xemacs) 138 | `(event-key ,event) 139 | `(event-basic-type ,event))) 140 | 141 | ;;}}} 142 | ;;{{{ Skeleton (XEmacs) 143 | 144 | ;; XEmacs' `skeleton' package doesn't provide `@' to record positions. 145 | (defvar skeleton-positions ()) 146 | (defun mmm-fixup-skeleton () 147 | "Add `@' to `skeleton-further-elements' if XEmacs and not there. 148 | This makes `@' in skeletons act approximately like it does in FSF." 149 | (and (featurep 'xemacs) 150 | (defvar skeleton-further-elements ()) 151 | (not (assoc '@ skeleton-further-elements)) 152 | (add-to-list 'skeleton-further-elements 153 | '(@ ''(push (point) skeleton-positions))))) 154 | 155 | ;;}}} 156 | ;;{{{ Make Temp Buffers (XEmacs) 157 | 158 | (defmacro mmm-make-temp-buffer (buffer name) 159 | "Return a buffer called NAME including the text of BUFFER. 160 | This text should not be modified." 161 | (if (fboundp 'make-indirect-buffer) 162 | `(make-indirect-buffer ,buffer ,name) 163 | `(save-excursion 164 | (set-buffer (get-buffer-create ,name)) 165 | (insert-buffer ,buffer) 166 | (current-buffer)))) 167 | 168 | ;;}}} 169 | ;;{{{ Font Lock Available (Emacs w/o X) 170 | 171 | (defvar mmm-font-lock-available-p (or window-system mmm-xemacs) 172 | "Whether font-locking is available. 173 | Emacs 19 and 20 only provide font-lock with a window system in use.") 174 | 175 | ;;}}} 176 | ;;{{{ Font Lock Defaults (XEmacs) 177 | 178 | (defmacro mmm-set-font-lock-defaults () 179 | "Set font-lock defaults without trying to turn font-lock on. 180 | In XEmacs, `font-lock-set-defaults' calls `font-lock-set-defaults-1' 181 | to do the real work but then `turn-on-font-lock', which in turn calls 182 | `font-lock-mode', which unsets the defaults if running in a hidden 183 | buffer \(name begins with a space). So in XEmacs, we just call 184 | `font-lock-set-defaults-1' directly." 185 | (if mmm-xemacs 186 | `(font-lock-set-defaults-1) 187 | `(font-lock-set-defaults))) 188 | 189 | ;;}}} 190 | 191 | (provide 'mmm-compat) 192 | 193 | ;;; mmm-compat.el ends here -------------------------------------------------------------------------------- /.vim/syntax/haml.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Haml 3 | " Maintainer: Tim Pope 4 | " Filenames: *.haml 5 | " Last Change: 2010 Aug 09 6 | 7 | if exists("b:current_syntax") 8 | finish 9 | endif 10 | 11 | if !exists("main_syntax") 12 | let main_syntax = 'haml' 13 | endif 14 | let b:ruby_no_expensive = 1 15 | 16 | runtime! syntax/html.vim 17 | unlet! b:current_syntax 18 | silent! syn include @hamlSassTop syntax/sass.vim 19 | unlet! b:current_syntax 20 | syn include @hamlRubyTop syntax/ruby.vim 21 | 22 | syn case match 23 | 24 | syn region rubyCurlyBlock start="{" end="}" contains=@hamlRubyTop contained 25 | syn cluster hamlRubyTop add=rubyCurlyBlock 26 | 27 | syn cluster hamlComponent contains=hamlAttributes,hamlAttributesHash,hamlClassChar,hamlIdChar,hamlObject,hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable 28 | syn cluster hamlEmbeddedRuby contains=hamlAttributesHash,hamlObject,hamlRuby,hamlRubyFilter 29 | syn cluster hamlTop contains=hamlBegin,hamlPlainFilter,hamlRubyFilter,hamlSassFilter,hamlComment,hamlHtmlComment 30 | 31 | syn match hamlBegin "^\s*\%([<>]\|&[^=~ ]\)\@!" nextgroup=hamlTag,hamlClassChar,hamlIdChar,hamlRuby,hamlPlainChar,hamlInterpolatable 32 | 33 | syn match hamlTag "%\w\+\%(:\w\+\)\=" contained contains=htmlTagName,htmlSpecialTagName nextgroup=@hamlComponent 34 | syn region hamlAttributes matchgroup=hamlAttributesDelimiter start="(" end=")" contained contains=htmlArg,hamlAttributeString,hamlAttributeVariable,htmlEvent,htmlCssDefinition nextgroup=@hamlComponent 35 | syn region hamlAttributesHash matchgroup=hamlAttributesDelimiter start="{" end="}" contained contains=@hamlRubyTop nextgroup=@hamlComponent 36 | syn region hamlObject matchgroup=hamlObjectDelimiter start="\[" end="\]" contained contains=@hamlRubyTop nextgroup=@hamlComponent 37 | syn match hamlDespacer "[<>]" contained nextgroup=hamlDespacer,hamlSelfCloser,hamlRuby,hamlPlainChar,hamlInterpolatable 38 | syn match hamlSelfCloser "/" contained 39 | syn match hamlClassChar "\." contained nextgroup=hamlClass 40 | syn match hamlIdChar "#{\@!" contained nextgroup=hamlId 41 | syn match hamlClass "\%(\w\|-\)\+" contained nextgroup=@hamlComponent 42 | syn match hamlId "\%(\w\|-\)\+" contained nextgroup=@hamlComponent 43 | syn region hamlDocType start="^\s*!!!" end="$" 44 | 45 | syn region hamlRuby matchgroup=hamlRubyOutputChar start="[!&]\==\|\~" skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend 46 | syn region hamlRuby matchgroup=hamlRubyChar start="-" skip=",\s*$" end="$" contained contains=@hamlRubyTop keepend 47 | syn match hamlPlainChar "\\" contained 48 | syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="!\===\|!=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape,@hamlHtmlTop 49 | syn region hamlInterpolatable matchgroup=hamlInterpolatableChar start="&==\|&=\@!" end="$" keepend contained contains=hamlInterpolation,hamlInterpolationEscape 50 | syn region hamlInterpolation matchgroup=hamlInterpolationDelimiter start="#{" end="}" contains=@hamlRubyTop containedin=javascriptStringS,javascriptStringD 51 | syn match hamlInterpolationEscape "\\\@" contained contains=@hamlRubyTop 53 | 54 | syn region hamlAttributeString start=+\%(=\s*\)\@<='+ skip=+\%(\\\\\)*\\'+ end=+'+ contains=hamlInterpolation,hamlInterpolationEscape 55 | syn region hamlAttributeString start=+\%(=\s*\)\@<="+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=hamlInterpolation,hamlInterpolationEscape 56 | syn match hamlAttributeVariable "\%(=\s*\)\@<=\%(@@\=\|\$\)\=\w\+" contained 57 | 58 | syn match hamlHelper "\[^]]*]" contained containedin=hamlHtmlComment 77 | 78 | hi def link hamlSelfCloser Special 79 | hi def link hamlDespacer Special 80 | hi def link hamlClassChar Special 81 | hi def link hamlIdChar Special 82 | hi def link hamlTag Special 83 | hi def link hamlClass Type 84 | hi def link hamlId Identifier 85 | hi def link hamlPlainChar Special 86 | hi def link hamlInterpolatableChar hamlRubyChar 87 | hi def link hamlRubyOutputChar hamlRubyChar 88 | hi def link hamlRubyChar Special 89 | hi def link hamlInterpolationDelimiter Delimiter 90 | hi def link hamlInterpolationEscape Special 91 | hi def link hamlAttributeString String 92 | hi def link hamlAttributeVariable Identifier 93 | hi def link hamlDocType PreProc 94 | hi def link hamlFilter PreProc 95 | hi def link hamlAttributesDelimiter Delimiter 96 | hi def link hamlObjectDelimiter Delimiter 97 | hi def link hamlHelper Function 98 | hi def link hamlHtmlComment hamlComment 99 | hi def link hamlComment Comment 100 | hi def link hamlIEConditional SpecialComment 101 | hi def link hamlError Error 102 | 103 | let b:current_syntax = "haml" 104 | 105 | if main_syntax == "haml" 106 | unlet main_syntax 107 | endif 108 | 109 | " vim:set sw=2: 110 | -------------------------------------------------------------------------------- /.emacs: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | 3 | (custom-set-variables 4 | ;; custom-set-variables was added by Custom. 5 | ;; If you edit it by hand, you could mess it up, so be careful. 6 | ;; Your init file should contain only one such instance. 7 | ;; If there is more than one, they won't work right. 8 | '(case-fold-search t) 9 | '(column-number-mode t) 10 | '(current-language-environment "English") 11 | '(fringe-mode 0 nil (fringe)) 12 | '(global-font-lock-mode t nil (font-lock)) 13 | '(scroll-bar-mode nil) 14 | '(tool-bar-mode nil nil (tool-bar)) 15 | '(transient-mark-mode t)) 16 | (custom-set-faces 17 | ;; custom-set-faces was added by Custom. 18 | ;; If you edit it by hand, you could mess it up, so be careful. 19 | ;; Your init file should contain only one such instance. 20 | ;; If there is more than one, they won't work right. 21 | ) 22 | 23 | ; don't open new frames when opening files in aquamacs 24 | (setq one-buffer-one-frame-mode nil) 25 | 26 | ; use cmd as meta in aquamacs 27 | (setq-default mac-command-modifier 'meta) 28 | (setq-default mac-option-modifier nil) 29 | 30 | ; use a box cursor 31 | (setq cursor-type 'box) 32 | (setq default-cursor-type 'box) 33 | 34 | ; GRB: append my emacs lisp path to the load-path 35 | (setq load-path (cons "~/.emacs-lisp" load-path)) 36 | 37 | ; GRB: load python mode 38 | (load-file "~/.emacs-lisp/python-mode.el") 39 | (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) 40 | (setq interpreter-mode-alist (cons '("python" . python-mode) 41 | interpreter-mode-alist)) 42 | (autoload 'python-mode "python-mode" "Python editing mode." t) 43 | 44 | ; GRB: load rest mode 45 | (autoload 'rst-mode "~/.emacs-lisp/rst-mode" "mode for editing reStructuredText documents" t) 46 | (setq auto-mode-alist 47 | (append '(("\\.rst$" . rst-mode) 48 | ("\\.rest$" . rst-mode)) auto-mode-alist)) 49 | 50 | ; GRB: no tabs 51 | (setq-default indent-tabs-mode nil) 52 | (setq-default c-basic-offset 4) 53 | (setq-default default-tab-width 4) 54 | 55 | ; GRB: confirm exit 56 | (setq confirm-kill-emacs #'yes-or-no-p) 57 | 58 | ; GRB: C-style indentation in CSS mode 59 | (setq cssm-indent-function #'cssm-c-style-indenter) 60 | 61 | ; GRB: set the font. See these messages: 62 | ; http://lists.sourceforge.jp/mailman/archives/macemacsjp-english/2007-January/000858.html 63 | ; http://lists.sourceforge.jp/mailman/archives/macemacsjp-english/2007-January/000860.html 64 | ; (require 'carbon-font) 65 | ; (add-to-list 'default-frame-alist 66 | ; '(font . "-*-*-medium-r-normal--10-*-*-*-*-*-fontset-osaka")) 67 | 68 | (global-set-key "\C-cb" 'gary-insert-comment) 69 | 70 | ; GRB: keybindings 71 | (global-set-key (quote [?\e ?g]) (quote goto-line)) 72 | (global-set-key '[?\e ?(] 'start-kbd-macro) 73 | (global-set-key '[?\e ?)] 'end-kbd-macro) 74 | (global-set-key [?\e ?n] 'call-last-kbd-macro) 75 | 76 | ; GRB: cycle through selective-display levels 77 | (setq selective-display-level 0) 78 | (setq selective-display-increment 4) 79 | (setq max-selective-display-level 8) 80 | (defun switch-selective-display () 81 | "Switch to the next selective display level, starting over if appropriate" 82 | (if (>= selective-display-level max-selective-display-level) 83 | (setq selective-display-level 0) 84 | (setq selective-display-level 85 | (+ selective-display-increment 86 | selective-display-level))) 87 | (interactive) 88 | (set-selective-display selective-display-level)) 89 | (global-set-key "\M-c" 'switch-selective-display) 90 | 91 | ; GRB: use html-mode for kid templates 92 | (add-to-list 'auto-mode-alist '("\\.kid?\\'" . html-mode)) 93 | 94 | ; GRB: turn off menu bar 95 | (menu-bar-mode nil) 96 | 97 | (autoload 'psvn "psvn:w" "PSVN") 98 | 99 | (setq viper-mode t) ; enable Viper at load time 100 | (setq viper-ex-style-editing nil) ; can backspace past start of insert / line 101 | (require 'viper) ; load Viper 102 | (require 'vimpulse) ; load Vimpulse 103 | (require 'redo) ; enable vim-style redo 104 | (require 'rect-mark) ; enable prettier rectangular selections 105 | 106 | ; GRB: don't go into insert mode for shells, because that trips me up 107 | ; when I expect to be able to use C-w to switch through all my windows 108 | (delq 'shell-mode viper-insert-state-mode-list) 109 | (delq 'eshell-mode viper-insert-state-mode-list) 110 | 111 | ; GRB: resize and move the window if we're in a windowing system 112 | (defun resize-frame () 113 | "Resize current frame" 114 | (interactive) 115 | (set-frame-size (selected-frame) 239 68)) 116 | (defun move-frame () 117 | "Move current frame" 118 | (interactive) 119 | (set-frame-position (selected-frame) 0 0)) 120 | (if (not (eq window-system 'nil)) 121 | (progn 122 | (move-frame) 123 | (resize-frame))) 124 | 125 | ; GRB: split the windows 126 | (progn 127 | (interactive) 128 | (split-window-horizontally 80) 129 | (other-window 1) 130 | (split-window-horizontally 80) 131 | (other-window 1) 132 | (split-window) 133 | (other-window 1) 134 | (eshell) 135 | (other-window -3)) 136 | 137 | ; GRB: use C-o and M-o to switch windows 138 | (global-set-key "\C-o" 'other-window) 139 | (defun prev-window () 140 | (interactive) 141 | (other-window -1)) 142 | (global-set-key "\M-o" 'prev-window) 143 | 144 | ; GRB: turn off VC mode completely 145 | (set-variable 'vc-handled-backends ()) 146 | 147 | ; GRB: highlight trailing whitespace 148 | (set-default 'show-trailing-whitespace t) 149 | 150 | ; GRB: open temporary buffers in a dedicated window split 151 | (setq special-display-regexps 152 | '("^\\*Completions\\*$" 153 | "^\\*Help\\*$" 154 | "^\\*grep\\*$" 155 | "^\\*Apropos\\*$" 156 | "^\\*elisp macroexpansion\\*$" 157 | "^\\*local variables\\*$" 158 | "^\\*Compile-Log\\*$" 159 | "^\\*Quail Completions\\*$" 160 | "^\\*Occur\\*$" 161 | "^\\*frequencies\\*$" 162 | "^\\*compilation\\*$" 163 | "^\\*Locate\\*$" 164 | "^\\*Colors\\*$" 165 | "^\\*tumme-display-image\\*$" 166 | "^\\*SLIME Description\\*$" 167 | "^\\*.* output\\*$" ; tex compilation buffer 168 | "^\\*TeX Help\\*$" 169 | "^\\*Shell Command Output\\*$" 170 | "^\\*Async Shell Command\\*$")) 171 | (setq grb-temporary-window (nth 2 (window-list))) 172 | (defun grb-special-display (buffer &optional data) 173 | (let ((window grb-temporary-window)) 174 | (with-selected-window window 175 | (switch-to-buffer buffer) 176 | window))) 177 | (setq special-display-function #'grb-special-display) 178 | 179 | ; Unset cmd-space 180 | (global-unset-key (quote [67108896])) 181 | 182 | ; GRB: Don't show the startup screen 183 | (setq inhibit-startup-message t) 184 | 185 | ; GRB: always fill at 78 characters 186 | (add-hook 'text-mode-hook #'turn-on-auto-fill) 187 | (setq-default fill-column 78) 188 | 189 | (require 'color-theme) 190 | ;(color-theme-pok-wog) 191 | (color-theme-robin-hood) 192 | 193 | ; map gw to fill region like it does in vim 194 | (define-key viper-vi-global-user-map "gw" 'fill-region) 195 | 196 | (setq-default auto-fill-function 197 | (lambda () 198 | (do-auto-fill) 199 | (set-window-hscroll 200 | (selected-window) 0))) 201 | 202 | ; by default, grep into compressed files if possible when using M-x 203 | ; grep 204 | (setq-default grep-command "zgrep -nH -e ") 205 | -------------------------------------------------------------------------------- /.emacs-lisp/mmm-auto.el: -------------------------------------------------------------------------------- 1 | ;;; mmm-auto.el --- loading and enabling MMM Mode automatically 2 | 3 | ;; Copyright (C) 2000 by Michael Abraham Shulman 4 | 5 | ;; Author: Michael Abraham Shulman 6 | ;; Version: $Id: mmm-auto.el,v 1.21 2003/03/25 21:49:26 viritrilbia Exp $ 7 | 8 | ;;{{{ GPL 9 | 10 | ;; This file is free software; you can redistribute it and/or modify 11 | ;; it under the terms of the GNU General Public License as published by 12 | ;; the Free Software Foundation; either version 2, or (at your option) 13 | ;; any later version. 14 | 15 | ;; This file is distributed in the hope that it will be useful, 16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | ;; GNU General Public License for more details. 19 | 20 | ;; You should have received a copy of the GNU General Public License 21 | ;; along with GNU Emacs; see the file COPYING. If not, write to 22 | ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 | ;; Boston, MA 02111-1307, USA. 24 | 25 | ;;}}} 26 | 27 | ;;; Commentary: 28 | 29 | ;; This file contains functions and hooks to load and enable MMM Mode 30 | ;; automatically. It sets up autoloads for the main MMM Mode functions 31 | ;; and interactive commands, and also sets up MMM Global Mode. 32 | 33 | ;;{{{ Comments on MMM Global Mode 34 | 35 | ;; This is a kludge borrowed from `global-font-lock-mode'. The idea 36 | ;; is the same: we have a function (here `mmm-mode-on-maybe') that we 37 | ;; want to be run whenever a major mode starts. Unfortunately, there 38 | ;; is no hook (like, say `major-mode-hook') that all major modes run 39 | ;; when they are finished. `post-command-hook', however, is run after 40 | ;; *every* command, so we do our work in there. (Actually, using 41 | ;; `post-command-hook' is even better than being run by major mode 42 | ;; functions, since it is run after all local variables and text are 43 | ;; loaded, which may not be true in certain cases for the other.) 44 | 45 | ;; In order to do this magic, we rely on the fact that there *is* a 46 | ;; hook that all major modes run when *beginning* their work. They 47 | ;; call `kill-all-local-variables' (unless they are broken), which in 48 | ;; turn runs `change-major-mode-hook'. So we add a function to *that* 49 | ;; hook which saves the current buffer and temporarily adds a function 50 | ;; to `post-command-hook' which processes that buffer. 51 | 52 | ;; Actually, in the interests of generality, what that function does 53 | ;; is run the hook `mmm-major-mode-hook'. Our desired function 54 | ;; `mmm-mode-on-maybe' is then added to that hook. This way, if the 55 | ;; user wants to run something else on every major mode, they can just 56 | ;; add it to `mmm-major-mode-hook' and take advantage of this hack. 57 | 58 | ;;}}} 59 | 60 | ;;; Code: 61 | 62 | (require 'cl) 63 | (require 'mmm-vars) 64 | 65 | ;;{{{ Autoload Submode Classes 66 | 67 | (defvar mmm-autoloaded-classes 68 | '((mason "mmm-mason" nil) 69 | (embedded-css "mmm-sample" nil) 70 | (html-js "mmm-sample" nil) 71 | (here-doc "mmm-sample" nil) 72 | (embperl "mmm-sample" nil) 73 | (eperl "mmm-sample" nil) 74 | (jsp "mmm-sample" nil) 75 | (file-variables "mmm-sample" nil) 76 | (rpm-sh "mmm-rpm" t) 77 | (rpm "mmm-rpm" nil) 78 | (cweb "mmm-cweb" nil) 79 | (sgml-dtd "mmm-sample" nil) 80 | (noweb "mmm-noweb" nil) 81 | (html-php "mmm-sample" nil) 82 | ) 83 | "Alist of submode classes autoloaded from files. 84 | Elements look like \(CLASS FILE PRIVATE) where CLASS is a submode 85 | class symbol, FILE is a string suitable for passing to `load', and 86 | PRIVATE is non-nil if the class is invisible to the user. Classes can 87 | be added to this list with `mmm-autoload-class'.") 88 | 89 | (defun mmm-autoload-class (class file &optional private) 90 | "Autoload submode class CLASS from file FILE. 91 | PRIVATE, if non-nil, means the class is user-invisible. In general, 92 | private classes need not be autoloaded, since they will usually be 93 | invoked by a public class in the same file." 94 | ;; Don't autoload already defined classes 95 | (unless (assq class mmm-classes-alist) 96 | (add-to-list 'mmm-autoloaded-classes 97 | (list class file private)))) 98 | 99 | ;;}}} 100 | ;;{{{ Autoload Functions 101 | 102 | ;; To shut up the byte compiler. 103 | (eval-and-compile 104 | (autoload 'mmm-mode-on "mmm-mode" "Turn on MMM Mode. See `mmm-mode'.") 105 | (autoload 'mmm-mode-off "mmm-mode" "Turn off MMM Mode. See `mmm-mode'.") 106 | (autoload 'mmm-update-font-lock-buffer "mmm-region") 107 | (autoload 'mmm-ensure-fboundp "mmm-utils") 108 | (autoload 'mmm-mode "mmm-mode" 109 | "Minor mode to allow multiple major modes in one buffer. 110 | Without ARG, toggle MMM Mode. With ARG, turn MMM Mode on iff ARG is 111 | positive and off otherwise." t)) 112 | 113 | ;; These may actually be used. 114 | (autoload 'mmm-ify-by-class "mmm-cmds" "" t) 115 | (autoload 'mmm-ify-by-regexp "mmm-cmds" "" t) 116 | (autoload 'mmm-ify-region "mmm-cmds" "" t) 117 | (autoload 'mmm-parse-buffer "mmm-cmds" "" t) 118 | (autoload 'mmm-parse-region "mmm-cmds" "" t) 119 | (autoload 'mmm-parse-block "mmm-cmds" "" t) 120 | (autoload 'mmm-clear-current-region "mmm-cmds" "" t) 121 | (autoload 'mmm-reparse-current-region "mmm-cmds" "" t) 122 | (autoload 'mmm-end-current-region "mmm-cmds" "" t) 123 | (autoload 'mmm-insertion-help "mmm-cmds" "" t) 124 | (autoload 'mmm-insert-region "mmm-cmds" "" t) 125 | 126 | ;;}}} 127 | ;;{{{ MMM Global Mode 128 | 129 | (defvar mmm-changed-buffers-list () 130 | "Buffers that need to be checked for running the major mode hook.") 131 | 132 | (defun mmm-major-mode-change () 133 | "Add this buffer to `mmm-changed-buffers-list' for checking. 134 | When the current command is over, MMM Mode will be turned on in this 135 | buffer depending on the value of `mmm-global-mode'. Actually, 136 | everything in `mmm-major-mode-hook' will be run." 137 | (and (boundp 'mmm-mode) 138 | mmm-mode 139 | (mmm-mode-off)) 140 | (add-to-list 'mmm-changed-buffers-list (current-buffer)) 141 | (add-hook 'post-command-hook 'mmm-check-changed-buffers)) 142 | 143 | (add-hook 'change-major-mode-hook 'mmm-major-mode-change) 144 | 145 | (defun mmm-check-changed-buffers () 146 | "Run major mode hook for the buffers in `mmm-changed-buffers-list'." 147 | (remove-hook 'post-command-hook 'mmm-check-changed-buffers) 148 | (dolist (buffer mmm-changed-buffers-list) 149 | (when (buffer-live-p buffer) 150 | (save-excursion 151 | (set-buffer buffer) 152 | (mmm-run-major-mode-hook)))) 153 | (setq mmm-changed-buffers-list '())) 154 | 155 | (defun mmm-mode-on-maybe () 156 | "Conditionally turn on MMM Mode. 157 | Turn on MMM Mode if `global-mmm-mode' is non-nil and there are classes 158 | to apply, or always if `global-mmm-mode' is t." 159 | (cond ((eq mmm-global-mode t) (mmm-mode-on)) 160 | ((not mmm-global-mode)) 161 | ((mmm-get-all-classes nil) (mmm-mode-on))) 162 | (when mmm-mode 163 | (mmm-update-font-lock-buffer))) 164 | 165 | (add-hook 'mmm-major-mode-hook 'mmm-mode-on-maybe) 166 | 167 | (defalias 'mmm-add-find-file-hooks 'mmm-add-find-file-hook) 168 | (defun mmm-add-find-file-hook () 169 | "Equivalent to \(setq mmm-global-mode 'maybe). 170 | This function is deprecated and may be removed in future." 171 | (message "Warning: `mmm-add-find-file-hook' is deprecated.") 172 | (setq mmm-global-mode 'maybe)) 173 | 174 | ;;}}} 175 | 176 | (provide 'mmm-auto) 177 | 178 | ;;; mmm-auto.el ends here -------------------------------------------------------------------------------- /.zsh/func/prompt_wunjo_setup: -------------------------------------------------------------------------------- 1 | # wunjo prompt theme 2 | 3 | autoload -U zgitinit 4 | zgitinit 5 | 6 | prompt_wunjo_help () { 7 | cat <<'EOF' 8 | 9 | prompt wunjo 10 | 11 | EOF 12 | } 13 | 14 | revstring() { 15 | git describe --always $1 2>/dev/null || 16 | git rev-parse --short $1 2>/dev/null 17 | } 18 | 19 | coloratom() { 20 | local off=$1 atom=$2 21 | if [[ $atom[1] == [[:upper:]] ]]; then 22 | off=$(( $off + 60 )) 23 | fi 24 | echo $(( $off + $colorcode[${(L)atom}] )) 25 | } 26 | colorword() { 27 | local fg=$1 bg=$2 att=$3 28 | local -a s 29 | 30 | if [ -n "$fg" ]; then 31 | s+=$(coloratom 30 $fg) 32 | fi 33 | if [ -n "$bg" ]; then 34 | s+=$(coloratom 40 $bg) 35 | fi 36 | if [ -n "$att" ]; then 37 | s+=$attcode[$att] 38 | fi 39 | 40 | echo "%{"$'\e['${(j:;:)s}m"%}" 41 | } 42 | 43 | prompt_wunjo_setup() { 44 | local verbose 45 | if [[ $TERM == screen* ]] && [ -n "$STY" ]; then 46 | verbose= 47 | else 48 | verbose=1 49 | fi 50 | 51 | typeset -A colorcode 52 | colorcode[black]=0 53 | colorcode[red]=1 54 | colorcode[green]=2 55 | colorcode[yellow]=3 56 | colorcode[blue]=4 57 | colorcode[magenta]=5 58 | colorcode[cyan]=6 59 | colorcode[white]=7 60 | colorcode[default]=9 61 | colorcode[k]=$colorcode[black] 62 | colorcode[r]=$colorcode[red] 63 | colorcode[g]=$colorcode[green] 64 | colorcode[y]=$colorcode[yellow] 65 | colorcode[b]=$colorcode[blue] 66 | colorcode[m]=$colorcode[magenta] 67 | colorcode[c]=$colorcode[cyan] 68 | colorcode[w]=$colorcode[white] 69 | colorcode[.]=$colorcode[default] 70 | 71 | typeset -A attcode 72 | attcode[none]=00 73 | attcode[bold]=01 74 | attcode[faint]=02 75 | attcode[standout]=03 76 | attcode[underline]=04 77 | attcode[blink]=05 78 | attcode[reverse]=07 79 | attcode[conceal]=08 80 | attcode[normal]=22 81 | attcode[no-standout]=23 82 | attcode[no-underline]=24 83 | attcode[no-blink]=25 84 | attcode[no-reverse]=27 85 | attcode[no-conceal]=28 86 | 87 | local -A pc 88 | pc[default]='default' 89 | pc[date]='cyan' 90 | pc[time]='Blue' 91 | pc[host]='Green' 92 | pc[user]='cyan' 93 | pc[punc]='yellow' 94 | pc[line]='magenta' 95 | pc[hist]='green' 96 | pc[path]='Cyan' 97 | pc[shortpath]='default' 98 | pc[rc]='red' 99 | pc[scm_branch]='Cyan' 100 | pc[scm_commitid]='Yellow' 101 | pc[scm_status_dirty]='Red' 102 | pc[scm_status_staged]='Green' 103 | pc[#]='Yellow' 104 | for cn in ${(k)pc}; do 105 | pc[${cn}]=$(colorword $pc[$cn]) 106 | done 107 | pc[reset]=$(colorword . . 00) 108 | 109 | typeset -Ag wunjo_prompt_colors 110 | wunjo_prompt_colors=(${(kv)pc}) 111 | 112 | local p_date p_line p_rc 113 | 114 | p_date="$pc[date]%D{%Y-%m-%d} $pc[time]%D{%T}$pc[reset]" 115 | 116 | p_line="$pc[line]%y$pc[reset]" 117 | 118 | PROMPT= 119 | if [ $verbose ]; then 120 | PROMPT+="$pc[host]%m$pc[reset] " 121 | fi 122 | PROMPT+="$pc[path]%(2~.%~.%/)$pc[reset]" 123 | PROMPT+="\$(prompt_wunjo_scm_status)" 124 | PROMPT+="%(?.. $pc[rc]exited %1v$pc[reset])" 125 | PROMPT+=" 126 | " 127 | PROMPT+="$pc[hist]%h$pc[reset] " 128 | PROMPT+="$pc[shortpath]%1~$pc[reset]" 129 | PROMPT+="\$(prompt_wunjo_scm_branch)" 130 | PROMPT+=" $pc[#]%#$pc[reset] " 131 | 132 | RPROMPT= 133 | if [ $verbose ]; then 134 | RPROMPT+="$p_date " 135 | fi 136 | RPROMPT+="$pc[user]%n$pc[reset]" 137 | RPROMPT+=" $p_line" 138 | 139 | export PROMPT RPROMPT 140 | precmd_functions+='prompt_wunjo_precmd' 141 | } 142 | 143 | prompt_wunjo_precmd() { 144 | local ex=$? 145 | psvar=() 146 | 147 | if [[ $ex -ge 128 ]]; then 148 | sig=$signals[$ex-127] 149 | psvar[1]="sig${(L)sig}" 150 | else 151 | psvar[1]="$ex" 152 | fi 153 | } 154 | 155 | prompt_wunjo_scm_status() { 156 | zgit_isgit || return 157 | local -A pc 158 | pc=(${(kv)wunjo_prompt_colors}) 159 | 160 | head=$(zgit_head) 161 | gitcommit=$(revstring $head) 162 | 163 | local -a commits 164 | 165 | if zgit_rebaseinfo; then 166 | orig_commit=$(revstring $zgit_info[rb_head]) 167 | orig_name=$(git name-rev --name-only $zgit_info[rb_head]) 168 | orig="$pc[scm_branch]$orig_name$pc[punc]($pc[scm_commitid]$orig_commit$pc[punc])" 169 | onto_commit=$(revstring $zgit_info[rb_onto]) 170 | onto_name=$(git name-rev --name-only $zgit_info[rb_onto]) 171 | onto="$pc[scm_branch]$onto_name$pc[punc]($pc[scm_commitid]$onto_commit$pc[punc])" 172 | 173 | if [ -n "$zgit_info[rb_upstream]" ] && [ $zgit_info[rb_upstream] != $zgit_info[rb_onto] ]; then 174 | upstream_commit=$(revstring $zgit_info[rb_upstream]) 175 | upstream_name=$(git name-rev --name-only $zgit_info[rb_upstream]) 176 | upstream="$pc[scm_branch]$upstream_name$pc[punc]($pc[scm_commitid]$upstream_commit$pc[punc])" 177 | commits+="rebasing $upstream$pc[reset]..$orig$pc[reset] onto $onto$pc[reset]" 178 | else 179 | commits+="rebasing $onto$pc[reset]..$orig$pc[reset]" 180 | fi 181 | 182 | local -a revs 183 | revs=($(git rev-list $zgit_info[rb_onto]..HEAD)) 184 | if [ $#revs -gt 0 ]; then 185 | commits+="\n$#revs commits in" 186 | fi 187 | 188 | if [ -f $zgit_info[dotest]/message ]; then 189 | mess=$(head -n1 $zgit_info[dotest]/message) 190 | commits+="on $mess" 191 | fi 192 | elif [ -n "$gitcommit" ]; then 193 | commits+="on $pc[scm_branch]$head$pc[punc]($pc[scm_commitid]$gitcommit$pc[punc])$pc[reset]" 194 | local track_merge=$(zgit_tracking_merge) 195 | if [ -n "$track_merge" ]; then 196 | if git rev-parse --verify -q $track_merge >/dev/null; then 197 | local track_remote=$(zgit_tracking_remote) 198 | local tracked=$(revstring $track_merge 2>/dev/null) 199 | 200 | local -a revs 201 | revs=($(git rev-list --reverse $track_merge..HEAD)) 202 | if [ $#revs -gt 0 ]; then 203 | local base=$(revstring $revs[1]~1) 204 | local base_name=$(git name-rev --name-only $base) 205 | local base_short=$(revstring $base) 206 | local word_commits 207 | if [ $#revs -gt 1 ]; then 208 | word_commits='commits' 209 | else 210 | word_commits='commit' 211 | fi 212 | 213 | local conj="since" 214 | if [[ "$base" == "$tracked" ]]; then 215 | conj+=" tracked" 216 | tracked= 217 | fi 218 | commits+="$#revs $word_commits $conj $pc[scm_branch]$base_name$pc[punc]($pc[scm_commitid]$base_short$pc[punc])$pc[reset]" 219 | fi 220 | 221 | if [ -n "$tracked" ]; then 222 | local track_name=$track_merge 223 | if [[ $track_remote == "." ]]; then 224 | track_name=${track_name##*/} 225 | fi 226 | tracked=$(revstring $tracked) 227 | commits+="tracking $pc[scm_branch]$track_name$pc[punc]" 228 | if [[ "$tracked" != "$gitcommit" ]]; then 229 | commits[$#commits]+="($pc[scm_commitid]$tracked$pc[punc])" 230 | fi 231 | commits[$#commits]+="$pc[reset]" 232 | fi 233 | fi 234 | fi 235 | fi 236 | 237 | gitsvn=$(git rev-parse --verify -q --short git-svn) 238 | if [ $? -eq 0 ]; then 239 | gitsvnrev=$(zgit_svnhead $gitsvn) 240 | gitsvn=$(revstring $gitsvn) 241 | if [ -n "$gitsvnrev" ]; then 242 | local svninfo='' 243 | local -a revs 244 | svninfo+="$pc[default]svn$pc[punc]:$pc[scm_branch]r$gitsvnrev" 245 | revs=($(git rev-list git-svn..HEAD)) 246 | if [ $#revs -gt 0 ]; then 247 | svninfo+="$pc[punc]@$pc[default]HEAD~$#revs" 248 | svninfo+="$pc[punc]($pc[scm_commitid]$gitsvn$pc[punc])" 249 | fi 250 | commits+=$svninfo 251 | fi 252 | fi 253 | 254 | if [ $#commits -gt 0 ]; then 255 | echo -n " ${(j: :)commits}" 256 | fi 257 | } 258 | 259 | prompt_wunjo_scm_branch() { 260 | zgit_isgit || return 261 | local -A pc 262 | pc=(${(kv)wunjo_prompt_colors}) 263 | 264 | echo -n "$pc[punc]:$pc[scm_branch]$(zgit_head)" 265 | 266 | if zgit_inworktree; then 267 | if ! zgit_isindexclean; then 268 | echo -n "$pc[scm_status_staged]+" 269 | fi 270 | 271 | local -a dirty 272 | if ! zgit_isworktreeclean; then 273 | dirty+='!' 274 | fi 275 | 276 | if zgit_hasunmerged; then 277 | dirty+='*' 278 | fi 279 | 280 | if zgit_hasuntracked; then 281 | dirty+='?' 282 | fi 283 | 284 | if [ $#dirty -gt 0 ]; then 285 | echo -n "$pc[scm_status_dirty]${(j::)dirty}" 286 | fi 287 | fi 288 | 289 | echo $pc[reset] 290 | } 291 | 292 | prompt_wunjo_setup "$@" 293 | 294 | # vim:set ft=zsh: 295 | -------------------------------------------------------------------------------- /.emacs-lisp/redo.el: -------------------------------------------------------------------------------- 1 | ;;; redo.el -- Redo/undo system for XEmacs 2 | 3 | ;; Copyright (C) 1985, 1986, 1987, 1993-1995 Free Software Foundation, Inc. 4 | ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. 5 | ;; Copyright (C) 1997 Kyle E. Jones 6 | 7 | ;; Author: Kyle E. Jones, February 1997 8 | ;; Keywords: lisp, extensions 9 | 10 | ;; This file is part of XEmacs. 11 | 12 | ;; XEmacs is free software; you can redistribute it and/or modify it 13 | ;; under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation; either version 2, or (at your option) 15 | ;; any later version. 16 | 17 | ;; XEmacs is distributed in the hope that it will be useful, but 18 | ;; WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | ;; General Public License for more details. 21 | 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with XEmacs; see the file COPYING. If not, write to the Free 24 | ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 25 | ;; 02111-1307, USA. 26 | 27 | ;;; Synched up with: Not in FSF. 28 | 29 | ;;; Commentary: 30 | 31 | ;; Derived partly from lisp/prim/simple.el in XEmacs. 32 | 33 | ;; Emacs' normal undo system allows you to undo an arbitrary 34 | ;; number of buffer changes. These undos are recorded as ordinary 35 | ;; buffer changes themselves. So when you break the chain of 36 | ;; undos by issuing some other command, you can then undo all 37 | ;; the undos. The chain of recorded buffer modifications 38 | ;; therefore grows without bound, truncated only at garbage 39 | ;; collection time. 40 | ;; 41 | ;; The redo/undo system is different in two ways: 42 | ;; 1. The undo/redo command chain is only broken by a buffer 43 | ;; modification. You can move around the buffer or switch 44 | ;; buffers and still come back and do more undos or redos. 45 | ;; 2. The `redo' command rescinds the most recent undo without 46 | ;; recording the change as a _new_ buffer change. It 47 | ;; completely reverses the effect of the undo, which 48 | ;; includes making the chain of buffer modification records 49 | ;; shorter by one, to counteract the effect of the undo 50 | ;; command making the record list longer by one. 51 | ;; 52 | ;; Installation: 53 | ;; 54 | ;; Save this file as redo.el, byte compile it and put the 55 | ;; resulting redo.elc file in a directory that is listed in 56 | ;; load-path. 57 | ;; 58 | ;; In your .emacs file, add 59 | ;; (require 'redo) 60 | ;; and the system will be enabled. 61 | 62 | ;;; Code: 63 | 64 | (provide 'redo) 65 | 66 | (defvar redo-version "1.02" 67 | "Version number for the Redo package.") 68 | 69 | (defvar last-buffer-undo-list nil 70 | "The head of buffer-undo-list at the last time an undo or redo was done.") 71 | (make-variable-buffer-local 'last-buffer-undo-list) 72 | 73 | (make-variable-buffer-local 'pending-undo-list) 74 | 75 | ;; Emacs 20 variable 76 | (defvar undo-in-progress) 77 | 78 | (defun redo (&optional count) 79 | "Redo the the most recent undo. 80 | Prefix arg COUNT means redo the COUNT most recent undos. 81 | If you have modified the buffer since the last redo or undo, 82 | then you cannot redo any undos before then." 83 | (interactive "*p") 84 | (if (eq buffer-undo-list t) 85 | (error "No undo information in this buffer")) 86 | (if (eq last-buffer-undo-list nil) 87 | (error "No undos to redo")) 88 | (or (eq last-buffer-undo-list buffer-undo-list) 89 | ;; skip one undo boundary and all point setting commands up 90 | ;; until the next undo boundary and try again. 91 | (let ((p buffer-undo-list)) 92 | (and (null (car-safe p)) (setq p (cdr-safe p))) 93 | (while (and p (integerp (car-safe p))) 94 | (setq p (cdr-safe p))) 95 | (eq last-buffer-undo-list p)) 96 | (error "Buffer modified since last undo/redo, cannot redo")) 97 | (and (or (eq buffer-undo-list pending-undo-list) 98 | (eq (cdr buffer-undo-list) pending-undo-list)) 99 | (error "No further undos to redo in this buffer")) 100 | (or (eq (selected-window) (minibuffer-window)) 101 | (message "Redo...")) 102 | (let ((modified (buffer-modified-p)) 103 | (undo-in-progress t) 104 | (recent-save (recent-auto-save-p)) 105 | (old-undo-list buffer-undo-list) 106 | (p (cdr buffer-undo-list)) 107 | (records-between 0)) 108 | ;; count the number of undo records between the head of the 109 | ;; undo chain and the pointer to the next change. Note that 110 | ;; by `record' we mean clumps of change records, not the 111 | ;; boundary records. The number of records will always be a 112 | ;; multiple of 2, because an undo moves the pending pointer 113 | ;; forward one record and prepend a record to the head of the 114 | ;; chain. Thus the separation always increases by two. When 115 | ;; we decrease it we will decrease it by a multiple of 2 116 | ;; also. 117 | (while p 118 | (cond ((eq p pending-undo-list) 119 | (setq p nil)) 120 | ((null (car p)) 121 | (setq records-between (1+ records-between)) 122 | (setq p (cdr p))) 123 | (t 124 | (setq p (cdr p))))) 125 | ;; we're off by one if pending pointer is nil, because there 126 | ;; was no boundary record in front of it to count. 127 | (and (null pending-undo-list) 128 | (setq records-between (1+ records-between))) 129 | ;; don't allow the user to redo more undos than exist. 130 | ;; only half the records between the list head and the pending 131 | ;; pointer are undos that are a part of this command chain. 132 | (setq count (min (/ records-between 2) count) 133 | p (primitive-undo (1+ count) buffer-undo-list)) 134 | (if (eq p old-undo-list) 135 | nil ;; nothing happened 136 | ;; set buffer-undo-list to the new undo list. if has been 137 | ;; shortened by `count' records. 138 | (setq buffer-undo-list p) 139 | ;; primitive-undo returns a list without a leading undo 140 | ;; boundary. add one. 141 | (undo-boundary) 142 | ;; now move the pending pointer backward in the undo list 143 | ;; to reflect the redo. sure would be nice if this list 144 | ;; were doubly linked, but no... so we have to run down the 145 | ;; list from the head and stop at the right place. 146 | (let ((n (- records-between count))) 147 | (setq p (cdr old-undo-list)) 148 | (while (and p (> n 0)) 149 | (if (null (car p)) 150 | (setq n (1- n))) 151 | (setq p (cdr p))) 152 | (setq pending-undo-list p))) 153 | (and modified (not (buffer-modified-p)) 154 | (delete-auto-save-file-if-necessary recent-save)) 155 | (or (eq (selected-window) (minibuffer-window)) 156 | (message "Redo!")) 157 | (setq last-buffer-undo-list buffer-undo-list))) 158 | 159 | (defun undo (&optional arg) 160 | "Undo some previous changes. 161 | Repeat this command to undo more changes. 162 | A numeric argument serves as a repeat count." 163 | (interactive "*p") 164 | (let ((modified (buffer-modified-p)) 165 | (recent-save (recent-auto-save-p))) 166 | (or (eq (selected-window) (minibuffer-window)) 167 | (message "Undo...")) 168 | (or (eq last-buffer-undo-list buffer-undo-list) 169 | ;; skip one undo boundary and all point setting commands up 170 | ;; until the next undo boundary and try again. 171 | (let ((p buffer-undo-list)) 172 | (and (null (car-safe p)) (setq p (cdr-safe p))) 173 | (while (and p (integerp (car-safe p))) 174 | (setq p (cdr-safe p))) 175 | (eq last-buffer-undo-list p)) 176 | (progn (undo-start) 177 | (undo-more 1))) 178 | (undo-more (or arg 1)) 179 | ;; Don't specify a position in the undo record for the undo command. 180 | ;; Instead, undoing this should move point to where the change is. 181 | ;; 182 | ;;;; The old code for this was mad! It deleted all set-point 183 | ;;;; references to the position from the whole undo list, 184 | ;;;; instead of just the cells from the beginning to the next 185 | ;;;; undo boundary. This does what I think the other code 186 | ;;;; meant to do. 187 | (let ((list buffer-undo-list) 188 | (prev nil)) 189 | (while (and list (not (null (car list)))) 190 | (if (integerp (car list)) 191 | (if prev 192 | (setcdr prev (cdr list)) 193 | ;; impossible now, but maybe not in the future 194 | (setq buffer-undo-list (cdr list)))) 195 | (setq prev list 196 | list (cdr list)))) 197 | (and modified (not (buffer-modified-p)) 198 | (delete-auto-save-file-if-necessary recent-save))) 199 | (or (eq (selected-window) (minibuffer-window)) 200 | (message "Undo!")) 201 | (setq last-buffer-undo-list buffer-undo-list)) 202 | 203 | ;;; redo.el ends here 204 | -------------------------------------------------------------------------------- /.vim/indent/html.vim: -------------------------------------------------------------------------------- 1 | " Description: html indenter 2 | " Author: Johannes Zellner 3 | " Last Change: Tue, 27 Apr 2004 10:28:39 CEST 4 | " Restoring 'cpo' and 'ic' added by Bram 2006 May 5 5 | " Globals: g:html_indent_tags -- indenting tags 6 | " g:html_indent_strict -- inhibit 'O O' elements 7 | " g:html_indent_strict_table -- inhibit 'O -' elements 8 | 9 | " Only load this indent file when no other was loaded. 10 | if exists("b:did_indent") 11 | finish 12 | endif 13 | let b:did_indent = 1 14 | 15 | 16 | " [-- local settings (must come before aborting the script) --] 17 | setlocal indentexpr=HtmlIndentGet(v:lnum) 18 | setlocal indentkeys=o,O,*,<>>,{,} 19 | 20 | 21 | if exists('g:html_indent_tags') 22 | unlet g:html_indent_tags 23 | endif 24 | 25 | " [-- helper function to assemble tag list --] 26 | fun! HtmlIndentPush(tag) 27 | if exists('g:html_indent_tags') 28 | let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag 29 | else 30 | let g:html_indent_tags = a:tag 31 | endif 32 | endfun 33 | 34 | 35 | " [-- --] 36 | call HtmlIndentPush('a') 37 | call HtmlIndentPush('abbr') 38 | call HtmlIndentPush('acronym') 39 | call HtmlIndentPush('address') 40 | call HtmlIndentPush('b') 41 | call HtmlIndentPush('bdo') 42 | call HtmlIndentPush('big') 43 | call HtmlIndentPush('blockquote') 44 | call HtmlIndentPush('button') 45 | call HtmlIndentPush('caption') 46 | call HtmlIndentPush('center') 47 | call HtmlIndentPush('cite') 48 | call HtmlIndentPush('code') 49 | call HtmlIndentPush('colgroup') 50 | call HtmlIndentPush('del') 51 | call HtmlIndentPush('dfn') 52 | call HtmlIndentPush('dir') 53 | call HtmlIndentPush('div') 54 | call HtmlIndentPush('dl') 55 | call HtmlIndentPush('em') 56 | call HtmlIndentPush('fieldset') 57 | call HtmlIndentPush('font') 58 | call HtmlIndentPush('form') 59 | call HtmlIndentPush('frameset') 60 | call HtmlIndentPush('h1') 61 | call HtmlIndentPush('h2') 62 | call HtmlIndentPush('h3') 63 | call HtmlIndentPush('h4') 64 | call HtmlIndentPush('h5') 65 | call HtmlIndentPush('h6') 66 | call HtmlIndentPush('i') 67 | call HtmlIndentPush('iframe') 68 | call HtmlIndentPush('ins') 69 | call HtmlIndentPush('kbd') 70 | call HtmlIndentPush('label') 71 | call HtmlIndentPush('legend') 72 | call HtmlIndentPush('map') 73 | call HtmlIndentPush('menu') 74 | call HtmlIndentPush('noframes') 75 | call HtmlIndentPush('noscript') 76 | call HtmlIndentPush('object') 77 | call HtmlIndentPush('ol') 78 | call HtmlIndentPush('optgroup') 79 | " call HtmlIndentPush('pre') 80 | call HtmlIndentPush('q') 81 | call HtmlIndentPush('s') 82 | call HtmlIndentPush('samp') 83 | call HtmlIndentPush('script') 84 | call HtmlIndentPush('select') 85 | call HtmlIndentPush('small') 86 | call HtmlIndentPush('span') 87 | call HtmlIndentPush('strong') 88 | call HtmlIndentPush('style') 89 | call HtmlIndentPush('sub') 90 | call HtmlIndentPush('sup') 91 | call HtmlIndentPush('table') 92 | call HtmlIndentPush('textarea') 93 | call HtmlIndentPush('title') 94 | call HtmlIndentPush('tt') 95 | call HtmlIndentPush('u') 96 | call HtmlIndentPush('ul') 97 | call HtmlIndentPush('var') 98 | 99 | 100 | " [-- --] 101 | if !exists('g:html_indent_strict') 102 | call HtmlIndentPush('body') 103 | call HtmlIndentPush('head') 104 | call HtmlIndentPush('html') 105 | call HtmlIndentPush('tbody') 106 | endif 107 | 108 | 109 | " [-- --] 110 | if !exists('g:html_indent_strict_table') 111 | call HtmlIndentPush('th') 112 | call HtmlIndentPush('td') 113 | call HtmlIndentPush('tr') 114 | call HtmlIndentPush('tfoot') 115 | call HtmlIndentPush('thead') 116 | endif 117 | 118 | delfun HtmlIndentPush 119 | 120 | let s:cpo_save = &cpo 121 | set cpo-=C 122 | 123 | " [-- count indent-increasing tags of line a:lnum --] 124 | fun! HtmlIndentOpen(lnum, pattern) 125 | let s = substitute('x'.getline(a:lnum), 126 | \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)', "\1", 'g') 127 | let s = substitute(s, "[^\1].*$", '', '') 128 | return strlen(s) 129 | endfun 130 | 131 | " [-- count indent-decreasing tags of line a:lnum --] 132 | fun! HtmlIndentClose(lnum, pattern) 133 | let s = substitute('x'.getline(a:lnum), 134 | \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)', "\1", 'g') 135 | let s = substitute(s, "[^\1].*$", '', '') 136 | return strlen(s) 137 | endfun 138 | 139 | " [-- count indent-increasing '{' of (java|css) line a:lnum --] 140 | fun! HtmlIndentOpenAlt(lnum) 141 | return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g')) 142 | endfun 143 | 144 | " [-- count indent-decreasing '}' of (java|css) line a:lnum --] 145 | fun! HtmlIndentCloseAlt(lnum) 146 | return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g')) 147 | endfun 148 | 149 | " [-- return the sum of indents respecting the syntax of a:lnum --] 150 | fun! HtmlIndentSum(lnum, style) 151 | if a:style == match(getline(a:lnum), '^\s*') 153 | let open = HtmlIndentOpen(a:lnum, g:html_indent_tags) 154 | let close = HtmlIndentClose(a:lnum, g:html_indent_tags) 155 | if 0 != open || 0 != close 156 | return open - close 157 | endif 158 | endif 159 | endif 160 | if '' != &syntax && 161 | \ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' && 162 | \ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name') 163 | \ =~ '\(css\|java\).*' 164 | if a:style == match(getline(a:lnum), '^\s*}') 165 | return HtmlIndentOpenAlt(a:lnum) - HtmlIndentCloseAlt(a:lnum) 166 | endif 167 | endif 168 | return 0 169 | endfun 170 | 171 | fun! s:getSyntaxName(lnum, re) 172 | return synIDattr(synID(a:lnum, match(getline(a:lnum), a:re) + 1, 0), "name") 173 | endfun 174 | 175 | fun! s:isSyntaxElem(lnum, re, elem) 176 | if getline(a:lnum) =~ a:re && s:getSyntaxName(a:lnum, a:re) == a:elem 177 | return 1 178 | endif 179 | return 0 180 | endfun 181 | 182 | fun! HtmlIndentGet(lnum) 183 | " Find a non-empty line above the current line. 184 | let lnum = prevnonblank(a:lnum - 1) 185 | 186 | " Hit the start of the file, use zero indent. 187 | if lnum == 0 188 | return 0 189 | endif 190 | 191 | let restore_ic = &ic 192 | setlocal ic " ignore case 193 | 194 | " [-- special handling for
: no indenting --]
195 |     if getline(a:lnum) =~ '\c
' 196 | \ || 0 < searchpair('\c
', '', '\c
', 'nWb') 197 | \ || 0 < searchpair('\c
', '', '\c
', 'nW') 198 | " we're in a line with or inside
 ... 
199 | if restore_ic == 0 200 | setlocal noic 201 | endif 202 | return -1 203 | endif 204 | 205 | " [-- special handling for : use cindent --] 206 | let js = '', 'nWb') 208 | \ || 0 < searchpair(js, '', '', 'nW') 209 | " we're inside javascript 210 | if getline(lnum) !~ js && getline(a:lnum) !~ js 211 | if restore_ic == 0 212 | setlocal noic 213 | endif 214 | " Open and close bracket: 215 | if s:isSyntaxElem(lnum, '{', "javaScriptBraces") && s:isSyntaxElem(a:lnum, '}', "javaScriptBraces") 216 | return indent(lnum) 217 | elseif s:isSyntaxElem(lnum, '{', "javaScriptBraces") 218 | return indent(lnum) + &sw 219 | elseif s:isSyntaxElem(a:lnum, '}', "javaScriptBraces") 220 | if s:isSyntaxElem(lnum, 'break', 'javaScriptBranch') && ! s:isSyntaxElem(lnum, '\(case\|default\)', "javaScriptLabel") 221 | return indent(lnum) - 2 * &sw 222 | endif 223 | return indent(lnum) - &sw 224 | endif 225 | 226 | " cases: 227 | if s:isSyntaxElem(lnum, '\(case\|default\)', "javaScriptLabel") && s:isSyntaxElem(a:lnum, '\(case\|default\)', "javaScriptLabel") 228 | return indent(lnum) 229 | elseif s:isSyntaxElem(lnum, '\(case\|default\)', "javaScriptLabel") 230 | return indent(lnum) + &sw 231 | elseif s:isSyntaxElem(a:lnum, '\(case\|default\)', "javaScriptLabel") 232 | return indent(lnum) - &sw 233 | endif 234 | 235 | if getline(a:lnum) =~ '\c' 236 | let scriptline = prevnonblank(search(js, 'bW')) 237 | if scriptline > 0 238 | return indent(scriptline) 239 | endif 240 | endif 241 | return indent(lnum) 242 | endif 243 | endif 244 | 245 | if getline(a:lnum) =~ '\c' 253 | " line before the current line a:lnum contains 254 | " a closing . --> search for line before 255 | " starting
 to restore the indent.
256 | 	let preline = prevnonblank(search('\c
', 'bW') - 1)
257 | 	if preline > 0
258 | 	    if restore_ic == 0
259 | 	      setlocal noic
260 | 	    endif
261 | 	    return indent(preline)
262 | 	endif
263 |     endif
264 | 
265 |     let ind = HtmlIndentSum(lnum, -1)
266 |     let ind = ind + HtmlIndentSum(a:lnum, 0)
267 | 
268 |     if restore_ic == 0
269 | 	setlocal noic
270 |     endif
271 | 
272 |     return indent(lnum) + (&sw * ind)
273 | endfun
274 | 
275 | let &cpo = s:cpo_save
276 | unlet s:cpo_save
277 | 
278 | " [-- EOF /indent/html.vim --]
279 | 


--------------------------------------------------------------------------------
/.zsh/func/prompt_grb_setup:
--------------------------------------------------------------------------------
  1 | # grb prompt theme
  2 | # copied from wunjo prompt theme and modified
  3 | 
  4 | autoload -U zgitinit
  5 | zgitinit
  6 | 
  7 | prompt_grb_help () {
  8 |   cat <<'EOF'
  9 | 
 10 |   prompt grb
 11 | 
 12 | EOF
 13 | }
 14 | 
 15 | revstring() {
 16 | 	git describe --always $1 2>/dev/null ||
 17 | 	git rev-parse --short $1 2>/dev/null
 18 | }
 19 | 
 20 | coloratom() {
 21 | 	local off=$1 atom=$2
 22 | 	if [[ $atom[1] == [[:upper:]] ]]; then
 23 | 		off=$(( $off + 60 ))
 24 | 	fi
 25 | 	echo $(( $off + $colorcode[${(L)atom}] ))
 26 | }
 27 | colorword() {
 28 | 	local fg=$1 bg=$2 att=$3
 29 | 	local -a s
 30 | 
 31 | 	if [ -n "$fg" ]; then
 32 | 		s+=$(coloratom 30 $fg)
 33 | 	fi
 34 | 	if [ -n "$bg" ]; then
 35 | 		s+=$(coloratom 40 $bg)
 36 | 	fi
 37 | 	if [ -n "$att" ]; then
 38 | 		s+=$attcode[$att]
 39 | 	fi
 40 | 
 41 | 	echo "%{"$'\e['${(j:;:)s}m"%}"
 42 | }
 43 | 
 44 | function minutes_since_last_commit {
 45 |     now=`date +%s`
 46 |     last_commit=`git log --pretty=format:'%at' -1 2>/dev/null`
 47 |     if $lastcommit ; then
 48 |       seconds_since_last_commit=$((now-last_commit))
 49 |       minutes_since_last_commit=$((seconds_since_last_commit/60))
 50 |       echo $minutes_since_last_commit
 51 |     else
 52 |       echo "-1"
 53 |     fi
 54 | }
 55 | 
 56 | function prompt_grb_scm_time_since_commit() {
 57 | 	local -A pc
 58 | 	pc=(${(kv)wunjo_prompt_colors})
 59 | 
 60 | 	if zgit_inworktree; then
 61 |         local MINUTES_SINCE_LAST_COMMIT=`minutes_since_last_commit`
 62 |         if [ "$MINUTES_SINCE_LAST_COMMIT" -eq -1 ]; then
 63 |           COLOR="$pc[scm_time_uncommitted]"
 64 |           local SINCE_LAST_COMMIT="${COLOR}uncommitted$pc[reset]"  
 65 |         else
 66 |           if [ "$MINUTES_SINCE_LAST_COMMIT" -gt 30 ]; then
 67 |             COLOR="$pc[scm_time_long]"
 68 |           elif [ "$MINUTES_SINCE_LAST_COMMIT" -gt 10 ]; then
 69 |             COLOR="$pc[scm_time_medium]"
 70 |           else
 71 |             COLOR="$pc[scm_time_short]"
 72 |           fi
 73 |           local SINCE_LAST_COMMIT="${COLOR}$(minutes_since_last_commit)m$pc[reset]"
 74 |         fi
 75 |         echo $SINCE_LAST_COMMIT
 76 |     fi
 77 | }
 78 | 
 79 | function prompt_grb_scm_info() {
 80 |     if zgit_inworktree; then
 81 |         echo "($(prompt_wunjo_scm_branch))"
 82 |     fi
 83 | }
 84 | 
 85 | prompt_grb_setup() {
 86 |     local verbose
 87 |     if [[ $TERM == screen* ]] && [ -n "$STY" ]; then
 88 |       verbose=
 89 |     else
 90 |       verbose=1
 91 |     fi
 92 |   
 93 |     typeset -A colorcode
 94 |     colorcode[black]=0
 95 |     colorcode[red]=1
 96 |     colorcode[green]=2
 97 |     colorcode[yellow]=3
 98 |     colorcode[blue]=4
 99 |     colorcode[magenta]=5
100 |     colorcode[cyan]=6
101 |     colorcode[white]=7
102 |     colorcode[default]=9
103 |     colorcode[k]=$colorcode[black]
104 |     colorcode[r]=$colorcode[red]
105 |     colorcode[g]=$colorcode[green]
106 |     colorcode[y]=$colorcode[yellow]
107 |     colorcode[b]=$colorcode[blue]
108 |     colorcode[m]=$colorcode[magenta]
109 |     colorcode[c]=$colorcode[cyan]
110 |     colorcode[w]=$colorcode[white]
111 |     colorcode[.]=$colorcode[default]
112 |   
113 |     typeset -A attcode
114 |     attcode[none]=00
115 |     attcode[bold]=01
116 |     attcode[faint]=02
117 |     attcode[standout]=03
118 |     attcode[underline]=04
119 |     attcode[blink]=05
120 |     attcode[reverse]=07
121 |     attcode[conceal]=08
122 |     attcode[normal]=22
123 |     attcode[no-standout]=23
124 |     attcode[no-underline]=24
125 |     attcode[no-blink]=25
126 |     attcode[no-reverse]=27
127 |     attcode[no-conceal]=28
128 |   
129 |     local -A pc
130 |     pc[default]='default'
131 |     pc[date]='cyan'
132 |     pc[time]='Blue'
133 |     pc[host]='Green'
134 |     pc[user]='cyan'
135 |     pc[punc]='yellow'
136 |     pc[line]='magenta'
137 |     pc[hist]='green'
138 |     pc[path]='Cyan'
139 |     pc[shortpath]='default'
140 |     pc[rc]='red'
141 |     pc[scm_branch]='green'
142 |     pc[scm_commitid]='Yellow'
143 |     pc[scm_status_dirty]='Red'
144 |     pc[scm_status_staged]='Green'
145 |     pc[scm_time_short]='green'
146 |     pc[scm_time_medium]='yellow'
147 |     pc[scm_time_long]='red'
148 |     pc[scm_time_uncommitted]='Magenta'
149 |     pc[#]='Yellow'
150 |     for cn in ${(k)pc}; do
151 |       pc[${cn}]=$(colorword $pc[$cn])
152 |     done
153 |     pc[reset]=$(colorword . . 00)
154 | 
155 | 	typeset -Ag wunjo_prompt_colors
156 | 	wunjo_prompt_colors=(${(kv)pc})
157 | 
158 | 	local p_date p_line p_rc
159 | 
160 | 	p_date="$pc[date]%D{%Y-%m-%d} $pc[time]%D{%T}$pc[reset]"
161 | 
162 | 	p_line="$pc[line]%y$pc[reset]"
163 | 
164 | 	PROMPT=
165 | 	if [ $verbose ]; then
166 | 		PROMPT+="$pc[host]%m$pc[reset]"
167 | 	fi
168 | 	#PROMPT+="$pc[path]%(2~.%~.%/)$pc[reset]"
169 | 	#PROMPT+="\$(prompt_wunjo_scm_status)"
170 | 	#PROMPT+="%(?.. $pc[rc]exited %1v$pc[reset])"
171 | #    PROMPT+="
172 | #"
173 | 	#PROMPT+="($pc[hist]%h$pc[reset])"
174 | 	PROMPT+=":$pc[shortpath]%1~$pc[reset]"
175 |     PROMPT+="($pc[scm_branch]\$(prompt_wunjo_scm_branch)$pc[reset])"
176 | 	PROMPT+=" $pc[#]\$$pc[reset] "
177 | 
178 |     #RPROMPT=
179 |     #if [ $verbose ]; then
180 |     #	RPROMPT+="$p_date "
181 |     #fi
182 |     #RPROMPT+="$pc[user]%n$pc[reset]"
183 |     #RPROMPT+=" $p_line"
184 | 
185 | 	export PROMPT RPROMPT
186 | 	precmd_functions+='prompt_wunjo_precmd'
187 | }
188 | 
189 | prompt_wunjo_precmd() {
190 | 	local ex=$?
191 | 	psvar=()
192 | 
193 | 	if [[ $ex -ge 128 ]]; then
194 | 		sig=$signals[$ex-127]
195 | 		psvar[1]="sig${(L)sig}"
196 | 	else
197 | 		psvar[1]="$ex"
198 | 	fi
199 | }
200 | 
201 | prompt_wunjo_scm_status() {
202 | 	zgit_isgit || return
203 | 	local -A pc
204 | 	pc=(${(kv)wunjo_prompt_colors})
205 | 
206 | 	head=$(zgit_head)
207 | 	gitcommit=$(revstring $head)
208 | 
209 | 	local -a commits
210 | 
211 | 	if zgit_rebaseinfo; then
212 | 		orig_commit=$(revstring $zgit_info[rb_head])
213 | 		orig_name=$(git name-rev --name-only $zgit_info[rb_head])
214 | 		orig="$pc[scm_branch]$orig_name$pc[punc]($pc[scm_commitid]$orig_commit$pc[punc])"
215 | 		onto_commit=$(revstring $zgit_info[rb_onto])
216 | 		onto_name=$(git name-rev --name-only $zgit_info[rb_onto])
217 | 		onto="$pc[scm_branch]$onto_name$pc[punc]($pc[scm_commitid]$onto_commit$pc[punc])"
218 | 
219 | 		if [ -n "$zgit_info[rb_upstream]" ] && [ $zgit_info[rb_upstream] != $zgit_info[rb_onto] ]; then
220 | 			upstream_commit=$(revstring $zgit_info[rb_upstream])
221 | 			upstream_name=$(git name-rev --name-only $zgit_info[rb_upstream])
222 | 			upstream="$pc[scm_branch]$upstream_name$pc[punc]($pc[scm_commitid]$upstream_commit$pc[punc])"
223 | 			commits+="rebasing $upstream$pc[reset]..$orig$pc[reset] onto $onto$pc[reset]"
224 | 		else
225 | 			commits+="rebasing $onto$pc[reset]..$orig$pc[reset]"
226 | 		fi
227 | 
228 | 		local -a revs
229 | 		revs=($(git rev-list $zgit_info[rb_onto]..HEAD))
230 | 		if [ $#revs -gt 0 ]; then
231 | 			commits+="\n$#revs commits in"
232 | 		fi
233 | 
234 | 		if [ -f $zgit_info[dotest]/message ]; then
235 | 			mess=$(head -n1 $zgit_info[dotest]/message)
236 | 			commits+="on $mess"
237 | 		fi
238 | 	elif [ -n "$gitcommit" ]; then
239 | 		commits+="on $pc[scm_branch]$head$pc[punc]($pc[scm_commitid]$gitcommit$pc[punc])$pc[reset]"
240 | 		local track_merge=$(zgit_tracking_merge)
241 | 		if [ -n "$track_merge" ]; then
242 | 			if git rev-parse --verify -q $track_merge >/dev/null; then
243 | 				local track_remote=$(zgit_tracking_remote)
244 | 				local tracked=$(revstring $track_merge 2>/dev/null)
245 | 
246 | 				local -a revs
247 | 				revs=($(git rev-list --reverse $track_merge..HEAD))
248 | 				if [ $#revs -gt 0 ]; then
249 | 					local base=$(revstring $revs[1]~1)
250 | 					local base_name=$(git name-rev --name-only $base)
251 | 					local base_short=$(revstring $base)
252 | 					local word_commits
253 | 					if [ $#revs -gt 1 ]; then
254 | 						word_commits='commits'
255 | 					else
256 | 						word_commits='commit'
257 | 					fi
258 | 
259 | 					local conj="since"
260 | 					if [[ "$base" == "$tracked" ]]; then
261 | 						conj+=" tracked"
262 | 						tracked=
263 | 					fi
264 | 					commits+="$#revs $word_commits $conj $pc[scm_branch]$base_name$pc[punc]($pc[scm_commitid]$base_short$pc[punc])$pc[reset]"
265 | 				fi
266 | 
267 | 				if [ -n "$tracked" ]; then
268 | 					local track_name=$track_merge
269 | 					if [[ $track_remote == "." ]]; then
270 | 						track_name=${track_name##*/}
271 | 					fi
272 | 					tracked=$(revstring $tracked)
273 | 					commits+="tracking $pc[scm_branch]$track_name$pc[punc]"
274 | 					if [[ "$tracked" != "$gitcommit" ]]; then
275 | 						commits[$#commits]+="($pc[scm_commitid]$tracked$pc[punc])"
276 | 					fi
277 | 					commits[$#commits]+="$pc[reset]"
278 | 				fi
279 | 			fi
280 | 		fi
281 | 	fi
282 | 
283 | 	gitsvn=$(git rev-parse --verify -q --short git-svn)
284 | 	if [ $? -eq 0 ]; then
285 | 		gitsvnrev=$(zgit_svnhead $gitsvn)
286 | 		gitsvn=$(revstring $gitsvn)
287 | 		if [ -n "$gitsvnrev" ]; then
288 | 			local svninfo=''
289 | 			local -a revs
290 | 			svninfo+="$pc[default]svn$pc[punc]:$pc[scm_branch]r$gitsvnrev"
291 | 			revs=($(git rev-list git-svn..HEAD))
292 | 			if [ $#revs -gt 0 ]; then
293 | 				svninfo+="$pc[punc]@$pc[default]HEAD~$#revs"
294 | 				svninfo+="$pc[punc]($pc[scm_commitid]$gitsvn$pc[punc])"
295 | 			fi
296 | 			commits+=$svninfo
297 | 		fi
298 | 	fi
299 | 
300 | 	if [ $#commits -gt 0 ]; then
301 | 		echo -n " ${(j: :)commits}"
302 | 	fi
303 | }
304 | 
305 | prompt_wunjo_scm_branch() {
306 | 	zgit_isgit || return
307 | 	local -A pc
308 | 	pc=(${(kv)wunjo_prompt_colors})
309 | 
310 | 	echo -n "$pc[punc]$pc[scm_branch]$(zgit_head)"
311 | 
312 | 	if zgit_inworktree; then
313 | 		if ! zgit_isindexclean; then
314 | 			echo -n "$pc[scm_status_staged]+"
315 | 		fi
316 | 
317 | 		local -a dirty
318 | 		if ! zgit_isworktreeclean; then
319 | 			dirty+='!'
320 | 		fi
321 | 
322 | 		if zgit_hasunmerged; then
323 | 			dirty+='*'
324 | 		fi
325 | 
326 | 		if zgit_hasuntracked; then
327 | 			dirty+='?'
328 | 		fi
329 | 
330 | 		if [ $#dirty -gt 0 ]; then
331 | 			echo -n "$pc[scm_status_dirty]${(j::)dirty}"
332 | 		fi
333 | 	fi
334 | 
335 | 	echo $pc[reset]
336 | }
337 | 
338 | prompt_grb_setup "$@"
339 | 
340 | # vim:set ft=zsh:
341 | 


--------------------------------------------------------------------------------
/.vim/colors/moria.vim:
--------------------------------------------------------------------------------
  1 | if exists("g:moria_style")
  2 |     let s:moria_style = g:moria_style
  3 | else
  4 |     let s:moria_style = &background
  5 | endif
  6 | 
  7 | if exists("g:moria_fontface")
  8 |     let s:moria_fontface = g:moria_fontface
  9 | else
 10 |     let s:moria_fontface = "plain"
 11 | endif
 12 | 
 13 | execute "command! -nargs=1 Colo let g:moria_style = \"\" | colo moria"
 14 | 
 15 | if s:moria_style == "black" || s:moria_style == "dark" || s:moria_style == "darkslategray"
 16 |     set background=dark
 17 | elseif s:moria_style == "light" || s:moria_style == "white"
 18 |     set background=light
 19 | else
 20 |     let s:moria_style = &background 
 21 | endif
 22 | 
 23 | hi clear
 24 | 
 25 | if exists("syntax_on")
 26 |     syntax reset
 27 | endif
 28 | 
 29 | let colors_name = "moria"
 30 | 
 31 | if &background == "dark"
 32 |     if s:moria_style == "darkslategray"
 33 |         hi Normal ctermbg=0 ctermfg=7 guibg=#2f4f4f guifg=#d0d0d0 gui=none
 34 | 
 35 |         hi CursorColumn guibg=#404040 gui=none
 36 |         hi CursorLine guibg=#404040 gui=none
 37 |         hi FoldColumn ctermbg=bg guibg=bg guifg=#9cc5c5 gui=none
 38 |         hi LineNr guifg=#9cc5c5 gui=none
 39 |         hi NonText ctermfg=8 guibg=bg guifg=#9cc5c5 gui=bold
 40 |         hi Pmenu guibg=#75acac guifg=#000000 gui=none
 41 |         hi PmenuSbar guibg=#538c8c guifg=fg gui=none
 42 |         hi PmenuThumb guibg=#c5dcdc guifg=bg gui=none
 43 |         hi SignColumn ctermbg=bg guibg=bg guifg=#9cc5c5 gui=none
 44 |         hi StatusLine ctermbg=7 ctermfg=0 guibg=#477878 guifg=fg gui=bold
 45 |         hi StatusLineNC ctermbg=8 ctermfg=0 guibg=#3c6464 guifg=fg gui=none
 46 |         hi TabLine guibg=#4d8080 guifg=fg gui=underline
 47 |         hi TabLineFill guibg=#4d8080 guifg=fg gui=underline
 48 |         hi VertSplit ctermbg=7 ctermfg=0 guibg=#3c6464 guifg=fg gui=none
 49 |         if version >= 700
 50 |             hi Visual ctermbg=7 ctermfg=0 guibg=#538c8c gui=none
 51 |         else
 52 |             hi Visual ctermbg=7 ctermfg=0 guibg=#538c8c guifg=fg gui=none
 53 |         endif
 54 |         hi VisualNOS guibg=bg guifg=#88b9b9 gui=bold,underline
 55 | 
 56 |         if s:moria_fontface == "mixed"
 57 |             hi Folded guibg=#585858 guifg=#c5dcdc gui=bold
 58 |         else
 59 |             hi Folded guibg=#585858 guifg=#c5dcdc gui=none
 60 |         endif
 61 |     else
 62 |         if s:moria_style == "dark"
 63 |             hi Normal ctermbg=0 ctermfg=7 guibg=#2a2a2a guifg=#d0d0d0 gui=none
 64 | 
 65 |             hi CursorColumn guibg=#444444 gui=none
 66 |             hi CursorLine guibg=#444444 gui=none
 67 |         elseif s:moria_style == "black"
 68 |             hi Normal ctermbg=0 ctermfg=7 guibg=#000000 guifg=#d0d0d0 gui=none
 69 | 
 70 |             hi CursorColumn guibg=#3a3a3a gui=none
 71 |             hi CursorLine guibg=#3a3a3a gui=none
 72 |         endif
 73 |         hi FoldColumn ctermbg=bg guibg=bg guifg=#98a9c9 gui=none
 74 |         hi LineNr guifg=#98a9c9 gui=none
 75 |         hi NonText ctermfg=8 guibg=bg guifg=#98a9c9 gui=bold
 76 |         hi Pmenu guibg=#6f86b3 guifg=#000000 gui=none
 77 |         hi PmenuSbar guibg=#4e6592 guifg=fg gui=none
 78 |         hi PmenuThumb guibg=#c1ccdf guifg=bg gui=none
 79 |         hi SignColumn ctermbg=bg guibg=bg guifg=#98a9c9 gui=none
 80 |         hi StatusLine ctermbg=7 ctermfg=0 guibg=#3d5074 guifg=fg gui=bold
 81 |         hi StatusLineNC ctermbg=8 ctermfg=0 guibg=#2c3954 guifg=fg gui=none
 82 |         hi TabLine guibg=#465c86 guifg=fg gui=underline
 83 |         hi TabLineFill guibg=#465c86 guifg=fg gui=underline
 84 |         hi VertSplit ctermbg=7 ctermfg=0 guibg=#2c3954 guifg=fg gui=none
 85 |         if version >= 700
 86 |             hi Visual ctermbg=7 ctermfg=0 guibg=#4e6592 gui=none
 87 |         else
 88 |             hi Visual ctermbg=7 ctermfg=0 guibg=#4e6592 guifg=fg gui=none
 89 |         endif
 90 |         hi VisualNOS guibg=bg guifg=#8498bd gui=bold,underline
 91 | 
 92 |         if s:moria_fontface == "mixed"
 93 |             hi Folded guibg=#585858 guifg=#c1ccdf gui=bold
 94 |         else
 95 |             hi Folded guibg=#585858 guifg=#c1ccdf gui=none
 96 |         endif
 97 |     endif
 98 |     hi Cursor guibg=#ffa500 guifg=bg gui=none
 99 |     hi DiffAdd guibg=#008b00 guifg=fg gui=none
100 |     hi DiffChange guibg=#00008b guifg=fg gui=none
101 |     hi DiffDelete guibg=#8b0000 guifg=fg gui=none
102 |     hi DiffText guibg=#0000cd guifg=fg gui=bold
103 |     hi Directory guibg=bg guifg=#1e90ff gui=none
104 |     hi ErrorMsg guibg=#ee2c2c guifg=#ffffff gui=bold
105 |     hi IncSearch guibg=#e0cd78 guifg=#000000 gui=none
106 |     hi ModeMsg guibg=bg guifg=fg gui=bold
107 |     hi MoreMsg guibg=bg guifg=#7ec0ee gui=bold
108 |     hi PmenuSel guibg=#e0e000 guifg=#000000 gui=none
109 |     hi Question guibg=bg guifg=#e8b87e gui=bold
110 |     hi Search guibg=#90e090 guifg=#000000 gui=none
111 |     hi SpecialKey guibg=bg guifg=#e8b87e gui=none
112 |     if has("spell")
113 |         hi SpellBad guisp=#ee2c2c gui=undercurl
114 |         hi SpellCap guisp=#2c2cee gui=undercurl
115 |         hi SpellLocal guisp=#2ceeee gui=undercurl
116 |         hi SpellRare guisp=#ee2cee gui=undercurl
117 |     endif
118 |     hi TabLineSel guibg=bg guifg=fg gui=bold
119 |     hi Title ctermbg=0 ctermfg=15 guifg=fg gui=bold
120 |     hi WarningMsg guibg=bg guifg=#ee2c2c gui=bold
121 |     hi WildMenu guibg=#e0e000 guifg=#000000 gui=bold
122 | 
123 |     hi Comment guibg=bg guifg=#d0d0a0 gui=none
124 |     hi Constant guibg=bg guifg=#87df71 gui=none
125 |     hi Error guibg=bg guifg=#ee2c2c gui=none
126 |     hi Identifier guibg=bg guifg=#7ee0ce gui=none
127 |     hi Ignore guibg=bg guifg=bg gui=none
128 |     hi lCursor guibg=#00e700 guifg=#000000 gui=none
129 |     hi MatchParen guibg=#008b8b gui=none
130 |     hi PreProc guibg=bg guifg=#d7a0d7 gui=none
131 |     hi Special guibg=bg guifg=#e8b87e gui=none
132 |     hi Todo guibg=#e0e000 guifg=#000000 gui=none
133 |     hi Underlined guibg=bg guifg=#00a0ff gui=underline    
134 | 
135 |     if s:moria_fontface == "mixed"
136 |         hi Statement guibg=bg guifg=#7ec0ee gui=bold
137 |         hi Type guibg=bg guifg=#f09479 gui=bold
138 |     else
139 |         hi Statement guibg=bg guifg=#7ec0ee gui=none
140 |         hi Type guibg=bg guifg=#f09479 gui=none
141 |     endif
142 | 
143 |     hi htmlBold ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold
144 |     hi htmlItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=italic
145 |     hi htmlUnderline ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=underline
146 |     hi htmlBoldItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold,italic
147 |     hi htmlBoldUnderline ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold,underline
148 |     hi htmlBoldUnderlineItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=bold,underline,italic
149 |     hi htmlUnderlineItalic ctermbg=0 ctermfg=15 guibg=bg guifg=fg gui=underline,italic
150 | elseif &background == "light"
151 |     if s:moria_style == "light"
152 |         hi Normal ctermbg=15 ctermfg=0 guibg=#f0f0f0 guifg=#000000 gui=none
153 | 
154 |         hi CursorColumn guibg=#d4d4d4 gui=none
155 |         hi CursorLine guibg=#d4d4d4 gui=none
156 |     elseif s:moria_style == "white"
157 |         hi Normal ctermbg=15 ctermfg=0 guibg=#ffffff guifg=#000000 gui=none
158 | 
159 |         hi CursorColumn guibg=#dbdbdb gui=none
160 |         hi CursorLine guibg=#dbdbdb gui=none
161 |     endif
162 |     hi Cursor guibg=#883400 guifg=bg gui=none
163 |     hi DiffAdd guibg=#008b00 guifg=#ffffff gui=none
164 |     hi DiffChange guibg=#00008b guifg=#ffffff gui=none
165 |     hi DiffDelete guibg=#8b0000 guifg=#ffffff gui=none
166 |     hi DiffText guibg=#0000cd guifg=#ffffff gui=bold
167 |     hi Directory guibg=bg guifg=#0000f0 gui=none
168 |     hi ErrorMsg guibg=#ee2c2c guifg=#ffffff gui=bold
169 |     hi FoldColumn ctermbg=bg guibg=bg guifg=#42577d gui=none
170 |     hi Folded guibg=#c5c5c5 guifg=#2c3954 gui=bold
171 |     hi IncSearch guibg=#ffcd78 gui=none
172 |     hi LineNr guifg=#42577d gui=none
173 |     hi ModeMsg ctermbg=15 ctermfg=0 guibg=bg guifg=fg gui=bold
174 |     hi MoreMsg guibg=bg guifg=#1f3f81 gui=bold
175 |     hi NonText ctermfg=8 guibg=bg guifg=#42577d gui=bold
176 |     hi Pmenu guibg=#7b91b9 guifg=#000000 gui=none
177 |     hi PmenuSbar guibg=#5874a7 guifg=fg gui=none
178 |     hi PmenuSel guibg=#ffff00 guifg=#000000 gui=none
179 |     hi PmenuThumb guibg=#adbbd3 guifg=fg gui=none
180 |     hi Question guibg=bg guifg=#813f11 gui=bold
181 |     hi Search guibg=#a0f0a0 gui=none
182 |     hi SignColumn ctermbg=bg guibg=bg guifg=#42577d gui=none
183 |     hi SpecialKey guibg=bg guifg=#912f11 gui=none
184 |     if has("spell")
185 |         hi SpellBad guisp=#ee2c2c gui=undercurl
186 |         hi SpellCap guisp=#2c2cee gui=undercurl
187 |         hi SpellLocal guisp=#008b8b gui=undercurl
188 |         hi SpellRare guisp=#ee2cee gui=undercurl
189 |     endif
190 |     hi StatusLine ctermbg=0 ctermfg=15 guibg=#98a9c9 guifg=fg gui=bold
191 |     hi StatusLineNC ctermbg=7 ctermfg=0 guibg=#adbbd3 guifg=fg gui=none
192 |     hi TabLine guibg=#b1bed6 guifg=fg gui=underline
193 |     hi TabLineFill guibg=#b1bed6 guifg=fg gui=underline
194 |     hi TabLineSel guibg=bg guifg=fg gui=bold
195 |     hi Title guifg=fg gui=bold
196 |     hi VertSplit ctermbg=7 ctermfg=0 guibg=#adbbd3 guifg=fg gui=none
197 |     if version >= 700
198 |         hi Visual ctermbg=7 ctermfg=0 guibg=#c1ccdf gui=none
199 |     else
200 |         hi Visual ctermbg=7 ctermfg=0 guibg=#c1ccdf guifg=fg gui=none
201 |     endif    
202 |     hi VisualNOS guibg=bg guifg=#8498bd gui=bold,underline
203 |     hi WarningMsg guibg=bg guifg=#ee2c2c gui=bold
204 |     hi WildMenu guibg=#ffff00 guifg=fg gui=bold
205 | 
206 |     hi Comment guibg=bg guifg=#786000 gui=none
207 |     hi Constant guibg=bg guifg=#077807 gui=none
208 |     hi Error guibg=bg guifg=#ee2c2c gui=none
209 |     hi Identifier guibg=bg guifg=#007080 gui=none
210 |     hi Ignore guibg=bg guifg=bg gui=none
211 |     hi lCursor guibg=#008000 guifg=#ffffff gui=none
212 |     hi MatchParen guibg=#00ffff gui=none
213 |     hi PreProc guibg=bg guifg=#800090 gui=none
214 |     hi Special guibg=bg guifg=#912f11 gui=none
215 |     hi Statement guibg=bg guifg=#1f3f81 gui=bold
216 |     hi Todo guibg=#ffff00 guifg=fg gui=none
217 |     hi Type guibg=bg guifg=#912f11 gui=bold
218 |     hi Underlined guibg=bg guifg=#0000cd gui=underline
219 | 
220 |     hi htmlBold guibg=bg guifg=fg gui=bold
221 |     hi htmlItalic guibg=bg guifg=fg gui=italic
222 |     hi htmlUnderline guibg=bg guifg=fg gui=underline
223 |     hi htmlBoldItalic guibg=bg guifg=fg gui=bold,italic
224 |     hi htmlBoldUnderline guibg=bg guifg=fg gui=bold,underline
225 |     hi htmlBoldUnderlineItalic guibg=bg guifg=fg gui=bold,underline,italic
226 |     hi htmlUnderlineItalic guibg=bg guifg=fg gui=underline,italic
227 | endif
228 | 


--------------------------------------------------------------------------------
/.vim/colors/ir_black.vim:
--------------------------------------------------------------------------------
  1 | " ir_black color scheme
  2 | " More at: http://blog.infinitered.com/entries/show/8
  3 | 
  4 | 
  5 | " ********************************************************************************
  6 | " Standard colors used in all ir_black themes:
  7 | " Note, x:x:x are RGB values
  8 | "
  9 | "  normal: #f6f3e8
 10 | " 
 11 | "  string: #A8FF60  168:255:96                   
 12 | "    string inner (punc, code, etc): #00A0A0  0:160:160
 13 | "  number: #FF73FD  255:115:253                 
 14 | "  comments: #7C7C7C  124:124:124
 15 | "  keywords: #96CBFE  150:203:254             
 16 | "  operators: white
 17 | "  class: #FFFFB6  255:255:182
 18 | "  method declaration name: #FFD2A7  255:210:167
 19 | "  regular expression: #E9C062  233:192:98
 20 | "    regexp alternate: #FF8000  255:128:0
 21 | "    regexp alternate 2: #B18A3D  177:138:61
 22 | "  variable: #C6C5FE  198:197:254
 23 | "  
 24 | " Misc colors:
 25 | "  red color (used for whatever): #FF6C60   255:108:96 
 26 | "     light red: #FFB6B0   255:182:176
 27 | "
 28 | "  brown: #E18964  good for special
 29 | "
 30 | "  lightpurpleish: #FFCCFF
 31 | " 
 32 | " Interface colors:
 33 | "  background color: black
 34 | "  cursor (where underscore is used): #FFA560  255:165:96
 35 | "  cursor (where block is used): white
 36 | "  visual selection: #1D1E2C  
 37 | "  current line: #151515  21:21:21
 38 | "  search selection: #07281C  7:40:28
 39 | "  line number: #3D3D3D  61:61:61
 40 | 
 41 | 
 42 | " ********************************************************************************
 43 | " The following are the preferred 16 colors for your terminal
 44 | "           Colors      Bright Colors
 45 | " Black     #4E4E4E     #7C7C7C
 46 | " Red       #FF6C60     #FFB6B0
 47 | " Green     #A8FF60     #CEFFAB
 48 | " Yellow    #FFFFB6     #FFFFCB
 49 | " Blue      #96CBFE     #FFFFCB
 50 | " Magenta   #FF73FD     #FF9CFE
 51 | " Cyan      #C6C5FE     #DFDFFE
 52 | " White     #EEEEEE     #FFFFFF
 53 | 
 54 | 
 55 | " ********************************************************************************
 56 | set background=dark
 57 | hi clear
 58 | 
 59 | if exists("syntax_on")
 60 |   syntax reset
 61 | endif
 62 | 
 63 | let colors_name = "ir_black"
 64 | 
 65 | 
 66 | "hi Example         guifg=NONE        guibg=NONE        gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
 67 | 
 68 | " General colors
 69 | hi Normal           guifg=#f6f3e8     guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
 70 | hi NonText          guifg=#070707     guibg=black       gui=NONE      ctermfg=black       ctermbg=NONE        cterm=NONE
 71 | 
 72 | hi Cursor           guifg=black       guibg=white       gui=NONE      ctermfg=black       ctermbg=white       cterm=reverse
 73 | hi LineNr           guifg=#3D3D3D     guibg=black       gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
 74 | 
 75 | hi VertSplit        guifg=#202020     guibg=#202020     gui=NONE      ctermfg=darkgray    ctermbg=darkgray    cterm=NONE
 76 | hi StatusLine       guifg=#CCCCCC     guibg=#202020     gui=italic    ctermfg=white       ctermbg=darkgray    cterm=NONE
 77 | hi StatusLineNC     guifg=black       guibg=#202020     gui=NONE      ctermfg=blue        ctermbg=darkgray    cterm=NONE  
 78 | 
 79 | hi Folded           guifg=#a0a8b0     guibg=#384048     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
 80 | hi Title            guifg=#f6f3e8     guibg=NONE        gui=bold      ctermfg=NONE        ctermbg=NONE        cterm=NONE
 81 | hi Visual           guifg=NONE        guibg=#262D51     gui=NONE      ctermfg=NONE        ctermbg=darkgray    cterm=NONE
 82 | 
 83 | hi SpecialKey       guifg=#808080     guibg=#343434     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
 84 | 
 85 | hi WildMenu         guifg=green       guibg=yellow      gui=NONE      ctermfg=black       ctermbg=yellow      cterm=NONE
 86 | hi PmenuSbar        guifg=black       guibg=white       gui=NONE      ctermfg=black       ctermbg=white       cterm=NONE
 87 | "hi Ignore           guifg=gray        guibg=black       gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
 88 | 
 89 | hi Error            guifg=NONE        guibg=NONE        gui=undercurl ctermfg=white       ctermbg=red         cterm=NONE     guisp=#FF6C60 " undercurl color
 90 | hi ErrorMsg         guifg=white       guibg=#FF6C60     gui=BOLD      ctermfg=white       ctermbg=red         cterm=NONE
 91 | hi WarningMsg       guifg=white       guibg=#FF6C60     gui=BOLD      ctermfg=white       ctermbg=red         cterm=NONE
 92 | 
 93 | " Message displayed in lower left, such as --INSERT--
 94 | hi ModeMsg          guifg=black       guibg=#C6C5FE     gui=BOLD      ctermfg=black       ctermbg=cyan        cterm=BOLD
 95 | 
 96 | if version >= 700 " Vim 7.x specific colors
 97 |   hi CursorLine     guifg=NONE        guibg=#121212     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=BOLD
 98 |   hi CursorColumn   guifg=NONE        guibg=#121212     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=BOLD
 99 |   hi MatchParen     guifg=#f6f3e8     guibg=#857b6f     gui=BOLD      ctermfg=white       ctermbg=darkgray    cterm=NONE
100 |   hi Pmenu          guifg=#f6f3e8     guibg=#444444     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
101 |   hi PmenuSel       guifg=#000000     guibg=#cae682     gui=NONE      ctermfg=NONE        ctermbg=NONE        cterm=NONE
102 |   hi Search         guifg=NONE        guibg=NONE        gui=underline ctermfg=NONE        ctermbg=NONE        cterm=underline
103 | endif
104 | 
105 | " Syntax highlighting
106 | hi Comment          guifg=#7C7C7C     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
107 | hi String           guifg=#A8FF60     guibg=NONE        gui=NONE      ctermfg=green       ctermbg=NONE        cterm=NONE
108 | hi Number           guifg=#FF73FD     guibg=NONE        gui=NONE      ctermfg=magenta     ctermbg=NONE        cterm=NONE
109 | 
110 | hi Keyword          guifg=#96CBFE     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE
111 | hi PreProc          guifg=#96CBFE     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE
112 | hi Conditional      guifg=#6699CC     guibg=NONE        gui=NONE      ctermfg=blue        ctermbg=NONE        cterm=NONE  " if else end
113 | 
114 | hi Todo             guifg=#8f8f8f     guibg=NONE        gui=NONE      ctermfg=red         ctermbg=NONE        cterm=NONE
115 | hi Constant         guifg=#99CC99     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
116 | 
117 | hi Identifier       guifg=#C6C5FE     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
118 | hi Function         guifg=#FFD2A7     guibg=NONE        gui=NONE      ctermfg=brown       ctermbg=NONE        cterm=NONE
119 | hi Type             guifg=#FFFFB6     guibg=NONE        gui=NONE      ctermfg=yellow      ctermbg=NONE        cterm=NONE
120 | hi Statement        guifg=#6699CC     guibg=NONE        gui=NONE      ctermfg=lightblue   ctermbg=NONE        cterm=NONE
121 | 
122 | hi Special          guifg=#E18964     guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
123 | hi Delimiter        guifg=#00A0A0     guibg=NONE        gui=NONE      ctermfg=cyan        ctermbg=NONE        cterm=NONE
124 | hi Operator         guifg=white       guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
125 | 
126 | hi link Character       Constant
127 | hi link Boolean         Constant
128 | hi link Float           Number
129 | hi link Repeat          Statement
130 | hi link Label           Statement
131 | hi link Exception       Statement
132 | hi link Include         PreProc
133 | hi link Define          PreProc
134 | hi link Macro           PreProc
135 | hi link PreCondit       PreProc
136 | hi link StorageClass    Type
137 | hi link Structure       Type
138 | hi link Typedef         Type
139 | hi link Tag             Special
140 | hi link SpecialChar     Special
141 | hi link SpecialComment  Special
142 | hi link Debug           Special
143 | 
144 | 
145 | " Special for Ruby
146 | hi rubyRegexp                  guifg=#B18A3D      guibg=NONE      gui=NONE      ctermfg=brown          ctermbg=NONE      cterm=NONE
147 | hi rubyRegexpDelimiter         guifg=#FF8000      guibg=NONE      gui=NONE      ctermfg=brown          ctermbg=NONE      cterm=NONE
148 | hi rubyEscape                  guifg=white        guibg=NONE      gui=NONE      ctermfg=cyan           ctermbg=NONE      cterm=NONE
149 | hi rubyInterpolationDelimiter  guifg=#00A0A0      guibg=NONE      gui=NONE      ctermfg=blue           ctermbg=NONE      cterm=NONE
150 | hi rubyControl                 guifg=#6699CC      guibg=NONE      gui=NONE      ctermfg=blue           ctermbg=NONE      cterm=NONE  "and break, etc
151 | "hi rubyGlobalVariable          guifg=#FFCCFF      guibg=NONE      gui=NONE      ctermfg=lightblue      ctermbg=NONE      cterm=NONE  "yield
152 | hi rubyStringDelimiter         guifg=#336633      guibg=NONE      gui=NONE      ctermfg=lightgreen     ctermbg=NONE      cterm=NONE
153 | "rubyInclude
154 | "rubySharpBang
155 | "rubyAccess
156 | "rubyPredefinedVariable
157 | "rubyBoolean
158 | "rubyClassVariable
159 | "rubyBeginEnd
160 | "rubyRepeatModifier
161 | "hi link rubyArrayDelimiter    Special  " [ , , ]
162 | "rubyCurlyBlock  { , , }
163 | 
164 | hi link rubyClass             Keyword 
165 | hi link rubyModule            Keyword 
166 | hi link rubyKeyword           Keyword 
167 | hi link rubyOperator          Operator
168 | hi link rubyIdentifier        Identifier
169 | hi link rubyInstanceVariable  Identifier
170 | hi link rubyGlobalVariable    Identifier
171 | hi link rubyClassVariable     Identifier
172 | hi link rubyConstant          Type  
173 | 
174 | 
175 | " Special for Java
176 | " hi link javaClassDecl    Type
177 | hi link javaScopeDecl         Identifier 
178 | hi link javaCommentTitle      javaDocSeeTag 
179 | hi link javaDocTags           javaDocSeeTag 
180 | hi link javaDocParam          javaDocSeeTag 
181 | hi link javaDocSeeTagParam    javaDocSeeTag 
182 | 
183 | hi javaDocSeeTag              guifg=#CCCCCC     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
184 | hi javaDocSeeTag              guifg=#CCCCCC     guibg=NONE        gui=NONE      ctermfg=darkgray    ctermbg=NONE        cterm=NONE
185 | "hi javaClassDecl              guifg=#CCFFCC     guibg=NONE        gui=NONE      ctermfg=white       ctermbg=NONE        cterm=NONE
186 | 
187 | 
188 | " Special for XML
189 | hi link xmlTag          Keyword 
190 | hi link xmlTagName      Conditional 
191 | hi link xmlEndTag       Identifier 
192 | 
193 | 
194 | " Special for HTML
195 | hi link htmlTag         Keyword 
196 | hi link htmlTagName     Conditional 
197 | hi link htmlEndTag      Identifier 
198 | 
199 | 
200 | " Special for Javascript
201 | hi link javaScriptNumber      Number 
202 | 
203 | 
204 | " Special for Python
205 | "hi  link pythonEscape         Keyword      
206 | 
207 | 
208 | " Special for CSharp
209 | hi  link csXmlTag             Keyword      
210 | 
211 | 
212 | " Special for PHP
213 | 


--------------------------------------------------------------------------------