Skip to content

Commit 25ff937

Browse files
committed
Adding some common NodeJS globals
1 parent 352bcc2 commit 25ff937

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

syntax/javascript.vim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ syntax match jsSwitchColon contained /:/ skipwhite skipempty nextgro
114114

115115
" Keywords
116116
syntax keyword jsGlobalObjects Array Boolean Date Function Iterator Number Object Symbol Map WeakMap Set RegExp String Proxy Promise Buffer ParallelArray ArrayBuffer DataView Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray JSON Math console document window Intl Collator DateTimeFormat NumberFormat
117+
syntax keyword jsGlobalNodeObjects module exports global process
118+
syntax match jsGlobalNodeObjects /require/ contains=jsFuncCall
117119
syntax keyword jsExceptions Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError
118120
syntax keyword jsBuiltins decodeURI decodeURIComponent encodeURI encodeURIComponent eval isFinite isNaN parseFloat parseInt uneval
119121
" DISCUSS: How imporant is this, really? Perhaps it should be linked to an error because I assume the keywords are reserved?
@@ -278,7 +280,7 @@ if version >= 508 || !exists("did_javascript_syn_inits")
278280
HiLink jsStorageClass StorageClass
279281
HiLink jsClassKeywords Structure
280282
HiLink jsThis Special
281-
HiLink jsSuper Special
283+
HiLink jsSuper Constant
282284
HiLink jsNan Number
283285
HiLink jsNull Type
284286
HiLink jsUndefined Type
@@ -299,9 +301,10 @@ if version >= 508 || !exists("did_javascript_syn_inits")
299301
HiLink jsSpecial Special
300302
HiLink jsTemplateVar Special
301303
HiLink jsTemplateBraces jsBraces
302-
HiLink jsGlobalObjects Special
303-
HiLink jsExceptions Special
304-
HiLink jsBuiltins Special
304+
HiLink jsGlobalObjects Constant
305+
HiLink jsGlobalNodeObjects Constant
306+
HiLink jsExceptions Constant
307+
HiLink jsBuiltins Constant
305308
HiLink jsModuleKeywords Include
306309
HiLink jsModuleOperators Include
307310
HiLink jsModuleDefault Include

0 commit comments

Comments
 (0)