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

Poor yaml syntax when using stephpy/vim-yaml (and also Polyglot) #162

Closed
TheWall89 opened this issue Dec 17, 2019 · 7 comments · Fixed by #163
Closed

Poor yaml syntax when using stephpy/vim-yaml (and also Polyglot) #162

TheWall89 opened this issue Dec 17, 2019 · 7 comments · Fixed by #163

Comments

@TheWall89
Copy link
Contributor

What happened

Syntax highlight is not colouring YAML keys and un-quoted values with different colours.

What I expected to happen

I expect the key to have a different colour than the value.

Screenshot

drac_issue

With darkblue theme, syntax is better:
darkblue_ok

Machine Info

  • Vim type (vim/gvim/neovim): vim
  • Vim version: VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 7 2019 22:30:47)
  • OS: Linux archasus 5.4.3-zen1-1-zen I would like to make an option to use the ANSI colors #1 ZEN SMP PREEMPT Fri, 13 Dec 2019 09:40:17 +0000 x86_64 GNU/Linux
  • Terminal/Terminal Emulator/VTE: Konsole
  • TERM environment variable: xterm-256color

Additional Info

I checked out the file yaml.vim. It looks like Dracula uses matches and keyword from the default Vim syntax file for YAML. stephpy/vim-yaml uses different ones: https://github.com/stephpy/vim-yaml/blob/master/after/syntax/yaml.vim .

@dsifford
Copy link
Member

dsifford commented Dec 17, 2019

Yaml is supported and works properly using the built-in yaml syntax.

Feel free to open a PR which adjusts your syntax highlighting to match the built-in syntax.

@TheWall89
Copy link
Contributor Author

Unfortunately I'm not good at VIM syntax/plugin development :) But I'll give it a try when I have time.
In the meantime, I found a workaround for sheerun/vim-polyglot. Add this to .vimrc:

let g:polyglot_disabled = ['yaml']

And YAML files are beatiful with Dracula:
image

@benknoble
Copy link
Member

If the issue is that the other plugin defines new syntax groups, then you just need to track those down (in the syntax file you linked) and add new links in the style of after/syntax/yaml.vim

@dsifford
Copy link
Member

What's the status of this? Can this be closed now?

@benknoble benknoble linked a pull request Feb 20, 2020 that will close this issue
@benknoble
Copy link
Member

@dsifford it's unfortunate, but most of the comments re: the issue were on the PR. AFAIK, we are still waiting on stephpy/vim-yaml#22 (which, at this point, I don't expect to see fixed).

I think, given that the workaround "works," we can close with permission of @TheWall89

If @TheWall89 is bent on using vim-polyglot without this workaround, he should probably

  1. fork stephpy/vim-yaml
  2. Fix it
  3. Submit an issue/PR with polyglot to replace stephpy's code with his by changing the build script

@TheWall89
Copy link
Contributor Author

Hi guys. Yes, I'm closing this myself.

I'll try to issue a PR to stephpy and, if this is accepted, re-issue a new PR here to color the right groups with Dracula. Bye.

@benknoble
Copy link
Member

@TheWall89 if stephpy won't respond, consider forking as I outlined above ^

Best of luck🧛‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants