3

In my vim, I'm using gruvbox. Syntax colorization is great for everything except text written between `backticks`. You'll note once backticks are used, all subsequent lines of text are green. I would like backtick text to behave just like standard quoted text and to not screw up highlighting for the rest of the file. I write a lot of JavaScript. Thanks for the help in advance.

enter image description here

5
  • 1
    :call matchadd("String", "`\.\*`") This command add pattern "any characters between backticks, backticks included" to String highlight-group. :he matchadd :he pattern :hi
    – Alex Kroll
    Jun 6 '19 at 7:07
  • This is more likely to be an issue with the syntax file. Contact the maintainers of whichever syntax file you use and ask them to fix it. One way to help debug is to figure out the syntax groups around the broken area.
    – D. Ben Knoble
    Jun 6 '19 at 12:41
  • @D.BenKnoble - Issue opened here: github.com/morhetz/gruvbox/issues/284 Go vote it up!
    – 4Z4T4R
    Jun 7 '19 at 5:27
  • 1
    @azatar thats the colorscheme. I was referring to the syntax file for javascript.
    – D. Ben Knoble
    Jun 7 '19 at 12:34
  • @D.BenKnoble - You're right. My mistake. Thanks for helping!
    – 4Z4T4R
    Jun 9 '19 at 2:43
2

Thanks to the keen @D. Ben Knoble, I did some deeper digging into Javascript syntax... and found a vim plugin tailored specifically to Javascript called vim-javascript.

I installed it into the my_plugins directory inside my .vim_runtime folder that tunes The Ultimate Vim Configuration, which I also love more than any IDE so far.

That did the job swimmingly.

It works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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