Skip to content

Commit

Permalink
Merge pull request #196 from prettier/shore/master-rebasing
Browse files Browse the repository at this point in the history
Shore/master rebasing
  • Loading branch information
mitermayer authored Aug 26, 2019
2 parents 8601e00 + 394f422 commit e5d7587
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TODO
doc/tags
node_modules
.yarn_lock
yarn.lock
3 changes: 3 additions & 0 deletions doc/prettier.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ However they can be configured by:
" always|never|preserve
" default: 'preserve'
let g:prettier#config#prose_wrap = 'preserve'
" css|strict|ignore
let g:prettier#config#html_whitespace_sensitivity = 'css'
<
==============================================================================
REQUIREMENT(S) *vim-prettier-requirements*
Expand Down
2 changes: 1 addition & 1 deletion ftdetect/javascript.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
augroup PrettierFileDetect
autocmd BufNewFile,BufReadPost *.js setfiletype javascript
autocmd BufNewFile,BufReadPost *.js,*jsx setfiletype javascript
augroup end
2 changes: 1 addition & 1 deletion ftdetect/typescript.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
augroup PrettierFileDetect
autocmd BufNewFile,BufReadPost *.ts setfiletype typescript
autocmd BufNewFile,BufReadPost *.ts,*.tsx setfiletype typescript
augroup end
14 changes: 14 additions & 0 deletions ftplugin/html.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
" markdown files run this as well
" https://stackoverflow.com/questions/22839269/why-does-vim-default-markdown-ftplugin-source-html-ftplugins-is-there-any-ways
if &ft !~# 'markdown'
let b:prettier_ft_default_args = {
\ 'parser': 'html',
\ }
endif

augroup Prettier
autocmd!
if g:prettier#autoformat
autocmd BufWritePre *.html call prettier#Autoformat()
endif
augroup end

0 comments on commit e5d7587

Please sign in to comment.