Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conceal to double and tripple equal #1155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "≑"
Comment on lines -71 to +84
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bradwood , which part of the README.md needs to be updated ?



You can enable concealing within VIM with:
Expand Down
4 changes: 3 additions & 1 deletion syntax/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ exe 'syntax match jsFunction /\<function\>/ 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
Expand Down Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should actually be added to jsExpression above, not all


" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
Expand Down