Skip to content
Browse files

initial commit

  • Loading branch information...
0 parents commit 61b0326740e6df8b588b20d226ed5b2adf16e64c @matijs committed Aug 24, 2012
Showing with 1,308 additions and 0 deletions.
  1. +1 −0 .bash_logout
  2. +46 −0 .bash_profile
  3. +3 −0 .bashrc
  4. +5 −0 .inputrc
  5. +250 −0 .vim/autoload/pathogen.vim
  6. +1 −0 .vim/bundle/vim-colors-solarized
  7. +257 −0 .vim/indent/html.vim
  8. +407 −0 .vim/indent/javascript.vim
  9. +304 −0 .vim/syntax/html.vim
  10. +34 −0 .vimrc
1 .bash_logout
@@ -0,0 +1 @@
+clear
46 .bash_profile
@@ -0,0 +1,46 @@
+# set path:
+# check whether the Haskell binary directory exists and if so add it to the PATH
+[ -d "$HOME/Library/Haskell/bin" ] && export PATH="$HOME/Library/Haskell/bin:$PATH";
+# check whether the mysql binary directory exists and if so add it to the PATH
+[ -d "/usr/local/mysql/bin" ] && export PATH="/usr/local/mysql/bin:$PATH";
+# check whether the current user has a ~/bin and if so add it to the PATH
+[ -d "$HOME/bin" ] && export PATH="$HOME/bin:$PATH";
+# check whether rvm was installed and if so add it to the PATH
+[ -d "$HOME/.rvm" ] && export PATH="$HOME/.rvm:$PATH";
+# remove duplicates from the path
+export PATH=`awk -F: '{for(i=1;i<=NF;i++){if(!($i in a)){a[$i];printf s$i;s=":"}}}'<<<$PATH`;
+
+# set prompt:
+export PS1='(\!) \u@\h:\W \[$PROMPT_SMILEY\]\$ ';
+# to be executed every time before a prompt is displayed
+export PROMPT_COMMAND='[ $? -eq 0 ] && PROMPT_SMILEY="" || PROMPT_SMILEY="$(tput setaf 1)! $(tput sgr0)"';
+
+# aliases:
+# use colorized output when listing files
+alias ls='ls -G';
+# always ask for confirmation when removing files
+alias rm='rm -i';
+# always ask for confirmation when copying files
+alias cp='cp -i';
+# alias `simplehttpd` to start a simple webserver in the current director
+alias simplehttpd='python -m SimpleHTTPServer 8888 >/dev/null 2>&1&';
+# alias to edit ~/.bash_profile and reload it after saving
+alias pro='vi ~/.bash_profile; source ~/.bash_profile';
+# make `less` not clear the screen upon exit
+alias less='less -X';
+# just for fun, but also make bash expand other aliasses for sudo, http://git.io/wtfbash
+alias ffs='sudo ';
+
+# shell variables
+export HISTSIZE=32768;
+export HISTFILESIZE=$HISTSIZE;
+export HISTCONTROL=ignoredups;
+# list of commands that should not be added to history
+export HISTIGNORE="exit:[bf]g"
+# make `vi` the default system editor
+export EDITOR='vi';
+# make `man` use use `less` for paging and not clear the screen upon exit
+export MANPAGER='less -X';
+
+# Load RVM into a shell session *as a function*
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
3 .bashrc
@@ -0,0 +1,3 @@
+source $HOME/.bash_profile
+
+PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
5 .inputrc
@@ -0,0 +1,5 @@
+# only hit tab once instead of twice when possible completions are ambiguous
+set show-all-if-ambiguous on
+
+# ignore case when using command line completion
+set completion-ignore-case on
250 .vim/autoload/pathogen.vim
@@ -0,0 +1,250 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <http://tpo.pe/>
+" 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,'\\\@<!\%(\\\\\)*\zs,')
+ return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction " }}}1
+
+" Convert a list to a path.
+function! pathogen#join(...) abort " {{{1
+ if type(a:1) == type(1) && a:1
+ let i = 1
+ let space = ' '
+ else
+ let i = 0
+ let space = ''
+ endif
+ let path = ""
+ while i < a:0
+ if type(a:000[i]) == type([])
+ let list = a:000[i]
+ let j = 0
+ while j < len(list)
+ let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+ let path .= ',' . escaped
+ let j += 1
+ endwhile
+ else
+ let path .= "," . a:000[i]
+ endif
+ let i += 1
+ endwhile
+ return substitute(path,'^,','','')
+endfunction " }}}1
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort " {{{1
+ return call('pathogen#join',[1] + a:000)
+endfunction " }}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort " {{{1
+ let i = 0
+ let seen = {}
+ while i < len(a:list)
+ if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+ call remove(a:list,i)
+ elseif a:list[i] ==# ''
+ let i += 1
+ let empty = 1
+ else
+ let seen[a:list[i]] = 1
+ let i += 1
+ endif
+ endwhile
+ return a:list
+endfunction " }}}1
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#separator() abort " {{{1
+ return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction " }}}1
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort " {{{1
+ let files = split(glob(a:pattern),"\n")
+ return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort " {{{1
+ return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() " {{{1
+ if exists('g:did_load_filetypes')
+ filetype off
+ filetype on
+ endif
+endfunction " }}}1
+
+" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
+" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
+function! pathogen#is_disabled(path) " {{{1
+ if a:path =~# '\~$'
+ return 1
+ elseif !exists("g:pathogen_disabled")
+ return 0
+ endif
+ let sep = pathogen#separator()
+ return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
+endfunction "}}}1
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories.
+function! pathogen#runtime_prepend_subdirectories(path) " {{{1
+ let sep = pathogen#separator()
+ let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
+ let after = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
+ let rtp = pathogen#split(&rtp)
+ let path = expand(a:path)
+ call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
+ let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
+ return &rtp
+endfunction " }}}1
+
+" For each directory in rtp, check for a subdirectory named dir. If it
+" exists, add all subdirectories of that subdirectory to the rtp, immediately
+" after the original directory. If no argument is given, 'bundle' is used.
+" Repeated calls with the same arguments are ignored.
+function! pathogen#runtime_append_all_bundles(...) " {{{1
+ let sep = pathogen#separator()
+ let name = a:0 ? a:1 : 'bundle'
+ if "\n".s:done_bundles =~# "\\M\n".name."\n"
+ return ""
+ endif
+ let s:done_bundles .= name . "\n"
+ let list = []
+ for dir in pathogen#split(&rtp)
+ if dir =~# '\<after$'
+ let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
+ else
+ let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
+ endif
+ endfor
+ let &rtp = pathogen#join(pathogen#uniq(list))
+ return 1
+endfunction
+
+let s:done_bundles = ''
+" }}}1
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() " {{{1
+ let sep = pathogen#separator()
+ for dir in pathogen#split(&rtp)
+ if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!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))
+ let file = findfile(a:file,rtp,a:count)
+ if file ==# ''
+ return ''
+ else
+ return fnamemodify(file,':p')
+ endif
+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(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set ft=vim ts=8 sw=2 sts=2:
1 .vim/bundle/vim-colors-solarized
@@ -0,0 +1 @@
+Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21
257 .vim/indent/html.vim
@@ -0,0 +1,257 @@
+
+" Description: html indenter
+" Author: Johannes Zellner <johannes@zellner.org>
+" Last Change: Mo, 05 Jun 2006 22:32:41 CEST
+" Restoring 'cpo' and 'ic' added by Bram 2006 May 5
+" Globals: g:html_indent_tags -- indenting tags
+" g:html_indent_strict -- inhibit 'O O' elements
+" g:html_indent_strict_table -- inhibit 'O -' elements
+
+" Only load this indent file when no other was loaded.
+"if exists("b:did_indent")
+ "finish
+"endif
+"let b:did_indent = 1
+
+if exists("g:js_indent")
+ so g:js_indent
+else
+ ru! indent/javascript.vim
+endif
+
+echo "Sourcing html indent"
+
+
+" [-- local settings (must come before aborting the script) --]
+setlocal indentexpr=HtmlIndentGetter(v:lnum)
+setlocal indentkeys=o,O,*<Return>,<>>,{,}
+
+
+if exists('g:html_indent_tags')
+ unlet g:html_indent_tags
+endif
+
+" [-- helper function to assemble tag list --]
+fun! <SID>HtmlIndentPush(tag)
+ if exists('g:html_indent_tags')
+ let g:html_indent_tags = g:html_indent_tags.'\|'.a:tag
+ else
+ let g:html_indent_tags = a:tag
+ endif
+endfun
+
+
+" [-- <ELEMENT ? - - ...> --]
+call <SID>HtmlIndentPush('a')
+call <SID>HtmlIndentPush('abbr')
+call <SID>HtmlIndentPush('acronym')
+call <SID>HtmlIndentPush('address')
+call <SID>HtmlIndentPush('b')
+call <SID>HtmlIndentPush('bdo')
+call <SID>HtmlIndentPush('big')
+call <SID>HtmlIndentPush('blockquote')
+call <SID>HtmlIndentPush('button')
+call <SID>HtmlIndentPush('caption')
+call <SID>HtmlIndentPush('center')
+call <SID>HtmlIndentPush('cite')
+call <SID>HtmlIndentPush('code')
+call <SID>HtmlIndentPush('colgroup')
+call <SID>HtmlIndentPush('del')
+call <SID>HtmlIndentPush('dfn')
+call <SID>HtmlIndentPush('dir')
+call <SID>HtmlIndentPush('div')
+call <SID>HtmlIndentPush('dl')
+call <SID>HtmlIndentPush('em')
+call <SID>HtmlIndentPush('fieldset')
+call <SID>HtmlIndentPush('font')
+call <SID>HtmlIndentPush('form')
+call <SID>HtmlIndentPush('frameset')
+call <SID>HtmlIndentPush('h1')
+call <SID>HtmlIndentPush('h2')
+call <SID>HtmlIndentPush('h3')
+call <SID>HtmlIndentPush('h4')
+call <SID>HtmlIndentPush('h5')
+call <SID>HtmlIndentPush('h6')
+call <SID>HtmlIndentPush('i')
+call <SID>HtmlIndentPush('iframe')
+call <SID>HtmlIndentPush('ins')
+call <SID>HtmlIndentPush('kbd')
+call <SID>HtmlIndentPush('label')
+call <SID>HtmlIndentPush('legend')
+call <SID>HtmlIndentPush('map')
+call <SID>HtmlIndentPush('menu')
+call <SID>HtmlIndentPush('noframes')
+call <SID>HtmlIndentPush('noscript')
+call <SID>HtmlIndentPush('object')
+call <SID>HtmlIndentPush('ol')
+call <SID>HtmlIndentPush('optgroup')
+" call <SID>HtmlIndentPush('pre')
+call <SID>HtmlIndentPush('q')
+call <SID>HtmlIndentPush('s')
+call <SID>HtmlIndentPush('samp')
+call <SID>HtmlIndentPush('script')
+call <SID>HtmlIndentPush('select')
+call <SID>HtmlIndentPush('small')
+call <SID>HtmlIndentPush('span')
+call <SID>HtmlIndentPush('strong')
+call <SID>HtmlIndentPush('style')
+call <SID>HtmlIndentPush('sub')
+call <SID>HtmlIndentPush('sup')
+call <SID>HtmlIndentPush('table')
+call <SID>HtmlIndentPush('textarea')
+call <SID>HtmlIndentPush('title')
+call <SID>HtmlIndentPush('tt')
+call <SID>HtmlIndentPush('u')
+call <SID>HtmlIndentPush('ul')
+call <SID>HtmlIndentPush('li')
+call <SID>HtmlIndentPush('var')
+call <SID>HtmlIndentPush('article')
+call <SID>HtmlIndentPush('section')
+
+
+" [-- <ELEMENT ? O O ...> --]
+if !exists('g:html_indent_strict')
+ call <SID>HtmlIndentPush('body')
+ call <SID>HtmlIndentPush('head')
+ call <SID>HtmlIndentPush('html')
+ call <SID>HtmlIndentPush('tbody')
+endif
+
+
+" [-- <ELEMENT ? O - ...> --]
+if !exists('g:html_indent_strict_table')
+ call <SID>HtmlIndentPush('th')
+ call <SID>HtmlIndentPush('td')
+ call <SID>HtmlIndentPush('tr')
+ call <SID>HtmlIndentPush('tfoot')
+ call <SID>HtmlIndentPush('thead')
+endif
+
+delfun <SID>HtmlIndentPush
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" [-- count indent-increasing tags of line a:lnum --]
+fun! <SID>HtmlIndentOpen(lnum, pattern)
+ let s = substitute('x'.getline(a:lnum),
+ \ '.\{-}\(\(<\)\('.a:pattern.'\)\>\)', "\1", 'g')
+ let s = substitute(s, "[^\1].*$", '', '')
+ return strlen(s)
+endfun
+
+" [-- count indent-decreasing tags of line a:lnum --]
+fun! <SID>HtmlIndentClose(lnum, pattern)
+ let s = substitute('x'.getline(a:lnum),
+ \ '.\{-}\(\(<\)/\('.a:pattern.'\)\>>\)', "\1", 'g')
+ let s = substitute(s, "[^\1].*$", '', '')
+ return strlen(s)
+endfun
+
+" [-- count indent-increasing '{' of (java|css) line a:lnum --]
+fun! <SID>HtmlIndentOpenAlt(lnum)
+ return strlen(substitute(getline(a:lnum), '[^{]\+', '', 'g'))
+endfun
+
+" [-- count indent-decreasing '}' of (java|css) line a:lnum --]
+fun! <SID>HtmlIndentCloseAlt(lnum)
+ return strlen(substitute(getline(a:lnum), '[^}]\+', '', 'g'))
+endfun
+
+" [-- return the sum of indents respecting the syntax of a:lnum --]
+fun! <SID>HtmlIndentSum(lnum, style)
+ if a:style == match(getline(a:lnum), '^\s*</')
+ if a:style == match(getline(a:lnum), '^\s*</\<\('.g:html_indent_tags.'\)\>')
+ let open = <SID>HtmlIndentOpen(a:lnum, g:html_indent_tags)
+ let close = <SID>HtmlIndentClose(a:lnum, g:html_indent_tags)
+ if 0 != open || 0 != close
+ return open - close
+ endif
+ endif
+ endif
+ if '' != &syntax &&
+ \ synIDattr(synID(a:lnum, 1, 1), 'name') =~ '\(css\|java\).*' &&
+ \ synIDattr(synID(a:lnum, strlen(getline(a:lnum)), 1), 'name')
+ \ =~ '\(css\|java\).*'
+ if a:style == match(getline(a:lnum), '^\s*}')
+ return <SID>HtmlIndentOpenAlt(a:lnum) - <SID>HtmlIndentCloseAlt(a:lnum)
+ endif
+ endif
+ return 0
+endfun
+
+fun! HtmlIndentGetter(lnum)
+
+ echo "Grabbing html indent for line: " . a:lnum
+ " Find a non-empty line above the current line.
+ let lnum = prevnonblank(a:lnum - 1)
+
+ " Hit the start of the file, use zero indent.
+ if lnum == 0
+ return 0
+ endif
+
+ let restore_ic = &ic
+ setlocal ic " ignore case
+
+ " [-- special handling for <pre>: no indenting --]
+ if getline(a:lnum) =~ '\c</pre>'
+ \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nWb')
+ \ || 0 < searchpair('\c<pre>', '', '\c</pre>', 'nW')
+ " we're in a line with </pre> or inside <pre> ... </pre>
+ if restore_ic == 0
+ setlocal noic
+ endif
+ return -1
+ endif
+
+ " [-- special handling for <javascript>: use cindent --]
+ let js = '<script.*type\s*=.*javascript'
+
+ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ " by Tye Zdrojewski <zdro@yahoo.com>, 05 Jun 2006
+ " ZDR: This needs to be an AND (we are 'after the start of the pair' AND
+ " we are 'before the end of the pair'). Otherwise, indentation
+ " before the start of the script block will be affected; the end of
+ " the pair will still match if we are before the beginning of the
+ " pair.
+ "
+ if 0 < searchpair(js, '', '</script>', 'nWb')
+ \ && 0 < searchpair(js, '', '</script>', 'nW')
+ " we're inside javascript
+
+ if getline(lnum) !~ js && getline(a:lnum) !~ '</script>'
+ if restore_ic == 0
+ setlocal noic
+ endif
+ return GetJsIndent(a:lnum)
+ endif
+ endif
+
+ if getline(lnum) =~ '\c</pre>'
+ " line before the current line a:lnum contains
+ " a closing </pre>. --> search for line before
+ " starting <pre> to restore the indent.
+ let preline = prevnonblank(search('\c<pre>', 'bW') - 1)
+ if preline > 0
+ if restore_ic == 0
+ setlocal noic
+ endif
+ return indent(preline)
+ endif
+ endif
+
+ let ind = <SID>HtmlIndentSum(lnum, -1)
+ let ind = ind + <SID>HtmlIndentSum(a:lnum, 0)
+
+ if restore_ic == 0
+ setlocal noic
+ endif
+
+ return indent(lnum) + (&sw * ind)
+endfun
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" [-- EOF <runtime>/indent/html.vim --]
407 .vim/indent/javascript.vim
@@ -0,0 +1,407 @@
+" Vim indent file Language: JavaScript
+" Author: Preston Koprivica (pkopriv2@gmail.com)
+" URL:
+" Last Change: April 30, 2010
+
+" 0. Standard Stuff
+" =================
+
+" Only load one indent script per buffer
+if exists('b:did_indent')
+ finish
+endif
+
+let b:did_indent = 1
+
+" Set the global log variable 1 = logging enabled, 0 = logging disabled
+if !exists("g:js_indent_log")
+ let g:js_indent_log = 0
+endif
+
+setlocal indentexpr=GetJsIndent(v:lnum)
+setlocal indentkeys=
+
+
+setlocal cindent
+setlocal autoindent
+
+
+" 1. Variables
+" ============
+
+" Inline comments (for anchoring other statements)
+let s:js_mid_line_comment = '\s*\(\/\*.*\*\/\)*\s*'
+let s:js_end_line_comment = s:js_mid_line_comment . '\s*\(//.*\)*'
+let s:js_line_comment = s:js_end_line_comment
+
+" Comment/String Syntax Key
+let s:syn_comment = '\(Comment\|String\|Regexp\)'
+
+
+" 2. Aux. Functions
+" =================
+
+" = Method: IsInComment
+"
+" Determines whether the specified position is contained in a comment. "Note:
+" This depends on a
+function! s:IsInComment(lnum, cnum)
+ return synIDattr(synID(a:lnum, a:cnum, 1), 'name') =~? s:syn_comment
+endfunction
+
+
+" = Method: IsComment
+"
+" Determines whether a line is a comment or not.
+function! s:IsComment(lnum)
+ let line = getline(a:lnum)
+
+ return s:IsInComment(a:lnum, 1) && s:IsInComment(a:lnum, strlen(line)) "Doesn't absolutely work. Only Probably!
+endfunction
+
+
+" = Method: GetNonCommentLine
+"
+" Grabs the nearest non-commented line
+function! s:GetNonCommentLine(lnum)
+ let lnum = prevnonblank(a:lnum)
+
+ while lnum > 0
+ if s:IsComment(lnum)
+ let lnum = prevnonblank(lnum - 1)
+ else
+ return lnum
+ endif
+ endwhile
+
+ return lnum
+endfunction
+
+" = Method: SearchForPair
+"
+" Returns the beginning tag of a given pair starting from the given line.
+function! s:SearchForPair(lnum, beg, end)
+ " Save the cursor position.
+ let curpos = getpos(".")
+
+ " Set the cursor position to the beginning of the line (default
+ " behavior when using ==)
+ call cursor(a:lnum, 0)
+
+ " Search for the opening tag
+ let mnum = searchpair(a:beg, '', a:end, 'bW',
+ \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? s:syn_comment' )
+
+ "Restore the cursor position
+ call cursor(curpos)
+
+ " Finally, return the matched line number
+ return mnum
+endfunction
+
+
+" Object Helpers
+" ==============
+let s:object_beg = '{[^}]*' . s:js_end_line_comment . '$'
+let s:object_end = '^' . s:js_mid_line_comment . '}[;,]\='
+
+
+function! s:IsObjectBeg(line)
+ return a:line =~ s:object_beg
+endfunction
+
+function! s:IsObjectEnd(line)
+ return a:line =~ s:object_end
+endfunction
+
+function! s:GetObjectBeg(lnum)
+ return s:SearchForPair(a:lnum, '{', '}')
+endfunction
+
+
+" Array Helpers
+" ==============
+let s:array_beg = '\[[^\]]*' . s:js_end_line_comment . '$'
+let s:array_end = '^' . s:js_mid_line_comment . '[^\[]*\][;,]*' . s:js_end_line_comment . '$'
+
+
+function! s:IsArrayBeg(line)
+ return a:line =~ s:array_beg
+endfunction
+
+function! s:IsArrayEnd(line)
+ return a:line =~ s:array_end
+endfunction
+
+function! s:GetArrayBeg(lnum)
+ return s:SearchForPair(a:lnum, '\[', '\]')
+endfunction
+
+
+" MultiLine Declaration/Invocation Helpers
+" ========================================
+let s:paren_beg = '([^)]*' . s:js_end_line_comment . '$'
+let s:paren_end = '^' . s:js_mid_line_comment . '[^(]*)[;,]*'
+
+function! s:IsParenBeg(line)
+ return a:line =~ s:paren_beg
+endfunction
+
+function! s:IsParenEnd(line)
+ return a:line =~ s:paren_end
+endfunction
+
+function! s:GetParenBeg(lnum)
+ return s:SearchForPair(a:lnum, '(', ')')
+endfunction
+
+
+
+" Continuation Helpers
+" ====================
+let s:continuation = '\(+\|\\\)\{1}' . s:js_line_comment . '$'
+
+function! s:IsContinuationLine(line)
+ return a:line =~ s:continuation
+endfunction
+
+function! s:GetContinuationBegin(lnum)
+ let cur = a:lnum
+
+ while s:IsContinuationLine(getline(cur))
+ let cur -= 1
+ endwhile
+
+ return cur + 1
+endfunction
+
+
+" Switch Helpers
+" ==============
+let s:switch_beg_next_line = 'switch\s*(.*)\s*' . s:js_mid_line_comment . s:js_end_line_comment . '$'
+let s:switch_beg_same_line = 'switch\s*(.*)\s*' . s:js_mid_line_comment . '{\s*' . s:js_line_comment . '$'
+let s:switch_mid = '^.*\(case.*\|default\)\s*:\s*'
+
+function! s:IsSwitchBeginNextLine(line)
+ return a:line =~ s:switch_beg_next_line
+endfunction
+
+function! s:IsSwitchBeginSameLine(line)
+ return a:line =~ s:switch_beg_same_line
+endfunction
+
+function! s:IsSwitchMid(line)
+ return a:line =~ s:switch_mid
+endfunction
+
+
+" Control Helpers
+" ===============
+let s:cntrl_beg_keys = '\(\(\(if\|for\|with\|while\)\s*(.*)\)\|\(try\|do\)\)\s*'
+let s:cntrl_mid_keys = '\(\(\(else\s*if\|catch\)\s*(.*)\)\|\(finally\|else\)\)\s*'
+
+let s:cntrl_beg = s:cntrl_beg_keys . s:js_end_line_comment . '$'
+let s:cntrl_mid = s:cntrl_mid_keys . s:js_end_line_comment . '$'
+
+let s:cntrl_end = '\(while\s*(.*)\)\s*;\=\s*' . s:js_end_line_comment . '$'
+
+function! s:IsControlBeg(line)
+ return a:line =~ s:cntrl_beg
+endfunction
+
+function! s:IsControlMid(line)
+ return a:line =~ s:cntrl_mid
+endfunction
+
+function! s:IsControlMidStrict(line)
+ return a:line =~ s:cntrl_mid
+endfunction
+
+function! s:IsControlEnd(line)
+ return a:line =~ s:cntrl_end
+endfunction
+
+" = Method: Log
+"
+" Logs a message to the stdout.
+function! s:Log(msg)
+ if g:js_indent_log
+ echo "LOG: " . a:msg
+ endif
+endfunction
+
+
+" 3. Indenter
+" ===========
+function! GetJsIndent(lnum)
+ " Grab the first non-comment line prior to this line
+ let pnum = s:GetNonCommentLine(a:lnum-1)
+
+ " First line, start at indent = 0
+ if pnum == 0
+ call s:Log("No, noncomment lines prior to the current line.")
+ return 0
+ endif
+
+ " Grab the second non-comment line prior to this line
+ let ppnum = s:GetNonCommentLine(pnum-1)
+
+ call s:Log("Line: " . a:lnum)
+ call s:Log("PLine: " . pnum)
+ call s:Log("PPLine: " . ppnum)
+
+ " Grab the lines themselves.
+ let line = getline(a:lnum)
+ let pline = getline(pnum)
+ let ppline = getline(ppnum)
+
+ " Determine the current level of indentation
+ let ind = indent(pnum)
+
+
+ " Handle: Object Closers (ie })
+ " =============================
+ if s:IsObjectEnd(line) && !s:IsComment(a:lnum)
+ call s:Log("Line matched object end")
+
+ let obeg = s:GetObjectBeg(a:lnum)
+ let oind = indent(obeg)
+ let oline = getline(obeg)
+
+ call s:Log("The object beg was found at: " . obeg)
+ return oind
+ endif
+
+ if s:IsObjectBeg(pline)
+ call s:Log("Pline matched object beg")
+ return ind + &sw
+ endif
+
+
+ " Handle: Array Closer (ie ])
+ " ============================
+ if s:IsArrayEnd(line) && !s:IsComment(a:lnum)
+ call s:Log("Line matched array end")
+
+ let abeg = s:GetArrayBeg(a:lnum)
+ let aind = indent(abeg)
+
+ call s:Log("The array beg was found at: " . abeg)
+ return aind
+ endif
+
+ if s:IsArrayBeg(pline)
+ call s:Log("Pline matched array beg")
+ return ind + &sw
+ endif
+
+ " Handle: Parens
+ " ==============
+ if s:IsParenEnd(line) && !s:IsComment(a:lnum)
+ call s:Log("Line matched paren end")
+
+ let abeg = s:GetParenBeg(a:lnum)
+ let aind = indent(abeg)
+
+ call s:Log("The paren beg was found at: " . abeg)
+ return aind
+ endif
+
+ if s:IsParenBeg(pline)
+ call s:Log("Pline matched paren beg")
+ return ind + &sw
+ endif
+
+
+ " Handle: Continuation Lines.
+ " ========================================================
+ if s:IsContinuationLine(pline)
+ call s:Log('Pline is a continuation line.')
+
+ let cbeg = s:GetContinuationBegin(pnum)
+ let cind = indent(cbeg)
+
+ call s:Log('The continuation block begin found at: ' . cbeg)
+ return cind + &sw
+ endif
+
+ if s:IsContinuationLine(ppline)
+ call s:Log('PPline was a continuation line but pline wasnt.')
+ return ind - &sw
+ endif
+
+ " Handle: Switch Control Blocks
+ " =============================
+ if s:IsSwitchMid(pline)
+ call s:Log("PLine matched switch cntrl mid")
+ if s:IsSwitchMid(line) || s:IsObjectEnd(line)
+ call s:Log("Line matched a cntrl mid")
+ return ind
+ else
+ call s:Log("Line didnt match a cntrl mid")
+ return ind + &sw
+ endif
+ endif
+
+ if s:IsSwitchMid(line)
+ call s:Log("Line matched switch cntrl mid")
+ return ind - &sw
+ endif
+
+
+ " Handle: Single Line Control Blocks
+ " ==================================
+ if s:IsControlBeg(pline)
+ call s:Log("Pline matched control beginning")
+
+ if s:IsControlMid(line)
+ call s:Log("Line matched a control mid")
+ return ind
+ elseif line =~ '^\s*{\s*$'
+ call s:Log("Line matched an object beg")
+ return ind
+ else
+ return ind + &sw
+ endif
+
+ endif
+
+ if s:IsControlMid(pline)
+ call s:Log("Pline matched a control mid")
+
+ if s:IsControlMid(line)
+ call s:Log("Line matched a control mid")
+ return ind
+ elseif s:IsObjectBeg(line)
+ call s:Log("Line matched an object beg")
+ return ind
+ else
+ call s:Log("Line didn't match a control mid or object beg."
+ return ind + &sw
+ endif
+ endif
+
+ if s:IsControlMid(line)
+ call s:Log("Line matched a control mid.")
+
+ if s:IsControlEnd(pline) || s:IsObjectEnd(pline)
+ call s:Log("PLine matched control end")
+ return ind
+ else
+ call s:Log("Pline didn't match object end")
+ return ind - &sw
+ endif
+ endif
+
+
+ if ( s:IsControlBeg(ppline) || s:IsControlMid(ppline) ) &&
+ \ !s:IsObjectBeg(pline) && !s:IsObjectEnd(pline)
+ call s:Log("PPLine matched single line control beg or mid")
+ return ind - &sw
+ endif
+
+ " Handle: No matches
+ " ==================
+ "call s:Log("Line didn't match anything. Retaining indent")
+ return ind
+endfunction
304 .vim/syntax/html.vim
@@ -0,0 +1,304 @@
+" Vim syntax file
+" Language: HTML
+" Maintainer: Claudio Fleiner <claudio@fleiner.com>
+" URL: http://www.fleiner.com/vim/syntax/html.vim
+" Last Change: 2006 Jun 19
+
+" Please check :help html.vim for some comments and a description of the options
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if !exists("main_syntax")
+ if version < 600
+ syntax clear
+ elseif exists("b:current_syntax")
+ finish
+ endif
+ let main_syntax = 'html'
+endif
+
+" don't use standard HiLink, it will not work with included syntax files
+if version < 508
+ command! -nargs=+ HtmlHiLink hi link <args>
+else
+ command! -nargs=+ HtmlHiLink hi def link <args>
+endif
+
+syntax spell toplevel
+
+syn case ignore
+
+" mark illegal characters
+syn match htmlError "[<>&]"
+
+
+" tags
+syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
+syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
+syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
+syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
+syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
+syn match htmlTagError contained "[^>]<"ms=s+1
+
+
+" tag names
+syn keyword htmlTagName contained address applet area a base basefont
+syn keyword htmlTagName contained big blockquote br caption center
+syn keyword htmlTagName contained cite code dd dfn dir div dl dt font
+syn keyword htmlTagName contained form hr html img
+syn keyword htmlTagName contained input isindex kbd li link map menu
+syn keyword htmlTagName contained meta ol option param pre p samp span
+syn keyword htmlTagName contained select small strike sub sup
+syn keyword htmlTagName contained table td textarea th tr tt ul var xmp
+syn match htmlTagName contained "\<\(b\|i\|u\|h[1-6]\|em\|strong\|head\|body\|title\)\>"
+
+" new html 4.0 tags
+syn keyword htmlTagName contained abbr acronym bdo button col label
+syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
+syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
+
+" new html5 tags
+syn keyword htmlTagName contained article aside audio canvas command datalist
+syn keyword htmlTagName contained details embed figcaption figure footer header
+syn keyword htmlTagName contained hgroup keygen mark meter nav output progress
+syn keyword htmlTagName contained rp rt ruby section source summary time video
+
+" niew html5 arguments
+syn keyword htmlArg contained autofocus placeholder min max step
+syn keyword htmlArg contained contenteditable contextmenu draggable hidden item
+syn keyword htmlArg contained itemprop list subject spellcheck
+syn match htmlArg contained "\<\(data-[\-a-zA-Z0-9_]\+\)="
+
+" legal arg names
+syn keyword htmlArg contained action
+syn keyword htmlArg contained align alink alt archive background bgcolor
+syn keyword htmlArg contained border bordercolor cellpadding
+syn keyword htmlArg contained cellspacing checked class clear code codebase color
+syn keyword htmlArg contained cols colspan content coords enctype face
+syn keyword htmlArg contained gutter height hspace id
+syn keyword htmlArg contained link lowsrc marginheight
+syn keyword htmlArg contained marginwidth maxlength method name prompt
+syn keyword htmlArg contained rel rev rows rowspan scrolling selected shape
+syn keyword htmlArg contained size src start target text type url
+syn keyword htmlArg contained usemap ismap valign value vlink vspace width wrap
+syn match htmlArg contained "\<\(http-equiv\|href\|title\)="me=e-1
+
+" Netscape extensions
+syn keyword htmlTagName contained frame noframes frameset nobr blink
+syn keyword htmlTagName contained layer ilayer nolayer spacer
+syn keyword htmlArg contained frameborder noresize pagex pagey above below
+syn keyword htmlArg contained left top visibility clip id noshade
+syn match htmlArg contained "\<z-index\>"
+
+" Microsoft extensions
+syn keyword htmlTagName contained marquee
+
+" html 4.0 arg names
+syn match htmlArg contained "\<\(accept-charset\|label\)\>"
+syn keyword htmlArg contained abbr accept accesskey axis char charoff charset
+syn keyword htmlArg contained cite classid codetype compact datetime
+syn keyword htmlArg contained declare defer dir disabled for frame
+syn keyword htmlArg contained headers hreflang lang language longdesc
+syn keyword htmlArg contained multiple nohref nowrap object profile readonly
+syn keyword htmlArg contained rules scheme scope span standby style
+syn keyword htmlArg contained summary tabindex valuetype version
+
+" special characters
+syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
+
+" Comments (the real ones or the old netscape ones)
+if exists("html_wrong_comments")
+ syn region htmlComment start=+<!--+ end=+--\s*>+
+else
+ syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError
+ syn match htmlCommentError contained "[^><!]"
+ syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc
+endif
+syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
+
+" server-parsed commands
+syn region htmlPreProc start=+<!--#+ end=+-->+ contains=htmlPreStmt,htmlPreError,htmlPreAttr
+syn match htmlPreStmt contained "<!--#\(config\|echo\|exec\|fsize\|flastmod\|include\|printenv\|set\|if\|elif\|else\|endif\|geoguide\)\>"
+syn match htmlPreError contained "<!--#\S*"ms=s+4
+syn match htmlPreAttr contained "\w\+=[^"]\S\+" contains=htmlPreProcAttrError,htmlPreProcAttrName
+syn region htmlPreAttr contained start=+\w\+="+ skip=+\\\\\|\\"+ end=+"+ contains=htmlPreProcAttrName keepend
+syn match htmlPreProcAttrError contained "\w\+="he=e-1
+syn match htmlPreProcAttrName contained "\(expr\|errmsg\|sizefmt\|timefmt\|var\|cgi\|cmd\|file\|virtual\|value\)="he=e-1
+
+if !exists("html_no_rendering")
+ " rendering
+ syn cluster htmlTop contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc
+
+ syn region htmlBold start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ syn region htmlBold start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic
+ syn region htmlBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
+ syn region htmlBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlBoldItalicUnderline
+ syn region htmlBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlBoldItalicUnderline
+ syn region htmlBoldUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
+ syn region htmlBoldUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+ syn region htmlBoldItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlBoldUnderlineItalic
+
+ syn region htmlUnderline start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic
+ syn region htmlUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlUnderlineBoldItalic
+ syn region htmlUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlUnderlineBoldItalic
+ syn region htmlUnderlineItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlUnderlineItalicBold
+ syn region htmlUnderlineItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop,htmlUnderlineItalicBold
+ syn region htmlUnderlineItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
+ syn region htmlUnderlineItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
+ syn region htmlUnderlineBoldItalic contained start="<i\>" end="</i>"me=e-4 contains=@htmlTop
+ syn region htmlUnderlineBoldItalic contained start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+
+ syn region htmlItalic start="<i\>" end="</i>"me=e-4 contains=@htmlTop,htmlItalicBold,htmlItalicUnderline
+ syn region htmlItalic start="<em\>" end="</em>"me=e-5 contains=@htmlTop
+ syn region htmlItalicBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop,htmlItalicBoldUnderline
+ syn region htmlItalicBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop,htmlItalicBoldUnderline
+ syn region htmlItalicBoldUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop
+ syn region htmlItalicUnderline contained start="<u\>" end="</u>"me=e-4 contains=@htmlTop,htmlItalicUnderlineBold
+ syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
+ syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
+
+ syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+ syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
+ syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
+ syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
+ syn region htmlH4 start="<h4\>" end="</h4>"me=e-5 contains=@htmlTop
+ syn region htmlH5 start="<h5\>" end="</h5>"me=e-5 contains=@htmlTop
+ syn region htmlH6 start="<h6\>" end="</h6>"me=e-5 contains=@htmlTop
+ syn region htmlHead start="<head\>" end="</head>"me=e-7 end="<body\>"me=e-5 end="<h[1-6]\>"me=e-3 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc
+ syn region htmlTitle start="<title\>" end="</title>"me=e-8 contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
+endif
+
+syn keyword htmlTagName contained noscript
+syn keyword htmlSpecialTagName contained script style
+if main_syntax != 'java' || exists("java_javascript")
+ " JAVA SCRIPT
+ syn include @htmlJavaScript syntax/javascript.vim
+ unlet b:current_syntax
+ syn region javaScript start=+<script[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+ syn region htmlScriptTag contained start=+<script+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
+ HtmlHiLink htmlScriptTag htmlTag
+
+ " html events (i.e. arguments that include javascript commands)
+ if exists("html_extended_events")
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ contains=htmlEventSQ
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ contains=htmlEventDQ
+ else
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*'+ end=+'+ keepend contains=htmlEventSQ
+ syn region htmlEvent contained start=+\<on\a\+\s*=[\t ]*"+ end=+"+ keepend contains=htmlEventDQ
+ endif
+ syn region htmlEventSQ contained start=+'+ms=s+1 end=+'+me=s-1 contains=@htmlJavaScript
+ syn region htmlEventDQ contained start=+"+ms=s+1 end=+"+me=s-1 contains=@htmlJavaScript
+ HtmlHiLink htmlEventSQ htmlEvent
+ HtmlHiLink htmlEventDQ htmlEvent
+
+ " a javascript expression is used as an arg value
+ syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
+endif
+
+if main_syntax != 'java' || exists("java_vb")
+ " VB SCRIPT
+ syn include @htmlVbScript syntax/vb.vim
+ unlet b:current_syntax
+ syn region javaScript start=+<script [^>]*language *=[^>]*vbscript[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
+endif
+
+syn cluster htmlJavaScript add=@htmlPreproc
+
+if main_syntax != 'java' || exists("java_css")
+ " embedded style sheets
+ syn keyword htmlArg contained media
+ syn include @htmlCss syntax/css.vim
+ unlet b:current_syntax
+ syn region cssStyle start=+<style+ keepend end=+</style>+ contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc
+ syn match htmlCssStyleComment contained "\(<!--\|-->\)"
+ syn region htmlCssDefinition matchgroup=htmlArg start='style="' keepend matchgroup=htmlString end='"' contains=css.*Attr,css.*Prop,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc
+ HtmlHiLink htmlStyleArg htmlString
+endif
+
+if main_syntax == "html"
+ " synchronizing (does not always work if a comment includes legal
+ " html tags, but doing it right would mean to always start
+ " at the first line, which is too slow)
+ syn sync match htmlHighlight groupthere NONE "<[/a-zA-Z]"
+ syn sync match htmlHighlight groupthere javaScript "<script"
+ syn sync match htmlHighlightSkip "^.*['\"].*$"
+ syn sync minlines=10
+endif
+
+" The default highlighting.
+if version >= 508 || !exists("did_html_syn_inits")
+ if version < 508
+ let did_html_syn_inits = 1
+ endif
+ HtmlHiLink htmlTag Function
+ HtmlHiLink htmlEndTag Identifier
+ HtmlHiLink htmlArg Type
+ HtmlHiLink htmlTagName htmlStatement
+ HtmlHiLink htmlSpecialTagName Exception
+ HtmlHiLink htmlValue String
+ HtmlHiLink htmlSpecialChar Special
+
+ if !exists("html_no_rendering")
+ HtmlHiLink htmlH1 Title
+ HtmlHiLink htmlH2 htmlH1
+ HtmlHiLink htmlH3 htmlH2
+ HtmlHiLink htmlH4 htmlH3
+ HtmlHiLink htmlH5 htmlH4
+ HtmlHiLink htmlH6 htmlH5
+ HtmlHiLink htmlHead PreProc
+ HtmlHiLink htmlTitle Title
+ HtmlHiLink htmlBoldItalicUnderline htmlBoldUnderlineItalic
+ HtmlHiLink htmlUnderlineBold htmlBoldUnderline
+ HtmlHiLink htmlUnderlineItalicBold htmlBoldUnderlineItalic
+ HtmlHiLink htmlUnderlineBoldItalic htmlBoldUnderlineItalic
+ HtmlHiLink htmlItalicUnderline htmlUnderlineItalic
+ HtmlHiLink htmlItalicBold htmlBoldItalic
+ HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic
+ HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic
+ HtmlHiLink htmlLink Underlined
+ if !exists("html_my_rendering")
+ hi def htmlBold term=bold cterm=bold gui=bold
+ hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
+ hi def htmlBoldItalic term=bold,italic cterm=bold,italic gui=bold,italic
+ hi def htmlBoldUnderlineItalic term=bold,italic,underline cterm=bold,italic,underline gui=bold,italic,underline
+ hi def htmlUnderline term=underline cterm=underline gui=underline
+ hi def htmlUnderlineItalic term=italic,underline cterm=italic,underline gui=italic,underline
+ hi def htmlItalic term=italic cterm=italic gui=italic
+ endif
+ endif
+
+ HtmlHiLink htmlPreStmt PreProc
+ HtmlHiLink htmlPreError Error
+ HtmlHiLink htmlPreProc PreProc
+ HtmlHiLink htmlPreAttr String
+ HtmlHiLink htmlPreProcAttrName PreProc
+ HtmlHiLink htmlPreProcAttrError Error
+ HtmlHiLink htmlSpecial Special
+ HtmlHiLink htmlSpecialChar Special
+ HtmlHiLink htmlString String
+ HtmlHiLink htmlStatement Statement
+ HtmlHiLink htmlComment Comment
+ HtmlHiLink htmlCommentPart Comment
+ HtmlHiLink htmlValue String
+ HtmlHiLink htmlCommentError htmlError
+ HtmlHiLink htmlTagError htmlError
+ HtmlHiLink htmlEvent javaScript
+ HtmlHiLink htmlError Error
+
+ HtmlHiLink javaScript Special
+ HtmlHiLink javaScriptExpression javaScript
+ HtmlHiLink htmlCssStyleComment Comment
+ HtmlHiLink htmlCssDefinition Special
+endif
+
+delcommand HtmlHiLink
+
+let b:current_syntax = "html"
+
+if main_syntax == 'html'
+ unlet main_syntax
+endif
+
+" vim: ts=8
34 .vimrc
@@ -0,0 +1,34 @@
+" enable pathogen
+call pathogen#infect()
+syntax on
+" enable syntax highlighting
+syntax on
+" use the `solarized` colorscheme
+colorscheme solarized
+" and make it use the dark background
+set background=dark
+" enable linenumbers
+set number
+" enable a ruler at the bottom of the screen
+set ruler
+" enable commandline completion when in command mode
+set wildmenu
+" use 2 chars whitespace for tabs and use proper tabs
+set noexpandtab
+set tabstop=2
+set softtabstop=2
+set shiftwidth=2
+" enable loading the indent file for specific file types
+filetype plugin indent on
+" don't wrap long lines
+set nowrap
+" enable autoindenting
+set autoindent
+" hightlight the line the cursor is on
+set cursorline
+" show invisibles
+set list
+" use ▸ followed by spaces to show tabs, use ¬ for end of line characters
+set listchars=tab:\ ,eol:¬
+" use the solarized 256 colorscheme
+let g:solarized_termcolors=256

0 comments on commit 61b0326

Please sign in to comment.
Something went wrong with that request. Please try again.