From c97a1a3aec039b755dd5513030a939b3ca9f6500 Mon Sep 17 00:00:00 2001 From: cabaalexander Date: Thu, 17 Jan 2019 22:39:49 -0400 Subject: [PATCH] Add conceal to double and tripple equal * Add changes to `README.md` --- README.md | 24 +++++++++++++----------- syntax/javascript.vim | 4 +++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b9ac49f4..5f9cc626 100644 --- a/README.md +++ b/README.md @@ -68,18 +68,20 @@ Please note this can have a dramatic effect on performance. You can customize concealing characters, if your font provides the glyph you want, by defining one or more of the following variables: - let g:javascript_conceal_function = "ƒ" - let g:javascript_conceal_null = "ø" - let g:javascript_conceal_this = "@" - let g:javascript_conceal_return = "⇚" - let g:javascript_conceal_undefined = "¿" - let g:javascript_conceal_NaN = "ℕ" - let g:javascript_conceal_prototype = "¶" - let g:javascript_conceal_static = "•" - let g:javascript_conceal_super = "Ω" - let g:javascript_conceal_arrow_function = "⇒" - let g:javascript_conceal_noarg_arrow_function = "🞅" + let g:javascript_conceal_function = "ƒ" + let g:javascript_conceal_null = "ø" + let g:javascript_conceal_this = "@" + let g:javascript_conceal_return = "⇚" + let g:javascript_conceal_undefined = "¿" + let g:javascript_conceal_NaN = "ℕ" + let g:javascript_conceal_prototype = "¶" + let g:javascript_conceal_static = "•" + let g:javascript_conceal_super = "Ω" + let g:javascript_conceal_arrow_function = "⇒" + let g:javascript_conceal_noarg_arrow_function = "🞅" let g:javascript_conceal_underscore_arrow_function = "🞅" + let g:javascript_conceal_double_equal = "≈" + let g:javascript_conceal_triple_equal = "≡" You can enable concealing within VIM with: diff --git a/syntax/javascript.vim b/syntax/javascript.vim index f08a063a..6048dd53 100644 --- a/syntax/javascript.vim +++ b/syntax/javascript.vim @@ -174,6 +174,8 @@ exe 'syntax match jsFunction /\/ skipwhite skipempty nextgroup=j exe 'syntax match jsArrowFunction /=>/ skipwhite skipempty nextgroup=jsFuncBlock,jsCommentFunction '.(exists('g:javascript_conceal_arrow_function') ? 'conceal cchar='.g:javascript_conceal_arrow_function : '') exe 'syntax match jsArrowFunction /()\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_noarg_arrow_function') ? 'conceal cchar='.g:javascript_conceal_noarg_arrow_function : '') exe 'syntax match jsArrowFunction /_\ze\s*=>/ skipwhite skipempty nextgroup=jsArrowFunction '.(exists('g:javascript_conceal_underscore_arrow_function') ? 'conceal cchar='.g:javascript_conceal_underscore_arrow_function : '') +exe 'syntax match jsDoubleEqual /=\{2}/ contained '.(exists('g:javascript_conceal_double_equal') ? 'conceal cchar='.g:javascript_conceal_double_equal : '') +exe 'syntax match jsTripleEqual /=\{3}/ contained '.(exists('g:javascript_conceal_triple_equal') ? 'conceal cchar='.g:javascript_conceal_triple_equal : '') " Classes syntax keyword jsClassKeyword contained class @@ -231,7 +233,7 @@ if exists("javascript_plugin_flow") endif syntax cluster jsExpression contains=jsBracket,jsParen,jsObject,jsTernaryIf,jsTaggedTemplate,jsTemplateString,jsString,jsRegexpString,jsNumber,jsFloat,jsOperator,jsOperatorKeyword,jsBooleanTrue,jsBooleanFalse,jsNull,jsFunction,jsArrowFunction,jsGlobalObjects,jsExceptions,jsFutureKeys,jsDomErrNo,jsDomNodeConsts,jsHtmlEvents,jsFuncCall,jsUndefined,jsNan,jsPrototype,jsBuiltins,jsNoise,jsClassDefinition,jsArrowFunction,jsArrowFuncArgs,jsParensError,jsComment,jsArguments,jsThis,jsSuper,jsDo,jsForAwait,jsAsyncKeyword,jsStatement,jsDot -syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel +syntax cluster jsAll contains=@jsExpression,jsStorageClass,jsConditional,jsRepeat,jsReturn,jsException,jsTry,jsNoise,jsBlockLabel,jsDoubleEqual,jsTripleEqual " Define the default highlighting. " For version 5.7 and earlier: only when not done already