# Hugo and Prettier

**URL:** <https://discourse.gohugo.io/t/hugo-and-prettier/22596>\
**Category:** Uncategorized\
**Created:** [January 2, 2020, 8:58am UTC](https://discourse.gohugo.io/t/hugo-and-prettier/22596 "2020-01-02T08:58:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)\
**Post date:** [January 2, 2020, 8:58am UTC](https://discourse.gohugo.io/t/hugo-and-prettier/22596/1 "2020-01-02T08:58:17Z")

</div>

It is not a Hugo question. I am a Vim user and would like to use prettier for Hugo. The question is, how can I configure prettier for the md and html files?

---

<div class="post-metadata">

**Author:** ![OiYouYeahYou](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/oiyouyeahyou/32/10286_2.png) [@OiYouYeahYou](https://discourse.gohugo.io/u/OiYouYeahYou)\
**Post date:** [January 2, 2020, 11:31pm UTC](https://discourse.gohugo.io/t/hugo-and-prettier/22596/2 "2020-01-02T23:31:13Z")

</div>

Try adding `"proseWrap": "always"` to you your `.prettierrc`. Docs: [https://prettier.io/docs/en/options.html#prose-wrap](https://prettier.io/docs/en/options.html#prose-wrap)

---

<div class="post-metadata">

**Author:** ![Joerg](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@Joerg](https://discourse.gohugo.io/u/Joerg)\
**Post date:** [January 3, 2020, 8:36am UTC](https://discourse.gohugo.io/t/hugo-and-prettier/22596/3 "2020-01-03T08:36:25Z")

</div>

It works fine. Thank you

---

<div class="post-metadata">

**Author:** ![niklaspor](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/niklaspor/32/11613_2.png) [@niklaspor](https://discourse.gohugo.io/u/niklaspor)\
**Post date:** [June 12, 2020, 8:13pm UTC](https://discourse.gohugo.io/t/hugo-and-prettier/22596/4 "2020-06-12T20:13:21Z")

</div>

I wrote a small plugin for prettier, which formats html without breaking the `{{ }}`:

[prettier-plugin-go-template](https://github.com/NiklasPor/prettier-plugin-go-template)

To use it with GoHugo or basic `.html` files, you’ll have to override the used parser inside your `.prettierrc` file:

```auto
{
  "overrides": [
    {
      "files": ["*.html"],
      "options": {
        "parser": "go-template"
      }
    }
  ]
}

```
