1

editor: NVIM v0.4.3

I have the following syntax file at ~/.config/nvim/after/syntax/javascript.vim

syntax clear javaScriptFunction
syntax match javaScriptFunction /\<module.exports\>/ nextgroup=javaScriptFuncName skipwhite conceal cchar=@
hi! link Conceal javaScriptFunction`

The plugin I am using https://github.com/pangloss/vim-javascript.

My conceal code works fine if I don't enable vim-javascript plugin. But does not work with it. Is there a way to make it work with the plugin?

2
  • 1
    The hi command at the end should not be necessary. Also, are the line breaks present in your actual code? This might be an issue to file with the plugin. Lastly, check the conceallevel setting
    – D. Ben Knoble
    Dec 30, 2019 at 13:56
  • 1
    Thanks. Fixed the line breaks. No, they are not present in actual code. I filed the issue with the plugin 3-4 days ago. But did not hear anything from the author. Finally, the conceal level = 2. The plugin also sets up some conceals which work fine. Only my personal conceal wont work when the plugin is enabled. Dec 30, 2019 at 15:09

1 Answer 1

0

I am using the same plugin here's my config

"js syntax folding

augroup javascript_folding

    au!

    au filetype javascript setlocal foldmethod=syntax

augroup END

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 = "N"
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 = "🞅"

set conceallevel =3
4
  • The built it plugin conceals are working for me too. I am facing issue with adding new conceals that are not available in the plugin. Dec 31, 2019 at 10:15
  • must be sth in your code
    – TralahM
    Dec 31, 2019 at 10:20
  • probably. but code works fine if I disable the plugin Dec 31, 2019 at 10:32
  • Perhaps you should write your own plugin.... or fork this one and integrate your code into it....
    – TralahM
    Dec 31, 2019 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.