vim-prettier adds Prettier support for Vim.
https://github.com/prettier/vim-prettier| Installer Source| Releases (json) (tab)
vim-prettier adds Prettier support for Vim.
https://github.com/prettier/vim-prettier| Installer Source| Releases (json) (tab)
To update (replacing the current version) run webi vim-prettier
.
To update the config options, first remove ~/.vim/plugins/prettier.vim
These are the files / directories that are created and/or modified with this install:
~/.vim/pack/plugins/start/vim-prettier/
~/.vim/plugins/prettier.vim
~/.vimrc
If node
and prettier
are not found, they will be also
installed.
vim-prettier
is a vim plugin wrapper for prettier, pre-configured with custom default prettier settings.
You'll also need to install ALE
(part of
vim-essentials
) or
syntastic
first.
git clone --depth=1 https://github.com/prettier/vim-prettier ~/.vim/pack/plugins/start/vim-prettier
.vimrc
" 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
"""""""""""""""""""""""""""
" 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
With webi
:
webi prettier
With node
:
npm install -g prettier@2