Skip to content

Instantly share code, notes, and snippets.

@houkanshan
Created February 26, 2014 02:55
Show Gist options
  • Save houkanshan/9222669 to your computer and use it in GitHub Desktop.
Save houkanshan/9222669 to your computer and use it in GitHub Desktop.
From 28e484469ef9fcee1bdd1820afc1897a0b60ba91 Mon Sep 17 00:00:00 2001
From: houmai <[email protected]>
Date: Wed, 26 Feb 2014 10:49:17 +0800
Subject: [PATCH] add self as keyword.
---
syntax/javascript.vim | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/syntax/javascript.vim b/syntax/javascript.vim
index e72c63a..9c227dc 100644
--- a/syntax/javascript.vim
+++ b/syntax/javascript.vim
@@ -103,12 +103,14 @@ syntax keyword jsPrototype prototype
if g:javascript_conceal == 1
syntax keyword jsNull null conceal cchar=ø
syntax keyword jsThis this conceal cchar=@
+ syntax keyword jsSelf self conceal cchar=@
syntax keyword jsReturn return conceal cchar=⇚
syntax keyword jsUndefined undefined conceal cchar=¿
syntax keyword jsNan NaN conceal cchar=ℕ
else
syntax keyword jsNull null
syntax keyword jsThis this
+ syntax keyword jsSelf self
syntax keyword jsReturn return
syntax keyword jsUndefined undefined
syntax keyword jsNan NaN
@@ -181,7 +183,7 @@ endif "DOM/HTML/CSS
"" Code blocks
-syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise
+syntax cluster jsExpression contains=jsComment,jsLineComment,jsDocComment,jsStringD,jsStringS,jsRegexpString,jsNumber,jsFloat,jsThis,jsSelf,jsOperator,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsDotNotation,jsBracket,jsParen,jsBlock,jsFuncCall,jsUndefined,jsNan,jsKeyword,jsStorageClass,jsPrototype,jsBuiltins,jsNoise
syntax cluster jsAll contains=@jsExpression,jsLabel,jsConditional,jsRepeat,jsReturn,jsStatement,jsTernaryIf,jsException
syntax region jsBracket matchgroup=jsBrackets start="\[" end="\]" contains=@jsAll,jsParensErrB,jsParensErrC,jsBracket,jsParen,jsBlock,@htmlPreproc fold
syntax region jsParen matchgroup=jsParens start="(" end=")" contains=@jsAll,jsParensErrA,jsParensErrC,jsParen,jsBracket,jsBlock,@htmlPreproc fold
@@ -265,6 +267,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
HiLink jsOperator Operator
HiLink jsStorageClass StorageClass
HiLink jsThis Special
+ HiLink jsSelf Special
HiLink jsNan Number
HiLink jsNull Type
HiLink jsUndefined Type
--
1.8.3.4 (Apple Git-47)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment