-
Notifications
You must be signed in to change notification settings - Fork 150
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
Syntax Highlighting? #19
Comments
Here is a syntax file I came up with for ST3. Requires GoSublime. %YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: "QuickTemplate"
file_extensions:
- qtpl
scope: source.qtpl
contexts:
main:
- include: scope:text.html.basic
- match: "{%"
push: "Packages/GoSublime/syntax/GoSublime-Go.tmLanguage"
with_prototype:
- match: "(?=%})"
pop: true
- match: "(code|space|elseif|endif|endfor|endfunc|comment|endcomment|plain|endplain|stripspace|endstripspace|collapsespace|endcollapsespace|endswitch)"
scope: "keyword.other.go" I'm a Sublime syntax newbie so probably lots of improvements to be made but the basics seem to work (highlighting html, go, and quicktemplate keywords all in the same file). |
@escholtz , thanks for the contribution! Just added a link to this issue from the FAQ in the README.md |
How about something for vim? |
@tobstarr , I'm not familiar with vim syntax highlighting, so contributions are welcome :) |
btw, I use vim, so will be very glad if |
@valyala hi i like quicktemplate so much i made a simple syntax highlighter for vim. https://github.com/warbear0129/vim-qtpl |
@valyala, @warbear0129's package wasn't working for me and a couple other people. I've submitted a PR that should get it working for most vim runtimes. Also now it works with Vundle and Pathogen. Thanks to warbear for the syntax file. It just needed some tweaks. If anyone is having issues they can take a look at my fork (if the PR below is not merged) |
@valyala Actually a quick update. The other vim-qtpl package was pretty bare on features and html syntax support. I found it better to take the well written and supported vim-go plugin and add support quicktemplate syntax. I've been testing it out and this is a much better approach. The PR I submitted to vim-go is here: fatih/vim-go#1241 My fork here (until @fatih) merges it in: https://github.com/codelitt/vim-go Hopefully this is much more helpful. |
@codelitt that looks pretty cool! |
@tobstarr Thanks! I've been testing it out and it's working very well. Plus it brings all of the awesome things from vim-go to these filetypes (like go fmt) |
Re-opened the issue in order to make it more prominent (and it is incomplete yet). |
@valyala My fork of vim-go provides this very completely: https://github.com/codelitt/vim-go
|
I've suggested to you that you can provide it as a separate plugin. You didn't and then say you forked vim-go (which I think is unreliable as well, but that's not my business) I have limited time,a family, work to do, and many other things. I can't just merge every single feature out there in the universe. it's 5-10 lines. Just create a |
@fatih Perhaps that was poorly worded. I meant unfortunate in the sense of "Now we'll have to sort out something else" and not as a criticism of you. I agree it's a poor choice to try to maintain a separate fork, it's just what I've been doing until I have more time. I completely understand your position as a maintainer and understand you don't feel like this is a good fit for I just went back and re-read the comments on the PR. I'm not sure what it takes to make a plugin that integrates with another plugin like |
@codelitt no worries. I apologize if my words were harsh as well. Didn't meant it. Thanks for your understanding. |
@fatih No worries on my end either. I'd welcome any docs about creating a plugin which integrates with/relies on another plugin (in this case |
Is there any syntax highlighter for Intellij based IDEs? |
Would love to see someone do the VSCode extension. |
I missed this thread when I opened an issue earlier, but here is basic syntax highlighting for vs code: https://marketplace.visualstudio.com/items?itemName=vsatomi.vscode-quicktemplate |
@tural-esger for IntelliJ GoLand I created this issue, which you can upvote: https://youtrack.jetbrains.com/issue/GO-4810 |
@stereosteve Can we create our syntax highlighting with this |
Better vim support would be great. The warbear0129/vim-qtpl plugin sorta works, but breaks as soon as I edit the file. It also doesn't have embedded HTML support which is a big letdown. |
I've begun working on my own Vim Quicktemplate syntax plugin: b0o/quicktemplate.vim. I'm a complete noob when it comes to creating syntax rules for Vim, and the Quicktemplate grammar is rather complex when you take into account the fact that it essentially has 2+ other languages embedded within it (go, html, [js, css]). It took me quite a while to get anything working at all, but I think at this point my version offers a bit more room for improvement than warbear0129/vim-qtpl. My main issue with I would welcome contributions from anyone who is better with VimL or Vim syntax parsing than me, but I'll be attempting to make this plugin semi-complete over the next few weeks. Update 02-11-2018: I've been working on this plugin quite a bit, and it's now to the point where most things work quite well. Here's an updated screenshot: |
Any news for VSCode or Goland? |
Yes. take a look inside the README.md file
But i have to say it is not very good and no it does not have the type of autocompletion you may expect. its ... lets say .... simple |
Hello @escholtz, @valyala, please give it a try, and share your feedback. |
Do you know if anyone has started adding syntax highlighting support for various text editors? My personal interest is for Sublime Text.
The text was updated successfully, but these errors were encountered: