-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
Support custom prettier plugins #119
Comments
Hi @andreiglingeanu, This is denifitly something we want to have integrated in In the meantime also accepting PR's for it. Integration should be straight forward since Feel free to submit a PR for it otherwise will try to look into it during the weekend |
Sounds great! I'll try to have a look but I'm not 100% sure I'll be able to handle it, thanks for a quick heads up, though! |
Getting back to it, I found a solution. It turns out that How I got
autocmd FileType php let b:prettier_ft_default_args = {
\ 'parser': 'php',
\ } As for integrating it into the plugin, we could take a two approaches:
I tend to think that the second option is more than enough. |
Hi @andreiglingeanu, Thanks for looking into this! We could also add to I think it make sense to create a file type detect and a file type plugin for 'swift', 'php' and 'python' and define a default parser for them in there like you describe on '1'. Users can always overwrite that behaviour with a .prettierrc configuration file |
I've opened a PR with some progress towards this. Could use some help and feedback. Thanks! |
Once I get a beta version of vim-prettier 1.0 will try including this PR in there and see if I can debug a bit more on what the failures were |
Link to PR? |
I will have some time to keep working on this during the weekend. Will be porting the open PR to branch 1.x as this is one of the last major tasks for 1.x release |
I will try to merge this week ! Finally have sometime to work on this |
This has been merged on #155 on release/1.x branch |
@mitermayer tested it, works nicely! Thanks for that! But there is a small glitch anyway, when
This easily gets fixed by #158 |
Currently, there a couple of prettier plugins that will offer consistent formatting for other languages. I tried
prettier-php
these days, it worked smooth from CLI but I was not able to get the plugin to work properly with this plugin, it just didn't passed a properparser
option to theprettier
CLI command, it was probably just my bad knowledge of VimL...Is there a plan for getting a smooth vim-prettier experience with custom plugins?
Thanks a lot for the awesome work!
The text was updated successfully, but these errors were encountered: