Skip to content

Instantly share code, notes, and snippets.

@esamattis
Last active May 5, 2017 12:33
Show Gist options
  • Save esamattis/7e9511cbd2ec806c5f8a6f96428352c2 to your computer and use it in GitHub Desktop.
Save esamattis/7e9511cbd2ec806c5f8a6f96428352c2 to your computer and use it in GitHub Desktop.
#!/bin/sh
opts=""
while true; do
if [ -f .prettieropts ]; then
opts=$(cat .prettieropts)
break
fi
if [ "$(pwd)" = "/" ]; then
break
fi
cd ..
done
exec prettier $opts $@
" for neoformat https://github.com/sbdchd/neoformat
let g:neoformat_javascript_prettier = {
\ 'exe': 'prettier-config',
\ 'args': ['--stdin'],
\ 'stdin': 1,
\ }
let g:neoformat_enabled_javascript = ['prettier']
autocmd BufWritePre *.js exe ":Neoformat"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment