aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authormitermayer <mitermayer.reis@gmail.com>2017-05-24 15:42:23 -0700
committermitermayer <mitermayer.reis@gmail.com>2017-05-24 15:42:23 -0700
commita53ffa1ba81c76d0b2c29afe55ab131c6cc9a0e3 (patch)
tree961dee4402b96dc64dbdad2a621943027cb63b97 /doc
downloadvim-prettier-0.0.1.tar.xz
First commit0.0.1
Diffstat (limited to 'doc')
-rw-r--r--doc/prettier.txt88
1 files changed, 88 insertions, 0 deletions
diff --git a/doc/prettier.txt b/doc/prettier.txt
new file mode 100644
index 0000000..8c9ed22
--- /dev/null
+++ b/doc/prettier.txt
@@ -0,0 +1,88 @@
+*vim-prettier.txt* A prettier plugin for vim.
+
+CONTENTS *vim-prettier-contents*
+
+Introduction |vim-prettier-introduction|
+Install |vim-prettier-install|
+Usage |vim-prettier-usage|
+Requirements |vim-prettier-requirements|
+
+==============================================================================
+INTRODUCTION *vim-prettier-introduction*
+
+A vim plugin wrapper for prettier, pre-configured with
+custom default prettier settings.
+
+When installed via vim-plug, a default prettier executable is installed inside
+ vim-prettier.
+
+vim-prettier executable resolution:
+
+1. Tranverse parents and search for Prettier installation inside `node_modules`
+2. Look for a global prettier installation
+3. Use locally installed vim-prettier prettier executable
+
+==============================================================================
+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' }
+<
+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
+either do `npm install` or `yarn install`
+
+==============================================================================
+USAGE *vim-prettier-usage*
+
+Formats the entire buffer
+>
+ :Prettier
+<
+Disable auto formatting of javascript files that have "@format" tag
+>
+ let g:prettier#autoformat = 0
+<
+Enable vim-prettier to run in javascript files without the "@format" doc tag
+>
+ autocmd BufWritePre *.js call prettier#Prettier()
+<
+Overwrite default configuration
+>
+ " max line lengh that prettier will wrap on
+ g:prettier#config#print_width = 80
+
+ " number of spaces per indentation level
+ g:prettier#config#tab_width = 2
+
+ " use tabs over spaces
+ g:prettier#config#use_tabs = 0
+
+ " print semicolons
+ g:prettier#config#semi = 1
+
+ " single quotes over double quotes
+ g:prettier#config#single_quote = 1
+
+ " print spaces between brackets
+ g:prettier#config#bracket_spacing = 0
+
+ " put > on the last line instead of new line
+ g:prettier#config#jsx_bracket_same_line = 1
+
+ " none|es5|all
+ g:prettier#config#trailing_comma = 'all'
+
+ " flow|babylon
+ g:prettier#config#parser = 'flow'
+<
+==============================================================================
+REQUIREMENT(S) *vim-prettier-requirements*
+
+If prettier is not installed locally, globally or inside vim-prettier project
+no code formatting will happen
+
+==============================================================================
+vim:tw=78:ts=4:ft=help:norl:noet:fen:noet: