diff options
| author | mitermayer <mitermayer.reis@gmail.com> | 2018-06-03 23:11:06 -0700 |
|---|---|---|
| committer | mitermayer <mitermayer.reis@gmail.com> | 2018-06-03 23:11:06 -0700 |
| commit | 33d19b72f4f97cccf68b1581f6d33b900bdb4b3c (patch) | |
| tree | aed19c1a1113d7d0e797b799cbaa6537d660a27b /README.md | |
| parent | ec6ede90f3b9948ed7063402189653f8d6721326 (diff) | |
| download | vim-prettier-33d19b72f4f97cccf68b1581f6d33b900bdb4b3c.tar.xz | |
Adding documentation for prettier partial formatting
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -79,6 +79,22 @@ If your are on vim 8+ you can also trigger async formatting by: :PrettierAsync ``` +You can send to prettier your entire buffer but ensure that it formats only your selection. + +**note: ** differs from `:PrettierFragment` by sending the entire buffer to prettier, allowing identation level to be preserved, but it requires the whole file to be valid. + +```vim +:PrettierPartial +``` + +You can send to prettier your current selection as a fragment of same type as the file being edited. + +**note: ** differs from `:PrettierFragment` by sending only the current selection to prettier, this allows for faster formatting but wont preserve indentation. + +````vim +:PrettierFragment +``` + You can check what is the `vim-prettier` plugin version by: ```vim @@ -135,6 +151,13 @@ By default parsing errors will open the quickfix but can also be disabled let g:prettier#quickfix_enabled = 0 ``` +By default selection formatting will be running `:PrettierFragment` but we can set +`:PrettierPartial` as the default selection formatting by: + +```vim +let g:prettier#partial_format=1 +``` + By default we auto focus on the quickfix when there are errors but can also be disabled ```vim @@ -205,3 +228,5 @@ let g:prettier#config#prose_wrap = 'preserve' ### REQUIREMENT(S) If prettier installation can't be found no code formatting will happen +``` +```` |
