Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: palbo/dotfiles
base: 59acc2af06
...
head fork: palbo/dotfiles
compare: df7eab96c2
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 119 additions and 67 deletions.
  1. +3 −0  .ackrc
  2. +109 −66 .vim/syntax/javascript.vim
  3. +7 −1 .zsh.d/webkit.zsh
View
3  .ackrc
@@ -0,0 +1,3 @@
+--smart-case
+--type-set=idl=.idl
+--type-set=conf=.conf
View
175 .vim/syntax/javascript.vim
@@ -1,12 +1,13 @@
" Vim syntax file
" Language: JavaScript
-" Maintainer: Yi Zhao (ZHAOYI) <zzlinux AT hotmail DOT com>
-" Last Change: June 4, 2009
-" Version: 0.7.7
-" Changes: Add "undefined" as a type keyword
-"
-" TODO:
-" - Add the HTML syntax inside the JSDoc
+" Maintainer: Jose Elera Campana <https://github.com/jelera>
+" Last Change: February 6, 2012
+" Version: 0.7.9
+" Changes: Go to https://github.com/jelera/vim-javascript-syntax for
+" recent changes.
+" Credits: Zhao Yi, Claudio Fleiner, Scott Shattuck (This file is based
+" on their hard work), gumnos (From the #vim IRC Channel in
+" Freenode)
if !exists("main_syntax")
if version < 600
@@ -17,10 +18,9 @@ if !exists("main_syntax")
let main_syntax = 'javascript'
endif
-"" Drop fold if it set but VIM doesn't support it.
-let b:javascript_fold='true'
-if version < 600 " Don't support the old version
- unlet! b:javascript_fold
+" Drop fold if it set but vim doesn't support it.
+if version < 600 && exists("javaScript_fold")
+ unlet javaScript_fold
endif
"" dollar sigh is permittd anywhere in an identifier
@@ -29,11 +29,10 @@ setlocal iskeyword+=$
syntax sync fromstart
"" JavaScript comments
-syntax keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
-syntax region javaScriptLineComment start=+\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell
-syntax region javaScriptLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=javaScriptCommentTodo,@Spell fold
-syntax region javaScriptCvsTag start="\$\cid:" end="\$" oneline contained
-syntax region javaScriptComment start="/\*" end="\*/" contains=javaScriptCommentTodo,javaScriptCvsTag,@Spell fold
+syn keyword javaScriptCommentTodo TODO FIXME XXX TBD contained
+syn match javaScriptLineComment "\/\/.*" contains=@Spell,javaScriptCommentTodo
+syn match javaScriptCommentSkip "^[ \t]*\*\($\|[ \t]\+\)"
+syn region javaScriptComment start="/\*" end="\*/" contains=@Spell,javaScriptCommentTodo
"" JSDoc support start
if !exists("javascript_ignore_javaScriptdoc")
@@ -55,40 +54,73 @@ endif "" JSDoc end
syntax case match
"" Syntax in the JavaScript code
-syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
-syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
-syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
-"syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
-syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
+syn match javaScriptSpecial "\\\d\d\d\|\\."
+syn region javaScriptStringD start=+"+ skip=+\\\\\|\\"+ end=+"\|$+ contains=javaScriptSpecial,@htmlPreproc
+syn region javaScriptStringS start=+'+ skip=+\\\\\|\\'+ end=+'\|$+ contains=javaScriptSpecial,@htmlPreproc
+
+syn match javaScriptSpecialCharacter "'\\.'"
+syn match javaScriptNumber "-\=\<\d\+L\=\>\|0[xX][0-9a-fA-F]\+\>"
+syn region javaScriptRegexpString start=+/[^/*]+me=e-1 skip=+\\\\\|\\/+ end=+/[gi]\{0,2\}\s*$+ end=+/[gi]\{0,2\}\s*[;.,)\]}]+me=e-1 contains=@htmlPreproc oneline
+" syntax match javaScriptSpecial "\\\d\d\d\|\\x\x\{2\}\|\\u\x\{4\}\|\\."
+" syntax region javaScriptStringD start=+"+ skip=+\\\\\|\\$"+ end=+"+ contains=javaScriptSpecial,@htmlPreproc
+" syntax region javaScriptStringS start=+'+ skip=+\\\\\|\\$'+ end=+'+ contains=javaScriptSpecial,@htmlPreproc
+" syntax region javaScriptRegexpString start=+/\(\*\|/\)\@!+ skip=+\\\\\|\\/+ end=+/[gim]\{,3}+ contains=javaScriptSpecial,@htmlPreproc oneline
+" syntax match javaScriptNumber /\<-\=\d\+L\=\>\|\<0[xX]\x\+\>/
syntax match javaScriptFloat /\<-\=\%(\d\+\.\d\+\|\d\+\.\|\.\d\+\)\%([eE][+-]\=\d\+\)\=\>/
-syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
+" syntax match javaScriptLabel /\(?\s*\)\@<!\<\w\+\(\s*:\)\@=/
"" JavaScript Prototype
syntax keyword javaScriptPrototype prototype
+" DOM, Browser and Ajax Support {{{
+""""""""""""""""""""""""
+syntax keyword javaScriptBrowserObjects window navigator screen history location
+
+syntax keyword javaScriptDOMObjects document event HTMLElement Anchor Area Base Body Button Form Frame Frameset Image Link Meta Option Select Style Table TableCell TableRow Textarea
+syntax keyword javaScriptDOMMethods createTextNode createElement insertBefore replaceChild removeChild appendChild hasChildNodes cloneNode normalize isSupported hasAttributes getAttribute setAttribute removeAttribute getAttributeNode setAttributeNode removeAttributeNode getElementsByTagName hasAttribute getElementById adoptNode close compareDocumentPosition createAttribute createCDATASection createComment createDocumentFragment createElementNS createEvent createExpression createNSResolver createProcessingInstruction createRange createTreeWalker elementFromPoint evaluate getBoxObjectFor getElementsByClassName getSelection getUserData hasFocus importNode
+syntax keyword javaScriptDOMProperties nodeName nodeValue nodeType parentNode childNodes firstChild lastChild previousSibling nextSibling attributes ownerDocument namespaceURI prefix localName tagName
+
+syntax keyword javaScriptAjaxObjects XMLHttpRequest
+syntax keyword javaScriptAjaxProperties readyState responseText responseXML statusText
+syntax keyword javaScriptAjaxMethods onreadystatechange abort getAllResponseHeaders getResponseHeader open send setRequestHeader
+
+syntax keyword javaScriptPropietaryObjects ActiveXObject
+syntax keyword javaScriptPropietaryMethods attachEvent detachEvent cancelBubble returnValue
+
+syntax keyword javaScriptHtmlElemProperties className clientHeight clientLeft clientTop clientWidth dir href id innerHTML lang length offsetHeight offsetLeft offsetParent offsetTop offsetWidth scrollHeight scrollLeft scrollTop scrollWidth style tabIndex target title
+
+syntax keyword javaScriptEventListenerKeywords blur click focus mouseover mouseout load item
+
+syntax keyword javaScriptEventListenerMethods scrollIntoView addEventListener dispatchEvent removeEventListener preventDefault stopPropagation
+" }}}
+
"" Programm Keywords
syntax keyword javaScriptSource import export
-syntax keyword javaScriptType const this undefined var void yield
-syntax keyword javaScriptOperator delete new in instanceof let typeof
+syntax keyword javaScriptIdentifier arguments this let var void yield
+syntax keyword javaScriptOperator delete new instanceof typeof
syntax keyword javaScriptBoolean true false
-syntax keyword javaScriptNull null
+syntax keyword javaScriptNull null undefined
+syntax keyword javaScriptMessage alert confirm prompt status
+syntax keyword javaScriptGlobal self top parent
+syntax keyword javaScriptDeprecated escape unescape all applets alinkColor bgColor fgColor linkColor vlinkColor xmlEncoding
"" Statement Keywords
-syntax keyword javaScriptConditional if else
-syntax keyword javaScriptRepeat do while for
-syntax keyword javaScriptBranch break continue switch case default return
-syntax keyword javaScriptStatement try catch throw with finally
+syntax keyword javaScriptConditional if else switch
+syntax keyword javaScriptRepeat do while for in
+syntax keyword javaScriptBranch break continue
+syntax keyword javaScriptLabel case default
+syntax keyword javaScriptStatement return with
-syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity JavaArray JavaClass JavaObject JavaPackage Math Number NaN Object Packages RegExp String Undefined java netscape sun
+syntax keyword javaScriptGlobalObjects Array Boolean Date Function Infinity Math Number NaN Object Packages RegExp String netscape
-syntax keyword javaScriptExceptions Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
+syntax keyword javaScriptExceptions try catch throw finally Error EvalError RangeError ReferenceError SyntaxError TypeError URIError
-syntax keyword javaScriptFutureKeys abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
+syntax keyword javaScriptReserved abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public
"" DOM/HTML/CSS specified things
" DOM2 Objects
- syntax keyword javaScriptGlobalObjects DOMImplementation DocumentFragment Document Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
+ syntax keyword javaScriptType DOMImplementation DocumentFragment Node NodeList NamedNodeMap CharacterData Attr Element Text Comment CDATASection DocumentType Notation Entity EntityReference ProcessingInstruction
syntax keyword javaScriptExceptions DOMException
" DOM2 CONSTANT
@@ -97,7 +129,7 @@ syntax keyword javaScriptFutureKeys abstract enum int short boolean export i
" HTML events and internal variables
syntax case ignore
- syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize
+ syntax keyword javaScriptHtmlEvents onblur onclick oncontextmenu ondblclick onfocus onkeydown onkeypress onkeyup onmousedown onmousemove onmouseout onmouseover onmouseup onresize onload onsubmit
syntax case match
" Follow stuff should be highligh within a special context
@@ -135,43 +167,23 @@ endif "DOM/HTML/CSS
"" Code blocks
-syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptExceptions,javaScriptFutureKeys,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation
-syntax region javaScriptBracket matchgroup=javaScriptBracket transparent start="\[" end="\]" contains=@javaScriptAll,javaScriptParensErrB,javaScriptParensErrC,javaScriptBracket,javaScriptParen,javaScriptBlock,@htmlPreproc
-syntax region javaScriptParen matchgroup=javaScriptParen transparent start="(" end=")" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrC,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
-syntax region javaScriptBlock matchgroup=javaScriptBlock transparent start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock,@htmlPreproc
-
-"" catch errors caused by wrong parenthesis
-syntax match javaScriptParensError ")\|}\|\]"
-syntax match javaScriptParensErrA contained "\]"
-syntax match javaScriptParensErrB contained ")"
-syntax match javaScriptParensErrC contained "}"
+syntax cluster javaScriptAll contains=javaScriptComment,javaScriptLineComment,javaScriptDocComment,javaScriptStringD,javaScriptStringS,javaScriptRegexpString,javaScriptNumber,javaScriptFloat,javaScriptLabel,javaScriptSource,javaScriptType,javaScriptOperator,javaScriptBoolean,javaScriptNull,javaScriptFunction,javaScriptConditional,javaScriptGlobal,javaScriptRepeat,javaScriptBranch,javaScriptStatement,javaScriptGlobalObjects,javaScriptMessage,javaScriptIdentifier,javaScriptExceptions,javaScriptReserved,javaScriptDeprecated,javaScriptDomErrNo,javaScriptDomNodeConsts,javaScriptHtmlEvents,javaScriptDotNotation,javaScriptBrowserObjects,javaScriptDOMObjects,javaScriptAjaxObjects,javaScriptPropietaryObjects,javaScriptDOMMethods,javaScriptHtmlElemProperties,javaScriptDOMProperties,javaScriptEventListenerKeywords,javaScriptEventListenerMethods,javaScriptAjaxProperties,javaScriptAjaxMethods
if main_syntax == "javascript"
syntax sync clear
syntax sync ccomment javaScriptComment minlines=200
- syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
+ " syntax sync match javaScriptHighlight grouphere javaScriptBlock /{/
endif
-"" Fold control
-if exists("b:javascript_fold")
- syntax match javaScriptFunction /\<function\>/ nextgroup=javaScriptFuncName skipwhite
- syntax match javaScriptOpAssign /=\@<!=/ nextgroup=javaScriptFuncBlock skipwhite skipempty
- syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
- syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
-
- if &l:filetype=='javascript' && !&diff
- " Fold setting
- " Redefine the foldtext (to show a JS function outline) and foldlevel
- " only if the entire buffer is JavaScript, but not if JavaScript syntax
- " is embedded in another syntax (e.g. HTML).
- setlocal foldmethod=syntax
- setlocal foldlevel=4
- endif
-else
- syntax keyword javaScriptFunction function
- setlocal foldmethod<
- setlocal foldlevel<
-endif
+syntax match javaScriptFunction /\<function\>/ nextgroup=javaScriptFuncName skipwhite
+syntax region javaScriptFuncName contained matchgroup=javaScriptFuncName start=/\%(\$\|\w\)*\s*(/ end=/)/ contains=javaScriptLineComment,javaScriptComment nextgroup=javaScriptFuncBlock skipwhite skipempty
+" syntax region javaScriptFuncBlock contained matchgroup=javaScriptFuncBlock start="{" end="}" contains=@javaScriptAll,javaScriptParensErrA,javaScriptParensErrB,javaScriptParen,javaScriptBracket,javaScriptBlock fold
+
+syn match javaScriptBraces "[{}\[\]]"
+syn match javaScriptParens "[()]"
+syn match javaScriptOpSymbols "=\{1,3}\|!==\|!=\|<\|>\|>=\|<=\|++\|+=\|--\|-="
+syn match javaScriptEndColons "[;,]$"
+syn match javaScriptLogicSymbols "\(&&\)\|\(||\)"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
@@ -183,6 +195,12 @@ if version >= 508 || !exists("did_javascript_syn_inits")
else
command -nargs=+ HiLink hi def link <args>
endif
+
+ HiLink javaScriptEndColons Exception
+ HiLink javaScriptOpSymbols Operator
+ HiLink javaScriptLogicSymbols Boolean
+ HiLink javaScriptBraces Function
+ HiLink javaScriptParens Operator
HiLink javaScriptComment Comment
HiLink javaScriptLineComment Comment
HiLink javaScriptDocComment Comment
@@ -194,18 +212,23 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink javaScriptStringS String
HiLink javaScriptStringD String
HiLink javaScriptRegexpString String
+ HiLink javaScriptGlobal Constant
HiLink javaScriptCharacter Character
HiLink javaScriptPrototype Type
HiLink javaScriptConditional Conditional
HiLink javaScriptBranch Conditional
+ HiLink javaScriptIdentifier Identifier
HiLink javaScriptRepeat Repeat
HiLink javaScriptStatement Statement
HiLink javaScriptFunction Function
+ HiLink javaScriptMessage Keyword
+ HiLink javaScriptDeprecated Exception
HiLink javaScriptError Error
HiLink javaScriptParensError Error
HiLink javaScriptParensErrA Error
HiLink javaScriptParensErrB Error
HiLink javaScriptParensErrC Error
+ HiLink javaScriptReserved Keyword
HiLink javaScriptOperator Operator
HiLink javaScriptType Type
HiLink javaScriptNull Type
@@ -223,12 +246,32 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink javaScriptDomElemAttrs Label
HiLink javaScriptDomElemFuncs PreProc
- HiLink javaScriptHtmlEvents Special
HiLink javaScriptHtmlElemAttrs Label
HiLink javaScriptHtmlElemFuncs PreProc
HiLink javaScriptCssStyles Label
+ " Ajax Highlighting
+ HiLink javaScriptBrowserObjects htmlString
+
+ HiLink javaScriptDOMObjects htmlString
+ HiLink javaScriptDOMMethods Exception
+ HiLink javaScriptDOMProperties Type
+
+ HiLink javaScriptAjaxObjects htmlH1
+ HiLink javaScriptAjaxMethods Exception
+ HiLink javaScriptAjaxProperties Type
+
+ HiLink javaScriptFuncName Title
+
+ HiLink javaScriptHtmlEvents Special
+ HiLink javaScriptHtmlElemProperties Boolean
+
+ HiLink javaScriptEventListenerKeywords Keyword
+
+ HiLink javaScriptNumber Number
+ HiLink javaScriptPropietaryObjects Constant
+
delcommand HiLink
endif
View
8 .zsh.d/webkit.zsh
@@ -5,6 +5,7 @@ function set-webkit-path() {
if [ -d "$d/$S" ]; then
echo "$0: using $d/$S";
export PATH="$d/$S":$PATH;
+ alias drt="$d/Source/WebKit/chromium/xcodebuild/Debug/DumpRenderTree.app/Contents/MacOS/DumpRenderTree"
return 0;
else
d=`dirname $d`;
@@ -23,7 +24,8 @@ function bwf() {
p=`which build-webkit`
base=${p%%/Tools/Scripts/build-webkit}
mv -f $base/build.log{,.bak} &> /dev/null
- time build-webkit --debug --makeargs='-j10' $@ 2>&1 | tee $base/build.log
+ time build-webkit --debug --makeargs='-j7' $@ 2>&1 | tee $base/build.log
+ growl finished compiling
}
function bw() {
@@ -38,6 +40,10 @@ function bw() {
bwf --minimal $features $@;
}
+function bwc {
+ bwf --chromium --v8
+}
+
function wt() {
if ! hash new-run-webkit-tests &> /dev/null && ! set-webkit-path &> /dev/null; then
echo "$0: error: no build-webkit on PATH" >&2;

No commit comments for this range

Something went wrong with that request. Please try again.