From 7fffd3a68ef4712da4baab9646c7fc3ee019506f Mon Sep 17 00:00:00 2001 From: Adam Eivy Date: Thu, 24 May 2012 12:35:28 -0700 Subject: [PATCH] ported and working, so far --- .crontab | 4 + .gemrc | 10 + .gitconfig | 223 +++++++ .gitignore | 0 .gitmodules | 6 + .hgrc | 9 + .profile | 19 + .rvmrc | 1 + .screenrc | 16 + .shellaliases | 75 +++ .shellfn | 43 ++ .shellpaths | 19 + .shellvars | 25 + .vim/autoload/pathogen.vim | 245 ++++++++ .vim/colors/solarized.vim | 1117 ++++++++++++++++++++++++++++++++++++ .vimrc | 183 ++++++ .zlogout | 3 + .zprofile | 23 + .zshenv | 2 + .zshrc | 29 + README.md | 32 +- _setupdotfiles.zsh | 60 ++ 22 files changed, 2141 insertions(+), 3 deletions(-) create mode 100644 .crontab create mode 100644 .gemrc create mode 100644 .gitconfig create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .hgrc create mode 100644 .profile create mode 100644 .rvmrc create mode 100644 .screenrc create mode 100644 .shellaliases create mode 100644 .shellfn create mode 100644 .shellpaths create mode 100644 .shellvars create mode 100644 .vim/autoload/pathogen.vim create mode 100755 .vim/colors/solarized.vim create mode 100644 .vimrc create mode 100644 .zlogout create mode 100644 .zprofile create mode 100644 .zshenv create mode 100644 .zshrc create mode 100755 _setupdotfiles.zsh diff --git a/.crontab b/.crontab new file mode 100644 index 000000000..2ea22af84 --- /dev/null +++ b/.crontab @@ -0,0 +1,4 @@ +# update gems nightly +0 1 * * * gem update heroku +0 2 * * * rvm get head;rvm reload +0 3 * * * gem update -V diff --git a/.gemrc b/.gemrc new file mode 100644 index 000000000..519c2c3da --- /dev/null +++ b/.gemrc @@ -0,0 +1,10 @@ +--- +:bulk_threshold: 1000 +:benchmark: false +:sources: +- http://gems.rubyforge.org/ +:update_sources: true +install: --env-shebang +:backtrace: false +:verbose: true +update: --env-shebang diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 000000000..8a7f98acd --- /dev/null +++ b/.gitconfig @@ -0,0 +1,223 @@ +[user] + name = Adam Eivy + email = atomantic@gmail.com + +[color] +# ui = true is a superset of all the more specific color options +# as documented at http://book.git-scm.com/5_customizing_git.html +# When set to always, always use colors in all git commands which are capable of colored output. +# When false, never. When set to true or auto, use colors only when the output is to the terminal. +# When more specific variables of color.* are set, they always take precedence over this setting. +# Defaults to false. + ui = auto + # diff = auto + # status = auto + # branch = auto + +[color "branch"] + current = yellow reverse + local = yellow + remote = green +[color "diff"] + meta = yellow bold + frag = magenta bold + old = red bold + new = green bold +[color "status"] + added = yellow + changed = green + untracked = cyan + +[gui] + fontdiff = -family Monaco -size 10 -weight normal -slant roman -underline 0 -overstrike 0 + +[core] + excludesfile = ~/.gitignore + quotepath = false + # line endings + # force LF durring add + autocrlf = input + # autocrlf = true # for windows to convert to CRLF on checkout and LF on add + # warn but allow line ending conversion to proceed + safecrlf = warn + # prevent crlf (then you will have to deal with the problem -- dos2unix, etc) + #safecrlf = true + editor = vim + #editor = mate -w + +[alias] + br = branch -a + s = status -s -u + cl = log --stat -C -2 + c = commit + co = checkout + d = diff --color-words + dh = diff HEAD + dc = diff --staged + dw = diff --word-diff + dcw = diff --color-words + dm = !git diff | mate + dv = !git diff | vim + who = shortlog -s -- + ph = push + pl = pull + lp = log -p + lod = log --oneline --decorate + lg = log --graph + lpo = log --pretty=oneline --abbrev-commit --graph --decorate --all + l1 = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative + l2 = log --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative + spull = !git-svn fetch && git-svn rebase + spush = !git-svn dcommit + sync = !git pull && git push + es = !git pull --rebase && git push + lf = log --pretty=fuller + ignorechanges = update-index --assume-unchanged + noticechanges = update-index --no-assume-unchanged + gc-ap = gc --aggressive --prune + listconf = config --global --list + cam = commit -a -m + lsm = log -M --stat + hse = log --stat -5 + diffall = diff HEAD + logr = log -M + logr2 = log --stat -M -2 + logit = log --stat -M + scrub = !git reset --hard && git clean -fd + pub = !git pub checkout master && git pull && git checkout dev && git rebase master && git checkout master && git merge dev && git wtf + cs = status + rv = remote -v + lwr = log --stat -C + pur = pull --rebase + whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short + orphank = !gitk --all `git reflog | cut -c1-7`& + orphanl = !git log --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7` + k = !exec gitk --all& + testecho1 = !sh -c 'echo with slash: zero=$0 one=$1 two=$2' - + # te1 RESULT: with slash: zero=- one=A two=B + testecho2 = !sh -c 'echo without slash: zero=$0 one=$1 two=$2' + # te2 RESULT: without slash: zero=A one=B two=C + st = status + l = log --stat -C + ll = log --stat -C -3 + servehere = daemon --verbose --informative-errors --reuseaddr --export-all --base-path=. --enable=receive-pack + purgeme = !git clean -fd && git reset --hard + prunenow = gc --prune=now + ri = rebase --interactive --autosquash + lol = log --pretty=oneline --graph --abbrev-commit --all + blg = log --graph --decorate --all --abbrev-commit --pretty=oneline + slog = log --graph --simplify-by-decoration --all --abbrev-commit --pretty=oneline + lgso = log --graph --date=short --pretty=format:'%C(yellow)%h%Creset %cn%x09%cd %s%C(green bold)%d' + ro = !git fetch origin && git reset --hard origin/master + shorten = "!sh -c 'curl -i http://git.io -F url=$1' -" + pushnotes = !sh -c 'git push $1 refs/notes/*' - + fetchnotes = !sh -c 'git fetch $1 refs/notes/*:refs/notes/*' - + showignored = clean -ndX + showignored2 = ls-files --others --ignored --exclude-standard + showuntracked = ls-files --others --exclude-standard + rmmissing = !git rm $(git ls-files --deleted) + mergekeepoursonly = merge -s ours + redocommit = reset --soft HEAD^ + listunstaged = diff --name-status + liststaged = diff --name-status --staged + listhistory = log --name-status + logn = log --oneline --name-only + busypeople = shortlog -6 + busythisweek = shortlog --since=one.week.ago + configpushtracking = config push.default tracking + configpushnothing = config push.default nothing + configpushtracking = config push.default matching + configpushcurrent = config push.default current + + nr = "!sh -c 'git init $0'" + echoparam1 = "!sh -c 'echo $0'" + #testshfunction = "!function gitme() { git init $1; cd $1; }; gitme" + + fixup = "!sh -c 'git commit -m \"fixup! $(git log -1 --format='\\''%s'\\'' $@)\"' -" + squash = "!sh -c 'git commit -m \"squash! $(git log -1 --format='\\''%s'\\'' $@)\"' -" + ccfq = "!sh -c 'git add $1 && git commit -m\"Placeholder\"' -" + logme = log --author=Matthew --stat -C + cob = checkout -b + sno = show --name-only + logsimple = log --graph --abbrev-commit --pretty=oneline --all --decorate + +[apply] + whitespace = nowarn +[rerere] + enabled = 1 + +[difftool] + prompt = false +[difftool "myaraxis"] + cmd = araxisgitdiff ONE $LOCAL THREE FOUR $REMOTE +[diff] +# tool = araxis + tool = myaraxis + +[mergetool] + prompt = false + keepBackup = false +[mergetool "myaraxis"] + cmd = araxisgitmerge $PWD/$REMOTE $PWD/$BASE $PWD/$LOCAL $PWD/$MERGED +[merge] +# tool = araxis + tool = myaraxis + +[branch] + # Automatically set up pull to be --rebase + # autosetuprebase = always + +[github] + # https://github.com/blog/180-local-github-config + user = atomantic + + # in a few months, look into the include directive (after bug fixes) + token = MOVEALONG + +[url "git://github.com/"] + insteadOf = "ghg://" + pushInsteadOf = "ghg://" + # Example: git clone ghg://ntschutta/emacs + +# ghgm (github git me) +[url "git://github.com/atomantic/"] + insteadOf = "ghgm://" + pushInsteadOf = "ghgm://" + # Example: git clone ghgm://hellogitworld +[url "git@github.com:"] + insteadOf = "ghs://" + pushInsteadOf = "ghs://" +[url "git@github.com:atomantic/"] + insteadOf = "ghsm://" + pushInsteadOf = "ghsm://" +[url "https://github.com/"] + insteadOf = "ghh://" + pushInsteadOf = "ghh://" +[url "https://github.com/atomantic/"] + insteadOf = "ghhm://" + pushInsteadOf = "ghhm://" + +[url "git://github.wdig.com/"] + insteadOf = "dgh://" + pushInsteadOf = "dhg://" + # Example: git clone dhg://atomantic/Portal-Application-Framework +[url "git://github.wdig.com/atomantic/"] + insteadOf = "dgha://" + pushInsteadOf = "dhga://" + # Example: git clone dhg://Portal-Application-Framework +[url "git@github.wdig.com:"] + insteadOf = "dghs://" + pushInsteadOf = "ghs://" +[url "git@github.wdig.com:atomantic/"] + insteadOf = "dghsm://" + pushInsteadOf = "ghsm://" +[url "https://github.wdig.com/"] + insteadOf = "dghh://" + pushInsteadOf = "ghh://" +[url "https://github.wdig.com/atomantic/"] + insteadOf = "dghhm://" + pushInsteadOf = "ghhm://" + +[credential] + # cache creds (git help credential-cache) + helper = cache diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..893186d5b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "z-zsh"] + path = z-zsh + url = git://github.com/sjl/z-zsh.git +[submodule "oh-my-zsh"] + path = oh-my-zsh + url = git://github.com/robbyrussell/oh-my-zsh.git \ No newline at end of file diff --git a/.hgrc b/.hgrc new file mode 100644 index 000000000..d513f0095 --- /dev/null +++ b/.hgrc @@ -0,0 +1,9 @@ +[ui] +username = Adam Eivy +editor = vim +[hooks] +commit.autopush = hg push +precommit = ./precommit.sh +[web] +push_ssl = false +#allow_push = * diff --git a/.profile b/.profile new file mode 100644 index 000000000..ef461aac6 --- /dev/null +++ b/.profile @@ -0,0 +1,19 @@ +############################################################# +# Generic configuration that applies to all shells +############################################################# + +# RVM Ruby Selector +[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session. + +# RVM suggests using gcc instead of llvm (which Apple now symlinks gcc to) +export CC="/usr/bin/gcc-4.2" +export CFLAGS="-O2 -arch x86_64" +export LDFLAGS="-L/opt/local/lib" +export CPPFLAGS="-I/opt/local/include" + +source ~/.shellvars +source ~/.shellfn +source ~/.shellpaths +source ~/.shellaliases +# Private/Proprietary shell aliases (not to be checked into the public repo) :) +source ~/Dropbox/Private/Boxes/osx/.shellaliases diff --git a/.rvmrc b/.rvmrc new file mode 100644 index 000000000..70ccf62cc --- /dev/null +++ b/.rvmrc @@ -0,0 +1 @@ +export rvm_path="/Users/antic/.rvm" \ No newline at end of file diff --git a/.screenrc b/.screenrc new file mode 100644 index 000000000..245eb48fc --- /dev/null +++ b/.screenrc @@ -0,0 +1,16 @@ +# Set the default window name to empty string instead of the arbitrary "bash" +shelltitle '' + +# Set the window caption. +# I use caption instead of hardstatus, so it is available per split window too +# (hardstatus is only per complete screen). +caption always "%{= KW}%-Lw%{= wb}%n %t %{= KW}%+Lw %-=| ${USER}@%H | %M%d %c%{-}" +# Some decryption hints: +# %{= KW} background light black (aka dark gray) with foreground light white +# %{= wb} background dark white (ake light gray) with foreground dark blue +# %-Lw all windows before the current window. +# %n%f %t current window number, flags and title. +# %+Lw all windows after the current window. +# %-= pad remaining spaces. +# %H hostname. +# %M%d %s month and day (MmmDD) and current time (HH:MM). diff --git a/.shellaliases b/.shellaliases new file mode 100644 index 000000000..08f237740 --- /dev/null +++ b/.shellaliases @@ -0,0 +1,75 @@ +#!/bin/sh + +######################################### +# Connectivity +#alias ssh.host ='ssh user@host.net' + +######################################### +# Commands to run apps +alias run.clojure.repl='java -cp ${CLOJURE_HOME}/clojure.jar clojure.lang.Repl' +alias run.jlineclojure.repl='java -cp ${CLOJURE_HOME}/jline-0.9.91.jar:${CLOJURE_HOME}/clojure.jar jline.ConsoleRunner clojure.lang.Repl' +alias run.clojure.script='java -cp ${CLOJURE_HOME}/clojure.jar clojure.main' + +######################################### +# Commands to change dirs +alias to.temp='cd ${MYTEMP}' +alias to.downloads='cd ${MYDOWNLOADS}' +alias to.dropbox='cd ~/Dropbox' +alias to.docs='cd ${MYDOCUMENTS}' +alias to.code='cd ${MYCODE}' +alias to.scratch='cd ${MYSCRATCH}' + +alias to.devapps='cd ${MYDEVAPPS}' + + +################################# +# Simple Program Name Shortening +alias aq=aquamacs +alias g=git + + +############################# +# Utilities + +# Flush the DNS on Mac +alias dnsflush='dscacheutil -flushcache' + +# Copy and paste and prune the usless newline +alias pbcopynn='tr -d "\n" | pbcopy' + +# Set the extended MacOS attributes on a file such that Quicklook will open it as text +alias qltext='xattr -wx com.apple.FinderInfo "54 45 58 54 21 52 63 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" $1' +#alias qltext2='osascript -e tell application "Finder" to set file type of ((POSIX file "$1") as alias) to "TEXT"' + +# Git Scribe Commands +alias gsgp='git scribe gen pdf && open output/book.pdf' +alias gsgh='git scribe gen html && open output/book.html' + +# Show network connections +# Often useful to prefix with SUDO to see more system level network usage +alias network.connections='lsof -l -i +L -R -V' +alias network.established='lsof -l -i +L -R -V | grep ESTABLISHED' +alias network.internalip="ifconfig en0 | egrep -o '([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)'" +alias network.externalip='curl -s http://checkip.dyndns.org/ | sed "s/[a-zA-Z<>/ :]//g"' + +# Files used, anywhere on the filesystem +alias files.usage='sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep' +# Files being opened +alias files.open='sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep|grep open' +# Files in use in the Users directory +alias files.usage.user='sudo fs_usage -e -f filesystem|grep -v CACHE_HIT|grep -v grep|grep Users' + +# Directory listings +# LS_COLORS='no=01;37:fi=01;37:di=07;96:ln=01;36:pi=01;32:so=01;35:do=01;35:bd=01;33:cd=01;33:ex=01;31:mi=00;05;37:or=00;05;37:' +# -G Add colors to ls +# -l Long format +# -h Short size suffixes (B, K, M, G, P) +# -p Postpend slash to folders +alias ls='ls -G -h -p ' +alias ll='ls -l -G -h -p ' + +# Restart Apache on Mac +alias apacherestart="sudo /usr/sbin/apachectl restart" + +#Personal Commands +alias game.seek='txt="";for i in {1..20};do txt=$txt"$i. ";done;txt=$txt" Ready or not, here I come";say $txt' diff --git a/.shellfn b/.shellfn new file mode 100644 index 000000000..4f68ca42e --- /dev/null +++ b/.shellfn @@ -0,0 +1,43 @@ +######################################### +# Utility Functions + +# Create a new git repo with one README commit and CD into it +function gitnr() { mkdir $1; cd $1; git init; touch README; git add README; git commit -mFirst-commit;} + +# Do a Matrix movie effect of falling characters +function matrix1() { +echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|gawk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' +} + +function matrix2() { +echo -e "\e[1;40m" ; clear ; characters=$( jot -c 94 33 | tr -d '\n' ) ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) $characters ;sleep 0.05; done|gawk '{ letters=$5; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' +} + +# Use Mac OSX Preview to open a man page in a more handsome format +function manp() { + man -t $1 | open -f -a /Applications/Preview.app +} + +# Show normally hidden system and dotfile types of files +# in Mac OSX Finder +function showhiddenfiles() { + defaults write com.apple.Finder AppleShowAllFiles YES + osascript -e 'tell application "Finder" to quit' + sleep 0.25 + osascript -e 'tell application "Finder" to activate' +} + +# Hide (back to defaults) normally hidden system and dotfile types of files +# in Mac OSX Finder +function hidehiddenfiles() { + defaults write com.apple.Finder AppleShowAllFiles NO + osascript -e 'tell application "Finder" to quit' + sleep 0.25 + osascript -e 'tell application "Finder" to activate' +} + +# kill all instances of a process by name +function skill() +{ + sudo kill -9 `ps ax | grep $1 | grep -v grep | awk '{print $1}'` +} \ No newline at end of file diff --git a/.shellpaths b/.shellpaths new file mode 100644 index 000000000..962ec40ba --- /dev/null +++ b/.shellpaths @@ -0,0 +1,19 @@ +#My Scripts +export PATH=$PATH:./ +export PATH=$PATH:~/.dotfiles/scripts + +#Brew +export PATH=/usr/local/sbin:$PATH +export PATH=/usr/local/bin:$PATH + +#MacPorts +## Having MacPorts first instead of after $PATH causes a GitK error +## http://stackoverflow.com/questions/2629292/starting-gitk-error +export PATH=$PATH:/opt/local/bin +export PATH=$PATH:/opt/local/sbin +export MANPATH=$MANPATH:/opt/local/share/man + +#Dev frameworks +#export PATH=$PATH:$ANT_HOME/bin +export PATH=$PATH:$M2_HOME/bin + diff --git a/.shellvars b/.shellvars new file mode 100644 index 000000000..de6e85246 --- /dev/null +++ b/.shellvars @@ -0,0 +1,25 @@ +# Set textmate as our default command line editor (vi is the default otherwise) +export EDITOR='mate -w' + + +######################################################################### +# Temporary aliases useful for demos, other current projects +######################################################################### +export MYTEMP=~/Documents/Temp +export MYCODE=~/Documents/Code +export MYSCRATCH=~/Documents/Temp/Scratch +export MYDOWNLOADS=~/Downloads +export MYDOCUMENTS=~/Documents +export MYDEVAPPS=/Applications/Dev + +######################################################################### +# Tool paths +######################################################################### +export CLOJURE_HOME=/Applications/Dev/clojure +export EC2_HOME=/Applications/Dev/ec2-api-tools-1.3-46266 +export JAVA_HOME=/Library/Java/Home +#export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home + +######################################################################### +# Tool settings +######################################################################### \ No newline at end of file diff --git a/.vim/autoload/pathogen.vim b/.vim/autoload/pathogen.vim new file mode 100644 index 000000000..3accbe6dd --- /dev/null +++ b/.vim/autoload/pathogen.vim @@ -0,0 +1,245 @@ +" pathogen.vim - path option manipulation +" Maintainer: Tim Pope +" Version: 2.0 + +" Install in ~/.vim/autoload (or ~\vimfiles\autoload). +" +" For management of individually installed plugins in ~/.vim/bundle (or +" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc +" prior to `filetype plugin indent on` is the only other setup necessary. +" +" The API is documented inline below. For maximum ease of reading, +" :set foldmethod=marker + +if exists("g:loaded_pathogen") || &cp + finish +endif +let g:loaded_pathogen = 1 + +" Point of entry for basic default usage. Give a directory name to invoke +" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path +" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards, +" pathogen#cycle_filetype() is invoked. +function! pathogen#infect(...) abort " {{{1 + let source_path = a:0 ? a:1 : 'bundle' + if source_path =~# '[\\/]' + call pathogen#runtime_prepend_subdirectories(source_path) + else + call pathogen#runtime_append_all_bundles(source_path) + endif + call pathogen#cycle_filetype() +endfunction " }}}1 + +" Split a path into a list. +function! pathogen#split(path) abort " {{{1 + if type(a:path) == type([]) | return a:path | endif + let split = split(a:path,'\\\@"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags')) + helptags `=dir.'/doc'` + endif + endfor +endfunction " }}}1 + +command! -bar Helptags :call pathogen#helptags() + +" Like findfile(), but hardcoded to use the runtimepath. +function! pathogen#runtime_findfile(file,count) "{{{1 + let rtp = pathogen#join(1,pathogen#split(&rtp)) + return fnamemodify(findfile(a:file,rtp,a:count),':p') +endfunction " }}}1 + +" Backport of fnameescape(). +function! pathogen#fnameescape(string) " {{{1 + if exists('*fnameescape') + return fnameescape(a:string) + elseif a:string ==# '-' + return '\-' + else + return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') + endif +endfunction " }}}1 + +function! s:find(count,cmd,file,lcd) " {{{1 + let rtp = pathogen#join(1,pathogen#split(&runtimepath)) + let file = pathogen#runtime_findfile(a:file,a:count) + if file ==# '' + return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'" + elseif a:lcd + let path = file[0:-strlen(a:file)-2] + execute 'lcd `=path`' + return a:cmd.' '.pathogen#fnameescape(a:file) + else + return a:cmd.' '.pathogen#fnameescape(file) + endif +endfunction " }}}1 + +function! s:Findcomplete(A,L,P) " {{{1 + let sep = pathogen#separator() + let cheats = { + \'a': 'autoload', + \'d': 'doc', + \'f': 'ftplugin', + \'i': 'indent', + \'p': 'plugin', + \'s': 'syntax'} + if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0]) + let request = cheats[a:A[0]].a:A[1:-1] + else + let request = a:A + endif + let pattern = substitute(request,'\'.sep,'*'.sep,'g').'*' + let found = {} + for path in pathogen#split(&runtimepath) + let path = expand(path, ':p') + let matches = split(glob(path.sep.pattern),"\n") + call map(matches,'isdirectory(v:val) ? v:val.sep : v:val') + call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]') + for match in matches + let found[match] = 1 + endfor + endfor + return sort(keys(found)) +endfunction " }}}1 + +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) +command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) + +" vim:set ft=vim ts=8 sw=2 sts=2: diff --git a/.vim/colors/solarized.vim b/.vim/colors/solarized.vim new file mode 100755 index 000000000..70f52238a --- /dev/null +++ b/.vim/colors/solarized.vim @@ -0,0 +1,1117 @@ +" Name: Solarized vim colorscheme +" Author: Ethan Schoonover +" URL: http://ethanschoonover.com/solarized +" (see this url for latest release & screenshots) +" License: OSI approved MIT license (see end of this file) +" Created: In the middle of the night +" Modified: 2011 May 05 +" +" Usage "{{{ +" +" --------------------------------------------------------------------- +" ABOUT: +" --------------------------------------------------------------------- +" Solarized is a carefully designed selective contrast colorscheme with dual +" light and dark modes that runs in both GUI, 256 and 16 color modes. +" +" See the homepage above for screenshots and details. +" +" --------------------------------------------------------------------- +" OPTIONS: +" --------------------------------------------------------------------- +" See the "solarized.txt" help file included with this colorscheme (in the +" "doc" subdirectory) for information on options, usage, the Toggle Background +" function and more. If you have already installed Solarized, this is available +" from the Solarized menu and command line as ":help solarized" +" +" --------------------------------------------------------------------- +" INSTALLATION: +" --------------------------------------------------------------------- +" Two options for installation: manual or pathogen +" +" MANUAL INSTALLATION OPTION: +" --------------------------------------------------------------------- +" +" 1. Download the solarized distribution (available on the homepage above) +" and unarchive the file. +" 2. Move `solarized.vim` to your `.vim/colors` directory. +" 3. Move each of the files in each subdirectories to the corresponding .vim +" subdirectory (e.g. autoload/togglebg.vim goes into your .vim/autoload +" directory as .vim/autoload/togglebg.vim). +" +" RECOMMENDED PATHOGEN INSTALLATION OPTION: +" --------------------------------------------------------------------- +" +" 1. Download and install Tim Pope's Pathogen from: +" https://github.com/tpope/vim-pathogen +" +" 2. Next, move or clone the `vim-colors-solarized` directory so that it is +" a subdirectory of the `.vim/bundle` directory. +" +" a. **clone with git:** +" +" $ cd ~/.vim/bundle +" $ git clone git://github.com/altercation/vim-colors-solarized.git +" +" b. **or move manually into the pathogen bundle directory:** +" In the parent directory of vim-colors-solarized: +" +" $ mv vim-colors-solarized ~/.vim/bundle/ +" +" MODIFY VIMRC: +" +" After either Option 1 or Option 2 above, put the following two lines in your +" .vimrc: +" +" syntax enable +" set background=dark +" colorscheme solarized +" +" or, for the light background mode of Solarized: +" +" syntax enable +" set background=light +" colorscheme solarized +" +" I like to have a different background in GUI and terminal modes, so I can use +" the following if-then. However, I find vim's background autodetection to be +" pretty good and, at least with MacVim, I can leave this background value +" assignment out entirely and get the same results. +" +" if has('gui_running') +" set background=light +" else +" set background=dark +" endif +" +" See the Solarized homepage at http://ethanschoonover.com/solarized for +" screenshots which will help you select either the light or dark background. +" +" --------------------------------------------------------------------- +" COLOR VALUES +" --------------------------------------------------------------------- +" Download palettes and files from: http://ethanschoonover.com/solarized +" +" L\*a\*b values are canonical (White D65, Reference D50), other values are +" matched in sRGB space. +" +" SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B sRGB HSB +" --------- ------- ---- ------- ----------- ---------- ----------- ----------- +" base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 +" base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 +" base01 #586e75 10/7 brgreen 240 #4e4e4e 45 -07 -07 88 110 117 194 25 46 +" base00 #657b83 11/7 bryellow 241 #585858 50 -07 -07 101 123 131 195 23 51 +" base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 +" base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 +" base2 #eee8d5 7/7 white 254 #d7d7af 92 -00 10 238 232 213 44 11 93 +" base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 +" yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 +" orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 +" red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 +" magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 +" violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 +" blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 +" cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 +" green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 +" +" --------------------------------------------------------------------- +" COLORSCHEME HACKING +" --------------------------------------------------------------------- +" +" Useful commands for testing colorschemes: +" :source $VIMRUNTIME/syntax/hitest.vim +" :help highlight-groups +" :help cterm-colors +" :help group-name +" +" Useful links for developing colorschemes: +" http://www.vim.org/scripts/script.php?script_id=2937 +" http://vimcasts.org/episodes/creating-colorschemes-for-vim/ +" http://www.frexx.de/xterm-256-notes/" +" +" }}} +" Environment Specific Overrides "{{{ +" Allow or disallow certain features based on current terminal emulator or +" environment. + +" Terminals that support italics +let s:terms_italic=[ + \"rxvt", + \"gnome-terminal" + \] +" For reference only, terminals are known to be incomptible. +" Terminals that are in neither list need to be tested. +let s:terms_noitalic=[ + \"iTerm.app", + \"Apple_Terminal" + \] +if has("gui_running") + let s:terminal_italic=1 " TODO: could refactor to not require this at all +else + let s:terminal_italic=0 " terminals will be guilty until proven compatible + for term in s:terms_italic + if $TERM_PROGRAM =~ term + let s:terminal_italic=1 + endif + endfor +endif + +" }}} +" Default option values"{{{ +" --------------------------------------------------------------------- +" s:options_list is used to autogenerate a list of all non-default options +" using "call SolarizedOptions()" or with the "Generate .vimrc commands" +" Solarized menu option. See the "Menus" section below for the function itself. +let s:options_list=[ + \'" this block of commands has been autogenerated by solarized.vim and', + \'" includes the current, non-default Solarized option values.', + \'" To use, place these commands in your .vimrc file (replacing any', + \'" existing colorscheme commands). See also ":help solarized"', + \'', + \'" ------------------------------------------------------------------', + \'" Solarized Colorscheme Config', + \'" ------------------------------------------------------------------', + \] +let s:colorscheme_list=[ + \'syntax enable', + \'set background='.&background, + \'colorscheme solarized', + \] +let s:defaults_list=[ + \'" ------------------------------------------------------------------', + \'', + \'" The following items are available options, but do not need to be', + \'" included in your .vimrc as they are currently set to their defaults.', + \'' + \] +let s:lazycat_list=[ + \'" lazy method of appending this onto your .vimrc ":w! >> ~/.vimrc"', + \'" ------------------------------------------------------------------', + \] + +function! s:SetOption(name,default) + if type(a:default) == type(0) + let l:wrap='' + let l:ewrap='' + else + let l:wrap='"' + let l:ewrap='\"' + endif + if !exists("g:solarized_".a:name) || g:solarized_{a:name}==a:default + exe 'let g:solarized_'.a:name.'='.l:wrap.a:default.l:wrap.'"' + exe 'call add(s:defaults_list, "\" let g:solarized_'.a:name.'='.l:ewrap.g:solarized_{a:name}.l:ewrap.'")' + else + exe 'call add(s:options_list, "let g:solarized_'.a:name.'='.l:ewrap.g:solarized_{a:name}.l:ewrap.' \"default value is '.a:default.'")' + endif +endfunction + +if ($TERM_PROGRAM ==? "apple_terminal" && &t_Co < 256) + let s:solarized_termtrans_default = 1 +else + let s:solarized_termtrans_default = 0 +endif +call s:SetOption("termtrans",s:solarized_termtrans_default) +call s:SetOption("degrade",0) +call s:SetOption("bold",1) +call s:SetOption("underline",1) +call s:SetOption("italic",1) " note that we need to override this later if the terminal doesn't support +call s:SetOption("termcolors",16) +call s:SetOption("contrast","normal") +call s:SetOption("visibility","normal") +call s:SetOption("diffmode","normal") +call s:SetOption("hitrail",0) +call s:SetOption("menu",1) + +"}}} +" Colorscheme initialization "{{{ +" --------------------------------------------------------------------- +hi clear +if exists("syntax_on") + syntax reset +endif +let colors_name = "solarized" + +"}}} +" GUI & CSApprox hexadecimal palettes"{{{ +" --------------------------------------------------------------------- +" +" Set both gui and terminal color values in separate conditional statements +" Due to possibility that CSApprox is running (though I suppose we could just +" leave the hex values out entirely in that case and include only cterm colors) +" We also check to see if user has set solarized (force use of the +" neutral gray monotone palette component) +if (has("gui_running") && g:solarized_degrade == 0) + let s:vmode = "gui" + let s:base03 = "#002b36" + let s:base02 = "#073642" + let s:base01 = "#586e75" + let s:base00 = "#657b83" + let s:base0 = "#839496" + let s:base1 = "#93a1a1" + let s:base2 = "#eee8d5" + let s:base3 = "#fdf6e3" + let s:yellow = "#b58900" + let s:orange = "#cb4b16" + let s:red = "#dc322f" + let s:magenta = "#d33682" + let s:violet = "#6c71c4" + let s:blue = "#268bd2" + let s:cyan = "#2aa198" + "let s:green = "#859900" "original + let s:green = "#719e07" "experimental +elseif (has("gui_running") && g:solarized_degrade == 1) + " These colors are identical to the 256 color mode. They may be viewed + " while in gui mode via "let g:solarized_degrade=1", though this is not + " recommened and is for testing only. + let s:vmode = "gui" + let s:base03 = "#1c1c1c" + let s:base02 = "#262626" + let s:base01 = "#4e4e4e" + let s:base00 = "#585858" + let s:base0 = "#808080" + let s:base1 = "#8a8a8a" + let s:base2 = "#d7d7af" + let s:base3 = "#ffffd7" + let s:yellow = "#af8700" + let s:orange = "#d75f00" + let s:red = "#af0000" + let s:magenta = "#af005f" + let s:violet = "#5f5faf" + let s:blue = "#0087ff" + let s:cyan = "#00afaf" + let s:green = "#5f8700" +elseif g:solarized_termcolors != 256 && &t_Co >= 16 + let s:vmode = "cterm" + let s:base03 = "8" + let s:base02 = "0" + let s:base01 = "10" + let s:base00 = "11" + let s:base0 = "12" + let s:base1 = "14" + let s:base2 = "7" + let s:base3 = "15" + let s:yellow = "3" + let s:orange = "9" + let s:red = "1" + let s:magenta = "5" + let s:violet = "13" + let s:blue = "4" + let s:cyan = "6" + let s:green = "2" +elseif g:solarized_termcolors == 256 + let s:vmode = "cterm" + let s:base03 = "234" + let s:base02 = "235" + let s:base01 = "239" + let s:base00 = "240" + let s:base0 = "244" + let s:base1 = "245" + let s:base2 = "187" + let s:base3 = "230" + let s:yellow = "136" + let s:orange = "166" + let s:red = "124" + let s:magenta = "125" + let s:violet = "61" + let s:blue = "33" + let s:cyan = "37" + let s:green = "64" +else + let s:vmode = "cterm" + let s:bright = "* term=bold cterm=bold" +" let s:base03 = "0".s:bright +" let s:base02 = "0" +" let s:base01 = "2".s:bright +" let s:base00 = "3".s:bright +" let s:base0 = "4".s:bright +" let s:base1 = "6".s:bright +" let s:base2 = "7" +" let s:base3 = "7".s:bright +" let s:yellow = "3" +" let s:orange = "1".s:bright +" let s:red = "1" +" let s:magenta = "5" +" let s:violet = "5".s:bright +" let s:blue = "4" +" let s:cyan = "6" +" let s:green = "2" + let s:base03 = "DarkGray" " 0* + let s:base02 = "Black" " 0 + let s:base01 = "LightGreen" " 2* + let s:base00 = "LightYellow" " 3* + let s:base0 = "LightBlue" " 4* + let s:base1 = "LightCyan" " 6* + let s:base2 = "LightGray" " 7 + let s:base3 = "White" " 7* + let s:yellow = "DarkYellow" " 3 + let s:orange = "LightRed" " 1* + let s:red = "DarkRed" " 1 + let s:magenta = "DarkMagenta" " 5 + let s:violet = "LightMagenta" " 5* + let s:blue = "DarkBlue" " 4 + let s:cyan = "DarkCyan" " 6 + let s:green = "DarkGreen" " 2 + +endif +"}}} +" Formatting options and null values for passthrough effect "{{{ +" --------------------------------------------------------------------- + let s:none = "NONE" + let s:none = "NONE" + let s:t_none = "NONE" + let s:n = "NONE" + let s:c = ",undercurl" + let s:r = ",reverse" + let s:s = ",standout" + let s:ou = "" + let s:ob = "" +"}}} +" Background value based on termtrans setting "{{{ +" --------------------------------------------------------------------- +if (has("gui_running") || g:solarized_termtrans == 0) + let s:back = s:base03 +else + let s:back = "NONE" +endif +"}}} +" Alternate light scheme "{{{ +" --------------------------------------------------------------------- +if &background == "light" + let s:temp03 = s:base03 + let s:temp02 = s:base02 + let s:temp01 = s:base01 + let s:temp00 = s:base00 + let s:base03 = s:base3 + let s:base02 = s:base2 + let s:base01 = s:base1 + let s:base00 = s:base0 + let s:base0 = s:temp00 + let s:base1 = s:temp01 + let s:base2 = s:temp02 + let s:base3 = s:temp03 + if (s:back != "NONE") + let s:back = s:base03 + endif +endif +"}}} +" Optional contrast schemes "{{{ +" --------------------------------------------------------------------- +if g:solarized_contrast == "high" + let s:base01 = s:base00 + let s:base00 = s:base0 + let s:base0 = s:base1 + let s:base1 = s:base2 + let s:base2 = s:base3 + let s:back = s:back +endif +if g:solarized_contrast == "low" + let s:back = s:base02 + let s:ou = ",underline" +endif +"}}} +" Overrides dependent on user specified values and environment "{{{ +" --------------------------------------------------------------------- +if (g:solarized_bold == 0 || &t_Co == 8 ) + let s:b = "" + let s:bb = ",bold" +else + let s:b = ",bold" + let s:bb = "" +endif + +if g:solarized_underline == 0 + let s:u = "" +else + let s:u = ",underline" +endif + +if g:solarized_italic == 0 || s:terminal_italic == 0 + let s:i = "" +else + let s:i = ",italic" +endif +"}}} +" Highlighting primitives"{{{ +" --------------------------------------------------------------------- + +exe "let s:bg_none = ' ".s:vmode."bg=".s:none ."'" +exe "let s:bg_back = ' ".s:vmode."bg=".s:back ."'" +exe "let s:bg_base03 = ' ".s:vmode."bg=".s:base03 ."'" +exe "let s:bg_base02 = ' ".s:vmode."bg=".s:base02 ."'" +exe "let s:bg_base01 = ' ".s:vmode."bg=".s:base01 ."'" +exe "let s:bg_base00 = ' ".s:vmode."bg=".s:base00 ."'" +exe "let s:bg_base0 = ' ".s:vmode."bg=".s:base0 ."'" +exe "let s:bg_base1 = ' ".s:vmode."bg=".s:base1 ."'" +exe "let s:bg_base2 = ' ".s:vmode."bg=".s:base2 ."'" +exe "let s:bg_base3 = ' ".s:vmode."bg=".s:base3 ."'" +exe "let s:bg_green = ' ".s:vmode."bg=".s:green ."'" +exe "let s:bg_yellow = ' ".s:vmode."bg=".s:yellow ."'" +exe "let s:bg_orange = ' ".s:vmode."bg=".s:orange ."'" +exe "let s:bg_red = ' ".s:vmode."bg=".s:red ."'" +exe "let s:bg_magenta = ' ".s:vmode."bg=".s:magenta."'" +exe "let s:bg_violet = ' ".s:vmode."bg=".s:violet ."'" +exe "let s:bg_blue = ' ".s:vmode."bg=".s:blue ."'" +exe "let s:bg_cyan = ' ".s:vmode."bg=".s:cyan ."'" + +exe "let s:fg_none = ' ".s:vmode."fg=".s:none ."'" +exe "let s:fg_back = ' ".s:vmode."fg=".s:back ."'" +exe "let s:fg_base03 = ' ".s:vmode."fg=".s:base03 ."'" +exe "let s:fg_base02 = ' ".s:vmode."fg=".s:base02 ."'" +exe "let s:fg_base01 = ' ".s:vmode."fg=".s:base01 ."'" +exe "let s:fg_base00 = ' ".s:vmode."fg=".s:base00 ."'" +exe "let s:fg_base0 = ' ".s:vmode."fg=".s:base0 ."'" +exe "let s:fg_base1 = ' ".s:vmode."fg=".s:base1 ."'" +exe "let s:fg_base2 = ' ".s:vmode."fg=".s:base2 ."'" +exe "let s:fg_base3 = ' ".s:vmode."fg=".s:base3 ."'" +exe "let s:fg_green = ' ".s:vmode."fg=".s:green ."'" +exe "let s:fg_yellow = ' ".s:vmode."fg=".s:yellow ."'" +exe "let s:fg_orange = ' ".s:vmode."fg=".s:orange ."'" +exe "let s:fg_red = ' ".s:vmode."fg=".s:red ."'" +exe "let s:fg_magenta = ' ".s:vmode."fg=".s:magenta."'" +exe "let s:fg_violet = ' ".s:vmode."fg=".s:violet ."'" +exe "let s:fg_blue = ' ".s:vmode."fg=".s:blue ."'" +exe "let s:fg_cyan = ' ".s:vmode."fg=".s:cyan ."'" + +exe "let s:fmt_none = ' ".s:vmode."=NONE". " term=NONE". "'" +exe "let s:fmt_bold = ' ".s:vmode."=NONE".s:b. " term=NONE".s:b."'" +exe "let s:fmt_bldi = ' ".s:vmode."=NONE".s:b. " term=NONE".s:b."'" +exe "let s:fmt_undr = ' ".s:vmode."=NONE".s:u. " term=NONE".s:u."'" +exe "let s:fmt_undb = ' ".s:vmode."=NONE".s:u.s:b. " term=NONE".s:u.s:b."'" +exe "let s:fmt_undi = ' ".s:vmode."=NONE".s:u. " term=NONE".s:u."'" +exe "let s:fmt_uopt = ' ".s:vmode."=NONE".s:ou. " term=NONE".s:ou."'" +exe "let s:fmt_curl = ' ".s:vmode."=NONE".s:c. " term=NONE".s:c."'" +exe "let s:fmt_ital = ' ".s:vmode."=NONE".s:i. " term=NONE".s:i."'" +exe "let s:fmt_stnd = ' ".s:vmode."=NONE".s:s. " term=NONE".s:s."'" +exe "let s:fmt_revr = ' ".s:vmode."=NONE".s:r. " term=NONE".s:r."'" +exe "let s:fmt_revb = ' ".s:vmode."=NONE".s:r.s:b. " term=NONE".s:r.s:b."'" +" revbb (reverse bold for bright colors) is only set to actual bold in low +" color terminals (t_co=8, such as OS X Terminal.app) and should only be used +" with colors 8-15. +exe "let s:fmt_revbb = ' ".s:vmode."=NONE".s:r.s:bb. " term=NONE".s:r.s:bb."'" +exe "let s:fmt_revbbu = ' ".s:vmode."=NONE".s:r.s:bb.s:u." term=NONE".s:r.s:bb.s:u."'" + +if has("gui_running") + exe "let s:sp_none = ' guisp=".s:none ."'" + exe "let s:sp_back = ' guisp=".s:back ."'" + exe "let s:sp_base03 = ' guisp=".s:base03 ."'" + exe "let s:sp_base02 = ' guisp=".s:base02 ."'" + exe "let s:sp_base01 = ' guisp=".s:base01 ."'" + exe "let s:sp_base00 = ' guisp=".s:base00 ."'" + exe "let s:sp_base0 = ' guisp=".s:base0 ."'" + exe "let s:sp_base1 = ' guisp=".s:base1 ."'" + exe "let s:sp_base2 = ' guisp=".s:base2 ."'" + exe "let s:sp_base3 = ' guisp=".s:base3 ."'" + exe "let s:sp_green = ' guisp=".s:green ."'" + exe "let s:sp_yellow = ' guisp=".s:yellow ."'" + exe "let s:sp_orange = ' guisp=".s:orange ."'" + exe "let s:sp_red = ' guisp=".s:red ."'" + exe "let s:sp_magenta = ' guisp=".s:magenta."'" + exe "let s:sp_violet = ' guisp=".s:violet ."'" + exe "let s:sp_blue = ' guisp=".s:blue ."'" + exe "let s:sp_cyan = ' guisp=".s:cyan ."'" +else + let s:sp_none = "" + let s:sp_back = "" + let s:sp_base03 = "" + let s:sp_base02 = "" + let s:sp_base01 = "" + let s:sp_base00 = "" + let s:sp_base0 = "" + let s:sp_base1 = "" + let s:sp_base2 = "" + let s:sp_base3 = "" + let s:sp_green = "" + let s:sp_yellow = "" + let s:sp_orange = "" + let s:sp_red = "" + let s:sp_magenta = "" + let s:sp_violet = "" + let s:sp_blue = "" + let s:sp_cyan = "" +endif + +"}}} +" Basic highlighting"{{{ +" --------------------------------------------------------------------- +" note that link syntax to avoid duplicate configuration doesn't work with the +" exe compiled formats + +exe "hi! Normal" .s:fmt_none .s:fg_base0 .s:bg_back + +exe "hi! Comment" .s:fmt_ital .s:fg_base01 .s:bg_none +" *Comment any comment + +exe "hi! Constant" .s:fmt_none .s:fg_cyan .s:bg_none +" *Constant any constant +" String a string constant: "this is a string" +" Character a character constant: 'c', '\n' +" Number a number constant: 234, 0xff +" Boolean a boolean constant: TRUE, false +" Float a floating point constant: 2.3e10 + +exe "hi! Identifier" .s:fmt_none .s:fg_blue .s:bg_none +" *Identifier any variable name +" Function function name (also: methods for classes) +" +exe "hi! Statement" .s:fmt_none .s:fg_green .s:bg_none +" *Statement any statement +" Conditional if, then, else, endif, switch, etc. +" Repeat for, do, while, etc. +" Label case, default, etc. +" Operator "sizeof", "+", "*", etc. +" Keyword any other keyword +" Exception try, catch, throw + +exe "hi! PreProc" .s:fmt_none .s:fg_orange .s:bg_none +" *PreProc generic Preprocessor +" Include preprocessor #include +" Define preprocessor #define +" Macro same as Define +" PreCondit preprocessor #if, #else, #endif, etc. + +exe "hi! Type" .s:fmt_none .s:fg_yellow .s:bg_none +" *Type int, long, char, etc. +" StorageClass static, register, volatile, etc. +" Structure struct, union, enum, etc. +" Typedef A typedef + +exe "hi! Special" .s:fmt_none .s:fg_red .s:bg_none +" *Special any special symbol +" SpecialChar special character in a constant +" Tag you can use CTRL-] on this +" Delimiter character that needs attention +" SpecialComment special things inside a comment +" Debug debugging statements + +exe "hi! Underlined" .s:fmt_none .s:fg_violet .s:bg_none +" *Underlined text that stands out, HTML links + +exe "hi! Ignore" .s:fmt_none .s:fg_none .s:bg_none +" *Ignore left blank, hidden |hl-Ignore| + +exe "hi! Error" .s:fmt_bold .s:fg_red .s:bg_none +" *Error any erroneous construct + +exe "hi! Todo" .s:fmt_bold .s:fg_magenta.s:bg_none +" *Todo anything that needs extra attention; mostly the +" keywords TODO FIXME and XXX +" +"}}} +" Extended highlighting "{{{ +" --------------------------------------------------------------------- +if (g:solarized_visibility=="high") + exe "hi! SpecialKey" .s:fmt_revr .s:fg_red .s:bg_none + exe "hi! NonText" .s:fmt_bold .s:fg_red .s:bg_none +elseif (g:solarized_visibility=="low") + exe "hi! SpecialKey" .s:fmt_bold .s:fg_base02 .s:bg_none + exe "hi! NonText" .s:fmt_bold .s:fg_base02 .s:bg_none +else + exe "hi! SpecialKey" .s:fmt_bold .s:fg_base00 .s:bg_base02 + exe "hi! NonText" .s:fmt_bold .s:fg_base00 .s:bg_none +endif +exe "hi! StatusLine" .s:fmt_none .s:fg_base1 .s:bg_base02 .s:fmt_revbb +exe "hi! StatusLineNC" .s:fmt_none .s:fg_base00 .s:bg_base02 .s:fmt_revbb +exe "hi! Visual" .s:fmt_none .s:fg_base01 .s:bg_base03 .s:fmt_revbb +exe "hi! Directory" .s:fmt_none .s:fg_blue .s:bg_none +exe "hi! ErrorMsg" .s:fmt_revr .s:fg_red .s:bg_none +exe "hi! IncSearch" .s:fmt_stnd .s:fg_orange .s:bg_none +exe "hi! Search" .s:fmt_revr .s:fg_yellow .s:bg_none +exe "hi! MoreMsg" .s:fmt_none .s:fg_blue .s:bg_none +exe "hi! ModeMsg" .s:fmt_none .s:fg_blue .s:bg_none +exe "hi! LineNr" .s:fmt_none .s:fg_base01 .s:bg_base02 +exe "hi! Question" .s:fmt_bold .s:fg_cyan .s:bg_none +if ( has("gui_running") || &t_Co > 8 ) + exe "hi! VertSplit" .s:fmt_none .s:fg_base00 .s:bg_base00 +else + exe "hi! VertSplit" .s:fmt_revbb .s:fg_base00 .s:bg_base02 +endif +exe "hi! Title" .s:fmt_bold .s:fg_orange .s:bg_none +exe "hi! VisualNOS" .s:fmt_stnd .s:fg_none .s:bg_base02 .s:fmt_revbb +exe "hi! WarningMsg" .s:fmt_bold .s:fg_red .s:bg_none +exe "hi! WildMenu" .s:fmt_none .s:fg_base2 .s:bg_base02 .s:fmt_revbb +exe "hi! Folded" .s:fmt_undb .s:fg_base0 .s:bg_base02 .s:sp_base03 +exe "hi! FoldColumn" .s:fmt_none .s:fg_base0 .s:bg_base02 +if (g:solarized_diffmode=="high") +exe "hi! DiffAdd" .s:fmt_revr .s:fg_green .s:bg_none +exe "hi! DiffChange" .s:fmt_revr .s:fg_yellow .s:bg_none +exe "hi! DiffDelete" .s:fmt_revr .s:fg_red .s:bg_none +exe "hi! DiffText" .s:fmt_revr .s:fg_blue .s:bg_none +elseif (g:solarized_diffmode=="low") +exe "hi! DiffAdd" .s:fmt_undr .s:fg_green .s:bg_none .s:sp_green +exe "hi! DiffChange" .s:fmt_undr .s:fg_yellow .s:bg_none .s:sp_yellow +exe "hi! DiffDelete" .s:fmt_bold .s:fg_red .s:bg_none +exe "hi! DiffText" .s:fmt_undr .s:fg_blue .s:bg_none .s:sp_blue +else " normal + if has("gui_running") +exe "hi! DiffAdd" .s:fmt_bold .s:fg_green .s:bg_base02 .s:sp_green +exe "hi! DiffChange" .s:fmt_bold .s:fg_yellow .s:bg_base02 .s:sp_yellow +exe "hi! DiffDelete" .s:fmt_bold .s:fg_red .s:bg_base02 +exe "hi! DiffText" .s:fmt_bold .s:fg_blue .s:bg_base02 .s:sp_blue + else +exe "hi! DiffAdd" .s:fmt_none .s:fg_green .s:bg_base02 .s:sp_green +exe "hi! DiffChange" .s:fmt_none .s:fg_yellow .s:bg_base02 .s:sp_yellow +exe "hi! DiffDelete" .s:fmt_none .s:fg_red .s:bg_base02 +exe "hi! DiffText" .s:fmt_none .s:fg_blue .s:bg_base02 .s:sp_blue + endif +endif +exe "hi! SignColumn" .s:fmt_none .s:fg_base0 +exe "hi! Conceal" .s:fmt_none .s:fg_blue .s:bg_none +exe "hi! SpellBad" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_red +exe "hi! SpellCap" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_violet +exe "hi! SpellRare" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_cyan +exe "hi! SpellLocal" .s:fmt_curl .s:fg_none .s:bg_none .s:sp_yellow +exe "hi! Pmenu" .s:fmt_none .s:fg_base0 .s:bg_base02 .s:fmt_revbb +exe "hi! PmenuSel" .s:fmt_none .s:fg_base01 .s:bg_base2 .s:fmt_revbb +exe "hi! PmenuSbar" .s:fmt_none .s:fg_base2 .s:bg_base0 .s:fmt_revbb +exe "hi! PmenuThumb" .s:fmt_none .s:fg_base0 .s:bg_base03 .s:fmt_revbb +exe "hi! TabLine" .s:fmt_undr .s:fg_base0 .s:bg_base02 .s:sp_base0 +exe "hi! TabLineFill" .s:fmt_undr .s:fg_base0 .s:bg_base02 .s:sp_base0 +exe "hi! TabLineSel" .s:fmt_undr .s:fg_base01 .s:bg_base2 .s:sp_base0 .s:fmt_revbbu +exe "hi! CursorColumn" .s:fmt_none .s:fg_none .s:bg_base02 +exe "hi! CursorLine" .s:fmt_uopt .s:fg_none .s:bg_base02 .s:sp_base1 +exe "hi! ColorColumn" .s:fmt_none .s:fg_none .s:bg_base02 +exe "hi! Cursor" .s:fmt_none .s:fg_base03 .s:bg_base0 +hi! link lCursor Cursor +exe "hi! MatchParen" .s:fmt_bold .s:fg_red .s:bg_base01 + +"}}} +" vim syntax highlighting "{{{ +" --------------------------------------------------------------------- +"exe "hi! vimLineComment" . s:fg_base01 .s:bg_none .s:fmt_ital +"hi! link vimComment Comment +"hi! link vimLineComment Comment +hi! link vimVar Identifier +hi! link vimFunc Function +hi! link vimUserFunc Function +hi! link helpSpecial Special +hi! link vimSet Normal +hi! link vimSetEqual Normal +exe "hi! vimCommentString" .s:fmt_none .s:fg_violet .s:bg_none +exe "hi! vimCommand" .s:fmt_none .s:fg_yellow .s:bg_none +exe "hi! vimCmdSep" .s:fmt_bold .s:fg_blue .s:bg_none +exe "hi! helpExample" .s:fmt_none .s:fg_base1 .s:bg_none +exe "hi! helpOption" .s:fmt_none .s:fg_cyan .s:bg_none +exe "hi! helpNote" .s:fmt_none .s:fg_magenta.s:bg_none +exe "hi! helpVim" .s:fmt_none .s:fg_magenta.s:bg_none +exe "hi! helpHyperTextJump" .s:fmt_undr .s:fg_blue .s:bg_none +exe "hi! helpHyperTextEntry".s:fmt_none .s:fg_green .s:bg_none +exe "hi! vimIsCommand" .s:fmt_none .s:fg_base00 .s:bg_none +exe "hi! vimSynMtchOpt" .s:fmt_none .s:fg_yellow .s:bg_none +exe "hi! vimSynType" .s:fmt_none .s:fg_cyan .s:bg_none +exe "hi! vimHiLink" .s:fmt_none .s:fg_blue .s:bg_none +exe "hi! vimHiGroup" .s:fmt_none .s:fg_blue .s:bg_none +exe "hi! vimGroup" .s:fmt_undb .s:fg_blue .s:bg_none +"}}} +" diff highlighting "{{{ +" --------------------------------------------------------------------- +hi! link diffAdded Statement +hi! link diffLine Identifier +"}}} +" git & gitcommit highlighting "{{{ +"git +"exe "hi! gitDateHeader" +"exe "hi! gitIdentityHeader" +"exe "hi! gitIdentityKeyword" +"exe "hi! gitNotesHeader" +"exe "hi! gitReflogHeader" +"exe "hi! gitKeyword" +"exe "hi! gitIdentity" +"exe "hi! gitEmailDelimiter" +"exe "hi! gitEmail" +"exe "hi! gitDate" +"exe "hi! gitMode" +"exe "hi! gitHashAbbrev" +"exe "hi! gitHash" +"exe "hi! gitReflogMiddle" +"exe "hi! gitReference" +"exe "hi! gitStage" +"exe "hi! gitType" +"exe "hi! gitDiffAdded" +"exe "hi! gitDiffRemoved" +"gitcommit +"exe "hi! gitcommitSummary" +exe "hi! gitcommitComment" .s:fmt_ital .s:fg_base01 .s:bg_none +hi! link gitcommitUntracked gitcommitComment +hi! link gitcommitDiscarded gitcommitComment +hi! link gitcommitSelected gitcommitComment +exe "hi! gitcommitUnmerged" .s:fmt_bold .s:fg_green .s:bg_none +exe "hi! gitcommitOnBranch" .s:fmt_bold .s:fg_base01 .s:bg_none +exe "hi! gitcommitBranch" .s:fmt_bold .s:fg_magenta .s:bg_none +hi! link gitcommitNoBranch gitcommitBranch +exe "hi! gitcommitDiscardedType".s:fmt_none .s:fg_red .s:bg_none +exe "hi! gitcommitSelectedType" .s:fmt_none .s:fg_green .s:bg_none +"exe "hi! gitcommitUnmergedType" +"exe "hi! gitcommitType" +"exe "hi! gitcommitNoChanges" +"exe "hi! gitcommitHeader" +exe "hi! gitcommitHeader" .s:fmt_none .s:fg_base01 .s:bg_none +exe "hi! gitcommitUntrackedFile".s:fmt_bold .s:fg_cyan .s:bg_none +exe "hi! gitcommitDiscardedFile".s:fmt_bold .s:fg_red .s:bg_none +exe "hi! gitcommitSelectedFile" .s:fmt_bold .s:fg_green .s:bg_none +exe "hi! gitcommitUnmergedFile" .s:fmt_bold .s:fg_yellow .s:bg_none +exe "hi! gitcommitFile" .s:fmt_bold .s:fg_base0 .s:bg_none +hi! link gitcommitDiscardedArrow gitcommitDiscardedFile +hi! link gitcommitSelectedArrow gitcommitSelectedFile +hi! link gitcommitUnmergedArrow gitcommitUnmergedFile +"exe "hi! gitcommitArrow" +"exe "hi! gitcommitOverflow" +"exe "hi! gitcommitBlank" +" }}} +" html highlighting "{{{ +" --------------------------------------------------------------------- +exe "hi! htmlTag" .s:fmt_none .s:fg_base01 .s:bg_none +exe "hi! htmlEndTag" .s:fmt_none .s:fg_base01 .s:bg_none +exe "hi! htmlTagN" .s:fmt_bold .s:fg_base1 .s:bg_none +exe "hi! htmlTagName" .s:fmt_bold .s:fg_blue .s:bg_none +exe "hi! htmlSpecialTagName".s:fmt_ital .s:fg_blue .s:bg_none +exe "hi! htmlArg" .s:fmt_none .s:fg_base00 .s:bg_none +exe "hi! javaScript" .s:fmt_none .s:fg_yellow .s:bg_none +"}}} +" perl highlighting "{{{ +" --------------------------------------------------------------------- +exe "hi! perlHereDoc" . s:fg_base1 .s:bg_back .s:fmt_none +exe "hi! perlVarPlain" . s:fg_yellow .s:bg_back .s:fmt_none +exe "hi! perlStatementFileDesc". s:fg_cyan.s:bg_back.s:fmt_none + +"}}} +" tex highlighting "{{{ +" --------------------------------------------------------------------- +exe "hi! texStatement" . s:fg_cyan .s:bg_back .s:fmt_none +exe "hi! texMathZoneX" . s:fg_yellow .s:bg_back .s:fmt_none +exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back .s:fmt_none +exe "hi! texMathMatcher" . s:fg_yellow .s:bg_back .s:fmt_none +exe "hi! texRefLabel" . s:fg_yellow .s:bg_back .s:fmt_none +"}}} +" ruby highlighting "{{{ +" --------------------------------------------------------------------- +exe "hi! rubyDefine" . s:fg_base1 .s:bg_back .s:fmt_bold +"rubyInclude +"rubySharpBang +"rubyAccess +"rubyPredefinedVariable +"rubyBoolean +"rubyClassVariable +"rubyBeginEnd +"rubyRepeatModifier +"hi! link rubyArrayDelimiter Special " [ , , ] +"rubyCurlyBlock { , , } + +"hi! link rubyClass Keyword +"hi! link rubyModule Keyword +"hi! link rubyKeyword Keyword +"hi! link rubyOperator Operator +"hi! link rubyIdentifier Identifier +"hi! link rubyInstanceVariable Identifier +"hi! link rubyGlobalVariable Identifier +"hi! link rubyClassVariable Identifier +"hi! link rubyConstant Type +"}}} +" haskell syntax highlighting"{{{ +" --------------------------------------------------------------------- +" For use with syntax/haskell.vim : Haskell Syntax File +" http://www.vim.org/scripts/script.php?script_id=3034 +" See also Steffen Siering's github repository: +" http://github.com/urso/dotrc/blob/master/vim/syntax/haskell.vim +" --------------------------------------------------------------------- +" +" Treat True and False specially, see the plugin referenced above +let hs_highlight_boolean=1 +" highlight delims, see the plugin referenced above +let hs_highlight_delimiters=1 + +exe "hi! cPreCondit". s:fg_orange.s:bg_none .s:fmt_none + +exe "hi! VarId" . s:fg_blue .s:bg_none .s:fmt_none +exe "hi! ConId" . s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! hsImport" . s:fg_magenta.s:bg_none .s:fmt_none +exe "hi! hsString" . s:fg_base00 .s:bg_none .s:fmt_none + +exe "hi! hsStructure" . s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! hs_hlFunctionName" . s:fg_blue .s:bg_none +exe "hi! hsStatement" . s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! hsImportLabel" . s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! hs_OpFunctionName" . s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! hs_DeclareFunction" . s:fg_orange .s:bg_none .s:fmt_none +exe "hi! hsVarSym" . s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! hsType" . s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! hsTypedef" . s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! hsModuleName" . s:fg_green .s:bg_none .s:fmt_undr +exe "hi! hsModuleStartLabel" . s:fg_magenta.s:bg_none .s:fmt_none +hi! link hsImportParams Delimiter +hi! link hsDelimTypeExport Delimiter +hi! link hsModuleStartLabel hsStructure +hi! link hsModuleWhereLabel hsModuleStartLabel + +" following is for the haskell-conceal plugin +" the first two items don't have an impact, but better safe +exe "hi! hsNiceOperator" . s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! hsniceoperator" . s:fg_cyan .s:bg_none .s:fmt_none + +"}}} +" pandoc markdown syntax highlighting "{{{ +" --------------------------------------------------------------------- + +"PandocHiLink pandocNormalBlock +exe "hi! pandocTitleBlock" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! pandocTitleBlockTitle" .s:fg_blue .s:bg_none .s:fmt_bold +exe "hi! pandocTitleComment" .s:fg_blue .s:bg_none .s:fmt_bold +exe "hi! pandocComment" .s:fg_base01 .s:bg_none .s:fmt_ital +exe "hi! pandocVerbatimBlock" .s:fg_yellow .s:bg_none .s:fmt_none +hi! link pandocVerbatimBlockDeep pandocVerbatimBlock +hi! link pandocCodeBlock pandocVerbatimBlock +hi! link pandocCodeBlockDelim pandocVerbatimBlock +exe "hi! pandocBlockQuote" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! pandocBlockQuoteLeader1" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! pandocBlockQuoteLeader2" .s:fg_cyan .s:bg_none .s:fmt_none +exe "hi! pandocBlockQuoteLeader3" .s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! pandocBlockQuoteLeader4" .s:fg_red .s:bg_none .s:fmt_none +exe "hi! pandocBlockQuoteLeader5" .s:fg_base0 .s:bg_none .s:fmt_none +exe "hi! pandocBlockQuoteLeader6" .s:fg_base01 .s:bg_none .s:fmt_none +exe "hi! pandocListMarker" .s:fg_magenta.s:bg_none .s:fmt_none +exe "hi! pandocListReference" .s:fg_magenta.s:bg_none .s:fmt_undr + +" Definitions +" --------------------------------------------------------------------- +let s:fg_pdef = s:fg_violet +exe "hi! pandocDefinitionBlock" .s:fg_pdef .s:bg_none .s:fmt_none +exe "hi! pandocDefinitionTerm" .s:fg_pdef .s:bg_none .s:fmt_stnd +exe "hi! pandocDefinitionIndctr" .s:fg_pdef .s:bg_none .s:fmt_bold +exe "hi! pandocEmphasisDefinition" .s:fg_pdef .s:bg_none .s:fmt_ital +exe "hi! pandocEmphasisNestedDefinition" .s:fg_pdef .s:bg_none .s:fmt_bldi +exe "hi! pandocStrongEmphasisDefinition" .s:fg_pdef .s:bg_none .s:fmt_bold +exe "hi! pandocStrongEmphasisNestedDefinition" .s:fg_pdef.s:bg_none.s:fmt_bldi +exe "hi! pandocStrongEmphasisEmphasisDefinition" .s:fg_pdef.s:bg_none.s:fmt_bldi +exe "hi! pandocStrikeoutDefinition" .s:fg_pdef .s:bg_none .s:fmt_revr +exe "hi! pandocVerbatimInlineDefinition" .s:fg_pdef .s:bg_none .s:fmt_none +exe "hi! pandocSuperscriptDefinition" .s:fg_pdef .s:bg_none .s:fmt_none +exe "hi! pandocSubscriptDefinition" .s:fg_pdef .s:bg_none .s:fmt_none + +" Tables +" --------------------------------------------------------------------- +let s:fg_ptable = s:fg_blue +exe "hi! pandocTable" .s:fg_ptable.s:bg_none .s:fmt_none +exe "hi! pandocTableStructure" .s:fg_ptable.s:bg_none .s:fmt_none +hi! link pandocTableStructureTop pandocTableStructre +hi! link pandocTableStructureEnd pandocTableStructre +exe "hi! pandocTableZebraLight" .s:fg_ptable.s:bg_base03.s:fmt_none +exe "hi! pandocTableZebraDark" .s:fg_ptable.s:bg_base02.s:fmt_none +exe "hi! pandocEmphasisTable" .s:fg_ptable.s:bg_none .s:fmt_ital +exe "hi! pandocEmphasisNestedTable" .s:fg_ptable.s:bg_none .s:fmt_bldi +exe "hi! pandocStrongEmphasisTable" .s:fg_ptable.s:bg_none .s:fmt_bold +exe "hi! pandocStrongEmphasisNestedTable" .s:fg_ptable.s:bg_none .s:fmt_bldi +exe "hi! pandocStrongEmphasisEmphasisTable" .s:fg_ptable.s:bg_none .s:fmt_bldi +exe "hi! pandocStrikeoutTable" .s:fg_ptable.s:bg_none .s:fmt_revr +exe "hi! pandocVerbatimInlineTable" .s:fg_ptable.s:bg_none .s:fmt_none +exe "hi! pandocSuperscriptTable" .s:fg_ptable.s:bg_none .s:fmt_none +exe "hi! pandocSubscriptTable" .s:fg_ptable.s:bg_none .s:fmt_none + +" Headings +" --------------------------------------------------------------------- +let s:fg_phead = s:fg_orange +exe "hi! pandocHeading" .s:fg_phead .s:bg_none.s:fmt_bold +exe "hi! pandocHeadingMarker" .s:fg_yellow.s:bg_none.s:fmt_bold +exe "hi! pandocEmphasisHeading" .s:fg_phead .s:bg_none.s:fmt_bldi +exe "hi! pandocEmphasisNestedHeading" .s:fg_phead .s:bg_none.s:fmt_bldi +exe "hi! pandocStrongEmphasisHeading" .s:fg_phead .s:bg_none.s:fmt_bold +exe "hi! pandocStrongEmphasisNestedHeading" .s:fg_phead .s:bg_none.s:fmt_bldi +exe "hi! pandocStrongEmphasisEmphasisHeading".s:fg_phead .s:bg_none.s:fmt_bldi +exe "hi! pandocStrikeoutHeading" .s:fg_phead .s:bg_none.s:fmt_revr +exe "hi! pandocVerbatimInlineHeading" .s:fg_phead .s:bg_none.s:fmt_bold +exe "hi! pandocSuperscriptHeading" .s:fg_phead .s:bg_none.s:fmt_bold +exe "hi! pandocSubscriptHeading" .s:fg_phead .s:bg_none.s:fmt_bold + +" Links +" --------------------------------------------------------------------- +exe "hi! pandocLinkDelim" .s:fg_base01 .s:bg_none .s:fmt_none +exe "hi! pandocLinkLabel" .s:fg_blue .s:bg_none .s:fmt_undr +exe "hi! pandocLinkText" .s:fg_blue .s:bg_none .s:fmt_undb +exe "hi! pandocLinkURL" .s:fg_base00 .s:bg_none .s:fmt_undr +exe "hi! pandocLinkTitle" .s:fg_base00 .s:bg_none .s:fmt_undi +exe "hi! pandocLinkTitleDelim" .s:fg_base01 .s:bg_none .s:fmt_undi .s:sp_base00 +exe "hi! pandocLinkDefinition" .s:fg_cyan .s:bg_none .s:fmt_undr .s:sp_base00 +exe "hi! pandocLinkDefinitionID" .s:fg_blue .s:bg_none .s:fmt_bold +exe "hi! pandocImageCaption" .s:fg_violet .s:bg_none .s:fmt_undb +exe "hi! pandocFootnoteLink" .s:fg_green .s:bg_none .s:fmt_undr +exe "hi! pandocFootnoteDefLink" .s:fg_green .s:bg_none .s:fmt_bold +exe "hi! pandocFootnoteInline" .s:fg_green .s:bg_none .s:fmt_undb +exe "hi! pandocFootnote" .s:fg_green .s:bg_none .s:fmt_none +exe "hi! pandocCitationDelim" .s:fg_magenta.s:bg_none .s:fmt_none +exe "hi! pandocCitation" .s:fg_magenta.s:bg_none .s:fmt_none +exe "hi! pandocCitationID" .s:fg_magenta.s:bg_none .s:fmt_undr +exe "hi! pandocCitationRef" .s:fg_magenta.s:bg_none .s:fmt_none + +" Main Styles +" --------------------------------------------------------------------- +exe "hi! pandocStyleDelim" .s:fg_base01 .s:bg_none .s:fmt_none +exe "hi! pandocEmphasis" .s:fg_base0 .s:bg_none .s:fmt_ital +exe "hi! pandocEmphasisNested" .s:fg_base0 .s:bg_none .s:fmt_bldi +exe "hi! pandocStrongEmphasis" .s:fg_base0 .s:bg_none .s:fmt_bold +exe "hi! pandocStrongEmphasisNested" .s:fg_base0 .s:bg_none .s:fmt_bldi +exe "hi! pandocStrongEmphasisEmphasis" .s:fg_base0 .s:bg_none .s:fmt_bldi +exe "hi! pandocStrikeout" .s:fg_base01 .s:bg_none .s:fmt_revr +exe "hi! pandocVerbatimInline" .s:fg_yellow .s:bg_none .s:fmt_none +exe "hi! pandocSuperscript" .s:fg_violet .s:bg_none .s:fmt_none +exe "hi! pandocSubscript" .s:fg_violet .s:bg_none .s:fmt_none + +exe "hi! pandocRule" .s:fg_blue .s:bg_none .s:fmt_bold +exe "hi! pandocRuleLine" .s:fg_blue .s:bg_none .s:fmt_bold +exe "hi! pandocEscapePair" .s:fg_red .s:bg_none .s:fmt_bold +exe "hi! pandocCitationRef" .s:fg_magenta.s:bg_none .s:fmt_none +exe "hi! pandocNonBreakingSpace" . s:fg_red .s:bg_none .s:fmt_revr +hi! link pandocEscapedCharacter pandocEscapePair +hi! link pandocLineBreak pandocEscapePair + +" Embedded Code +" --------------------------------------------------------------------- +exe "hi! pandocMetadataDelim" .s:fg_base01 .s:bg_none .s:fmt_none +exe "hi! pandocMetadata" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! pandocMetadataKey" .s:fg_blue .s:bg_none .s:fmt_none +exe "hi! pandocMetadata" .s:fg_blue .s:bg_none .s:fmt_bold +hi! link pandocMetadataTitle pandocMetadata + +"}}} +" Utility autocommand "{{{ +" --------------------------------------------------------------------- +" In cases where Solarized is initialized inside a terminal vim session and +" then transferred to a gui session via the command `:gui`, the gui vim process +" does not re-read the colorscheme (or .vimrc for that matter) so any `has_gui` +" related code that sets gui specific values isn't executed. +" +" Currently, Solarized sets only the cterm or gui values for the colorscheme +" depending on gui or terminal mode. It's possible that, if the following +" autocommand method is deemed excessively poor form, that approach will be +" used again and the autocommand below will be dropped. +" +" However it seems relatively benign in this case to include the autocommand +" here. It fires only in cases where vim is transferring from terminal to gui +" mode (detected with the script scope s:vmode variable). It also allows for +" other potential terminal customizations that might make gui mode suboptimal. +" +autocmd GUIEnter * if (s:vmode != "gui") | exe "colorscheme " . g:colors_name | endif +"}}} +" Highlight Trailing Space {{{ +" Experimental: Different highlight when on cursorline +function! s:SolarizedHiTrail() + if g:solarized_hitrail==0 + hi! clear solarizedTrailingSpace + else + syn match solarizedTrailingSpace "\s*$" + exe "hi! solarizedTrailingSpace " .s:fmt_undr .s:fg_red .s:bg_none .s:sp_red + endif +endfunction +augroup SolarizedHiTrail + autocmd! + if g:solarized_hitrail==1 + autocmd! Syntax * call s:SolarizedHiTrail() + autocmd! ColorScheme * if g:colors_name == "solarized" | call s:SolarizedHiTrail() | else | augroup! s:SolarizedHiTrail | endif + endif +augroup END +" }}} +" Menus "{{{ +" --------------------------------------------------------------------- +" Turn off Solarized menu by including the following assignment in your .vimrc: +" +" let g:solarized_menu=0 + +function! s:SolarizedOptions() + new "new buffer + setf vim "vim filetype + let failed = append(0, s:defaults_list) + let failed = append(0, s:colorscheme_list) + let failed = append(0, s:options_list) + let failed = append(0, s:lazycat_list) + 0 "jump back to the top +endfunction +if !exists(":SolarizedOptions") + command SolarizedOptions :call s:SolarizedOptions() +endif + +function! SolarizedMenu() + if exists("g:loaded_solarized_menu") + try + silent! aunmenu Solarized + endtry + endif + let g:loaded_solarized_menu = 1 + + if g:colors_name == "solarized" && g:solarized_menu != 0 + + amenu &Solarized.&Contrast.&Low\ Contrast :let g:solarized_contrast="low" \| colorscheme solarized + amenu &Solarized.&Contrast.&Normal\ Contrast :let g:solarized_contrast="normal" \| colorscheme solarized + amenu &Solarized.&Contrast.&High\ Contrast :let g:solarized_contrast="high" \| colorscheme solarized + an &Solarized.&Contrast.-sep- + amenu &Solarized.&Contrast.&Help:\ Contrast :help 'solarized_contrast' + + amenu &Solarized.&Visibility.&Low\ Visibility :let g:solarized_visibility="low" \| colorscheme solarized + amenu &Solarized.&Visibility.&Normal\ Visibility :let g:solarized_visibility="normal" \| colorscheme solarized + amenu &Solarized.&Visibility.&High\ Visibility :let g:solarized_visibility="high" \| colorscheme solarized + an &Solarized.&Visibility.-sep- + amenu &Solarized.&Visibility.&Help:\ Visibility :help 'solarized_visibility' + + amenu &Solarized.&Background.&Toggle\ Background :ToggleBG + amenu &Solarized.&Background.&Dark\ Background :set background=dark \| colorscheme solarized + amenu &Solarized.&Background.&Light\ Background :set background=light \| colorscheme solarized + an &Solarized.&Background.-sep- + amenu &Solarized.&Background.&Help:\ ToggleBG :help togglebg + + if g:solarized_bold==0 | let l:boldswitch="On" | else | let l:boldswitch="Off" | endif + exe "amenu &Solarized.&Styling.&Turn\\ Bold\\ ".l:boldswitch." :let g:solarized_bold=(abs(g:solarized_bold-1)) \\| colorscheme solarized" + if g:solarized_italic==0 | let l:italicswitch="On" | else | let l:italicswitch="Off" | endif + exe "amenu &Solarized.&Styling.&Turn\\ Italic\\ ".l:italicswitch." :let g:solarized_italic=(abs(g:solarized_italic-1)) \\| colorscheme solarized" + if g:solarized_underline==0 | let l:underlineswitch="On" | else | let l:underlineswitch="Off" | endif + exe "amenu &Solarized.&Styling.&Turn\\ Underline\\ ".l:underlineswitch." :let g:solarized_underline=(abs(g:solarized_underline-1)) \\| colorscheme solarized" + + amenu &Solarized.&Diff\ Mode.&Low\ Diff\ Mode :let g:solarized_diffmode="low" \| colorscheme solarized + amenu &Solarized.&Diff\ Mode.&Normal\ Diff\ Mode :let g:solarized_diffmode="normal" \| colorscheme solarized + amenu &Solarized.&Diff\ Mode.&High\ Diff\ Mode :let g:solarized_diffmode="high" \| colorscheme solarized + + if g:solarized_hitrail==0 | let l:hitrailswitch="On" | else | let l:hitrailswitch="Off" | endif + exe "amenu &Solarized.&Experimental.&Turn\\ Highlight\\ Trailing\\ Spaces\\ ".l:hitrailswitch." :let g:solarized_hitrail=(abs(g:solarized_hitrail-1)) \\| colorscheme solarized" + an &Solarized.&Experimental.-sep- + amenu &Solarized.&Experimental.&Help:\ HiTrail :help 'solarized_hitrail' + + an &Solarized.-sep1- + + amenu &Solarized.&Autogenerate\ options :SolarizedOptions + + an &Solarized.-sep2- + + amenu &Solarized.&Help.&Solarized\ Help :help solarized + amenu &Solarized.&Help.&Toggle\ Background\ Help :help togglebg + amenu &Solarized.&Help.&Removing\ This\ Menu :help solarized-menu + + an 9999.77 &Help.&Solarized\ Colorscheme :help solarized + an 9999.78 &Help.&Toggle\ Background :help togglebg + an 9999.79 &Help.-sep3- + + endif +endfunction + +autocmd ColorScheme * if g:colors_name != "solarized" | silent! aunmenu Solarized | else | call SolarizedMenu() | endif + +"}}} +" License "{{{ +" --------------------------------------------------------------------- +" +" Copyright (c) 2011 Ethan Schoonover +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in +" all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +" THE SOFTWARE. +" +" vim:foldmethod=marker:foldlevel=0 +"}}} diff --git a/.vimrc b/.vimrc new file mode 100644 index 000000000..aa39977df --- /dev/null +++ b/.vimrc @@ -0,0 +1,183 @@ +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Must Have +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set nocompatible " get out of horrible vi-compatible mode +if has('gui_running') + set background=light +else + set background=dark +endif +colorscheme solarized +syntax on " syntax highlighting on + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" General +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set history=1000 " How many lines of history to remember +set cf " enable error files and error jumping +set clipboard+=unnamed " turns out I do like sharing windows clipboard +set ffs=unix,dos,mac " support all three, in this order +set viminfo+=! " make sure it can save viminfo +set isk+=_,$,@,%,# " none of these should be word dividers, so make them not be +set nosol " leave my cursor where it was + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Files/Backups +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set backup " make backup file +set backupdir=c:\progra~1\vim\vimfiles\backup,~/.vim/backup " where to put backup files +set directory=c:\progra~1\vim\vimfiles\temp,~/.vim/temp " directory for temp files +set makeef=error.err " When using make, where should it dump the file +set sessionoptions+=globals " What should be saved during sessions being saved +set sessionoptions+=localoptions " What should be saved during sessions being saved +set sessionoptions+=resize " What should be saved during sessions being saved +set sessionoptions+=winpos " What should be saved during sessions being saved + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Vim UI +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set lsp=0 " space it out a little more (easier to read) +set wildmenu " turn on wild menu +set wildmode=list:longest " turn on wild menu in special format (long format) +set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,*.swp,*.jpg,*.gif,*.png " ignore formats +set ruler " Always show current positions along the bottom +set cmdheight=1 " the command bar is 1 high +set number " turn on line numbers +set lz " do not redraw while running macros (much faster) (LazyRedraw) +set hid " you can change buffer without saving +set backspace=2 " make backspace work normal +set whichwrap+=<,>,h,l " backspace and cursor keys wrap to +set mouse=a " use mouse everywhere +set shortmess=atI " shortens messages to avoid 'press a key' prompt +set report=0 " tell us when anything is changed via :... +set noerrorbells " don't make noise +set list " we do what to show tabs, to ensure we get them out of my files +set listchars=tab:>-,trail:- " show tabs and trailing whitespace + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Visual Cues +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set showmatch " show matching brackets +set mat=5 " how many tenths of a second to blink matching brackets for +set nohlsearch " do not highlight searched for phrases +set incsearch " BUT do highlight as you type you search phrase +set so=5 " Keep 5 lines (top/bottom) for scope +set novisualbell " don't blink +" statusline example: ~\myfile[+] [FORMAT=format] [TYPE=type] [ASCII=000] [HEX=00] [POS=0000,0000][00%] [LEN=000] +set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] +set laststatus=2 " always show the status line + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Indent Related +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set ai " autoindent (filetype indenting instead) +set nosi " smartindent (filetype indenting instead) +set cindent " do c-style indenting +set softtabstop=4 " unify +set shiftwidth=4 " unify +set tabstop=4 " real tabs should be 4, but they will show with set list on +set copyindent " but above all -- follow the conventions laid before us +filetype plugin indent on " load filetype plugins and indent settings + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Text Formatting/Layout +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set fo=tcrq " See Help (complex) +set shiftround " when at 3 spaces, and I hit > ... go to 4, not 5 +set expandtab " no real tabs! +set nowrap " do not wrap line +set preserveindent " but above all -- follow the conventions laid before us +set ignorecase " case insensitive by default +set smartcase " if there are caps, go case-sensitive +set completeopt=menu,longest,preview " improve the way autocomplete works +set cursorcolumn " show the current column + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Folding +" Enable folding, but by default make it act like folding is +" off, because folding is annoying in anything but a few rare +" cases +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +set foldenable " Turn on folding +set foldmarker={,} " Fold C style code +set foldmethod=marker " Fold on the marker +set foldlevel=100 " Don't autofold anything (but I can still fold manually) +set foldopen-=search " don't open folds when you search into them +set foldopen-=undo " don't open folds when you undo stuff + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" CTags +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let Tlist_Ctags_Cmd = 'ctags' " Location of ctags +let Tlist_Sort_Type = "name" " order by +let Tlist_Use_Right_Window = 1 " split to the right side of the screen +let Tlist_Compact_Format = 1 " show small meny +let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourself +let Tlist_File_Fold_Auto_Close = 0 " Do not close tags for other files +let Tlist_Enable_Fold_Column = 1 " Do show folding tree +let Tlist_WinWidth = 50 " 50 cols wide, so I can (almost always) read my functions +let tlist_php_settings = 'php;c:class;d:constant;f:function' " don't show variables in php +let tlist_aspvbs_settings = 'asp;f:function;s:sub' " just functions and subs +let tlist_aspjscript_settings = 'asp;f:function;c:class' " just functions and classes +let tlist_vb_settings = 'asp;f:function;c:class' " just functions and classes + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Matchit +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let b:match_ignorecase = 1 + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Perl +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +let perl_extended_vars=1 " highlight advanced perl vars inside strings + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Pathogen +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +call pathogen#runtime_append_all_bundles() + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Custom Functions +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Select range, then hit :SuperRetab($width) - by p0g and FallingCow +function! SuperRetab(width) range + silent! exe a:firstline . ',' . a:lastline . 's/\v%(^ *)@<= {'. a:width .'}/\t/g' +endfunction + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Mappings +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +map :bp " left arrow (normal mode) switches buffers +map :bn " right arrow (normal mode) switches buffers +map :Tlist " show taglist +map :NERDTreeToggle " moves left fa split +map ggVG:call SuperRetab() +map ggVGg? " apply rot13 for people snooping over shoulder, good fun + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Useful abbrevs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +iab xdate =strftime("%d/%m/%y %H:%M:%S") + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Autocommands +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +au BufRead,BufNewFile *.zcml set filetype=xml +au BufRead,BufNewFile *.rb,*.rhtml set tabstop=2 +au BufRead,BufNewFile *.rb,*.rhtml set shiftwidth=2 +au BufRead,BufNewFile *.rb,*.rhtml set softtabstop=2 +au BufRead,BufNewFile *.otl set syntax=blockhl +au FileType python set omnifunc=pythoncomplete#Complete +au FileType javascript set omnifunc=javascriptcomplete#CompleteJS +au FileType html set omnifunc=htmlcomplete#CompleteTags +au FileType css set omnifunc=csscomplete#CompleteCSS +au FileType xml set omnifunc=xmlcomplete#CompleteTags +au FileType c set omnifunc=ccomplete#Complete + +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" Change paging overlap amount from 2 to 5 (+3) +" if you swapped C-y and C-e, and set them to 2, it would +" remove any overlap between pages +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +nnoremap 3 " Make overlap 3 extra on control-f +nnoremap 3 " Make overlap 3 extra on control-b diff --git a/.zlogout b/.zlogout new file mode 100644 index 000000000..4360c56a3 --- /dev/null +++ b/.zlogout @@ -0,0 +1,3 @@ +# Store dirs stack +# See ~/.dotfiles/oh-my-zsh/plugins/dirspersist.plugin.zsh +dirpersiststore diff --git a/.zprofile b/.zprofile new file mode 100644 index 000000000..a6a380e6c --- /dev/null +++ b/.zprofile @@ -0,0 +1,23 @@ +############################################################################## +#Import the shell-agnostic (Bash or Zsh) environment config +############################################################################## +source ~/.profile + +############################################################################## +# History Configuration +############################################################################## +HISTSIZE=5000 #How many lines of history to keep in memory +HISTFILE=~/.zsh_history #Where to save history to disk +SAVEHIST=5000 #Number of history entries to save to disk +HISTDUP=erase #Erase duplicates in the history file +setopt appendhistory #Append history to the history file (no overwriting) +setopt sharehistory #Share history across terminals +setopt incappendhistory #Immediately append to the history file, not just when a term is killed + +############################################################################## +# z-zsh setup +############################################################################## +. ~/.dotfiles/z-zsh/z.sh +function precmd () { + z --add "$(pwd -P)" +} diff --git a/.zshenv b/.zshenv new file mode 100644 index 000000000..cf6e8f900 --- /dev/null +++ b/.zshenv @@ -0,0 +1,2 @@ +fpath=($fpath $HOME/.zsh/func) +typeset -U fpath \ No newline at end of file diff --git a/.zshrc b/.zshrc new file mode 100644 index 000000000..d30aba134 --- /dev/null +++ b/.zshrc @@ -0,0 +1,29 @@ +# Path to your oh-my-zsh configuration. +export ZSH=$HOME/.dotfiles/oh-my-zsh + +# Set name of the theme to load. +# Look in $ZSH/themes/ +# Optionally, if you set this to "random", it'll load a random theme each +# time that oh-my-zsh is loaded. +export ZSH_THEME="pygmalion" +#export ZSH_THEME="random" + +# Set to this to use case-sensitive completion +export CASE_SENSITIVE="true" + +# Comment this out to disable weekly auto-update checks +# export DISABLE_AUTO_UPDATE="true" + +# Uncomment following line if you want to disable colors in ls +# export DISABLE_LS_COLORS="true" + +# Uncomment following line if you want to disable autosetting terminal title. +# export DISABLE_AUTO_TITLE="true" + +# Which plugins would you like to load? (plugins can be found in ~/.dotfiles/oh-my-zsh/plugins/*) +# Example format: plugins=(rails git textmate ruby lighthouse) +plugins=(git svn brew github macports osx rvm gradle ant compleat dirpersist gem git-flow ssh-agent cloudapp) + +source $ZSH/oh-my-zsh.sh + +# Customize to your needs... diff --git a/README.md b/README.md index 4ebb96dce..172e44785 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,30 @@ -dotfiles -======== +# What is this? +These are Adam Eivys's OSX shell configuration dotfiles. The primary goal is to increase CLI productivity on Mac OSX, though many scripts run just fine on any POSIX implementation. -Configuration Files for My OSX Boxes \ No newline at end of file +# Focus +The focus is on Zshell support, but there are plenty of cross-platform scripts in here. There are a few bash-specific ones. + +# Inspirations +The contents of this repo have been partly invented from scratch, partly inspired by open source projects, and partly refactored from snippets from colleagues and friends. Many are attributed. +Most of these scripts are based on or ported from (Matthew Mccullough's dotfiles)[https://github.com/matthewmccullough/dotfiles] + +# Acquiring This Repo +This project contains submodules. It is suggested that you clone this into your home directory. + + cd ~ + git clone --recurse-submodules https://github.com/atomantic/dotfiles .dotfiles + +# Setup +There is a set up script that establishes the symlinks in your home directory. Run this once. + +* For ZShell + `_setupdotfiles.zsh` + +# Contributions +Contributions are always welcome in the form of pull requests with explanatory comments. + +# Loathing, Mehs and Praise +1. Loathing should be directed into pull requests that make it better. +2. Bugs with the setup should be put as GitHub issues. +3. Mehs should be directed to /dev/null +4. Praise should be directed to [@antic](http://twitter.com/antic) or [@matthewmccull](http://twitter.com/matthewmccull) on Twitter \ No newline at end of file diff --git a/_setupdotfiles.zsh b/_setupdotfiles.zsh new file mode 100755 index 000000000..8e97ac3ee --- /dev/null +++ b/_setupdotfiles.zsh @@ -0,0 +1,60 @@ +#!/bin/zsh + +export UNLINK=true + +function symlinkifne { + echo "WORKING ON: $1" + + # does it exist + if [[ -a $1 ]]; then + echo " WARNING: $1 already exists." + + # If Unlink is requested + if [ "$UNLINK" = "true" ]; then + unlink $1 + echo " Unlinking $1" + + # create the link + echo " Symlinking $DOTFILESDIRRELATIVETOHOME/$1 to $1" + ln -s $DOTFILESDIRRELATIVETOHOME/$1 $1 + else + echo " SKIPPING $1." + fi + # does not exist + else + # create the link + echo " Symlinking $DOTFILESDIRRELATIVETOHOME/$1 to $1" + ln -s $DOTFILESDIRRELATIVETOHOME/$1 $1 + fi +} + + +echo "This script must be run from the dotfiles directory" +echo "Setting up..." + +#export DOTFILESDIRRELATIVETOHOME=$PWD +export DOTFILESDIRRELATIVETOHOME=.dotfiles +echo "DOTFILESDIRRELATIVETOHOME = $DOTFILESDIRRELATIVETOHOME" + +pushd ~ + +symlinkifne .crontab +symlinkifne .gemrc +symlinkifne .gitconfig +symlinkifne .gitignore +symlinkifne .hgrc +symlinkifne .profile +symlinkifne .rvmrc +symlinkifne .screenrc +symlinkifne .shellaliases +symlinkifne .shellfn +symlinkifne .shellpaths +symlinkifne .shellvars +symlinkifne .vim +symlinkifne .vimrc +symlinkifne .zlogout +symlinkifne .zprofile +symlinkifne .zshenv +symlinkifne .zshrc + +popd