using prettier with helix #3198
-
|
Hello, I am a beginner and I am trying to switch to helix, coming from vscode. I am trying to set prettier with helix but I can't find a lot ressources on the subject. Any ideas how to set prettier on save with helix ? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 15 replies
-
|
There is #2942 which will allow you to set a non-LSP formatter for the language. |
Beta Was this translation helpful? Give feedback.
-
|
It is working great on Linux with Prettier installed globally and (for example for TypeScript): Has anyone tried the new: https://prettier.io/blog/2022/06/14/2.7.0.html#cli ? I am wondering if it does anything when it is only a single buffer being formatted as in Helix?
|
Beta Was this translation helpful? Give feedback.
-
|
I made a WIKI article that covers Prettier: https://github.com/helix-editor/helix/wiki/External-binary-formatter-configuration |
Beta Was this translation helpful? Give feedback.
-
|
I discovered a problem with prettier using different parsers based on filenames. I reported it here: #3596 |
Beta Was this translation helpful? Give feedback.
-
|
Anyone knows how to use a config file with prettier? The command I run in the cli is I've tried to configure helix with this:
It does not seems to be using prettier at all. I think it's using the lsp formatter... 😕 |
Beta Was this translation helpful? Give feedback.
-
|
I write https://github.com/watertank/lsp-prettier with help of Copilot. If you use Windows, you can try it. setup, global or project [language-server.lsp-prettier]
command = "lsp-prettier"
args = [ "--stdio" ]
[[language]]
name = "html"
# put lsp-prettier before other servers that also provide formatting function
language-servers = [ "lsp-prettier", "vscode-html-language-server", "emmet-lsp", "typos-lsp" ]
|
Beta Was this translation helpful? Give feedback.
There is #2942 which will allow you to set a non-LSP formatter for the language.