aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMitermayer Reis <mitermayer.reis@gmail.com>2017-06-06 12:27:50 -0700
committerGitHub <noreply@github.com>2017-06-06 12:27:50 -0700
commitc28004d9c616a3599e8d0622c87fa071aa2342e8 (patch)
treefb0924bf23922badf6f025b1e645189a75977d1c /doc
parentb394b4c23622fe3aae78333d7830bc5dabf11e50 (diff)
parenta3df2e771010f9c70e74fadda32dd81a28b88f4f (diff)
downloadvim-prettier-0.0.5.tar.xz
Merge pull request #11 from mitermayer/feature/adding-support-for-new-parsers-bump-prettier0.0.5
Bumping support to latest prettier ^1.4.X, enabling support for css,scss,less,typescript formatting and allowing user configuration to enable async as the default for configuration for `:Prettier` command
Diffstat (limited to 'doc')
-rw-r--r--doc/prettier.txt29
1 files changed, 20 insertions, 9 deletions
diff --git a/doc/prettier.txt b/doc/prettier.txt
index 584595a..08550ed 100644
--- a/doc/prettier.txt
+++ b/doc/prettier.txt
@@ -5,6 +5,7 @@ CONTENTS *vim-prettier-contents*
Introduction |vim-prettier-introduction|
Install |vim-prettier-install|
Usage |vim-prettier-usage|
+Configuration |vim-prettier-configuration|
Requirements |vim-prettier-requirements|
==============================================================================
@@ -13,8 +14,8 @@ INTRODUCTION *vim-prettier-introduction*
A vim plugin wrapper for prettier, pre-configured with
custom default prettier settings.
-By default it will auto format javascript files that have "@format"
-annotation in the header of the file.
+By default it will auto format javascript, typescript, less, scss and
+css files that have '@format' annotation in the header of the file.
When installed via vim-plug, a default prettier executable is installed inside
vim-prettier.
@@ -31,7 +32,9 @@ INSTALL *vim-prettier-install*
Install with [vim-plug](https://github.com/junegunn/vim-plug), assumes
node and yarn|npm installed globally.
>
- Plug 'mitermayer/vim-prettier', { 'do': 'yarn install', 'for': 'javascript' }
+ plug 'mitermayer/vim-prettier', {
+ \ 'do': 'yarn install',
+ \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss'] }
<
If using other vim plugin managers or doing manual setup make sure to have
`prettier` installed globally or go to your vim-prettier directory and
@@ -40,21 +43,29 @@ either do `npm install` or `yarn install`
==============================================================================
USAGE *vim-prettier-usage*
-Prettier can be manualy triggered by:
+Prettier by default will run on auto save but can also
+be manualy triggered by:
>
<Leader>p
<
-Formats the entire buffer
+or
>
:Prettier
<
-Disable auto formatting of javascript files that have "@format" tag
+==============================================================================
+CONFIGURATION *vim-prettier-configuration*
+
+Disable auto formatting of files that have "@format" tag
>
let g:prettier#autoformat = 0
<
-Enable vim-prettier to run in javascript files without the "@format" doc tag
+The command `:Prettier` by default is synchronous but can be forced to be async
+>
+ let g:prettier#exec_cmd_async = 1
+<
+Enable vim-prettier to run in files without requiring the "@format" doc tag
>
- autocmd BufWritePre *.js call prettier#Prettier()
+ autocmd BufWritePre *.js,*.css,*.scss,*.less call prettier#Prettier()
<
Overwrite default configuration
>
@@ -82,7 +93,7 @@ Overwrite default configuration
" none|es5|all
g:prettier#config#trailing_comma = 'all'
- " flow|babylon
+ " flow|babylon|typescript|postcss
g:prettier#config#parser = 'flow'
<
==============================================================================