add and update vim plugins with sensible defaults
[webi-installers/.git] / vim-prettier / README.md
diff --git a/vim-prettier/README.md b/vim-prettier/README.md
new file mode 100644 (file)
index 0000000..8c7462a
--- /dev/null
@@ -0,0 +1,63 @@
+---
+title: vim-prettier
+homepage: https://github.com/prettier/vim-prettier
+tagline: |
+  vim-prettier adds Prettier support for Vim.
+---
+
+## Updating `vim-prettier`
+
+```bash
+webi vim-prettier
+```
+
+## Cheat Sheet
+
+> `vim-prettier` is a vim plugin wrapper for prettier, pre-configured with
+> custom default prettier settings.
+
+You'll also need `ALE`, [`syntastic`](https://webinstall.dev/vim-syntastic), or
+similar.
+
+### How to install by hand
+
+```bash
+git clone --depth=1 https://github.com/prettier/vim-prettier ~/.vim/pack/plugins/start/vim-prettier
+```
+
+### How to configure your `.vimrc`
+
+```vim
+" don't check syntax immediately on open or on quit
+let g:syntastic_check_on_open = 1
+let g:syntastic_check_on_wq = 0
+
+" we also want to get rid of accidental trailing whitespace on save
+autocmd BufWritePre * :%s/\s\+$//e
+```
+
+```vim
+"""""""""""""""""""""""""""
+" Prettier-specific options "
+"""""""""""""""""""""""""""
+
+" format as-you-type is quite annoying, so we turn it off
+let g:prettier#autoformat = 0
+
+" list all of the extensions for which prettier should run
+autocmd BufWritePre .babelrc,.eslintrc,.jshintrc,*.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
+```
+
+### How to install Prettier
+
+With `webi`:
+
+```bash
+webi prettier
+```
+
+With `node`:
+
+```bash
+npm install -g prettier@2
+```