Last active
April 16, 2017 21:18
-
-
Save awinograd/e3d87c670050a3233c3f63db839f23ba to your computer and use it in GitHub Desktop.
vimrc for prettier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd FileType javascript set formatprg=prettier\ --stdin\ --single-quote\ --trailing-comma\ es5 | |
autocmd FileType javascript.jsx set formatprg=prettier\ --stdin\ --single-quote\ --trailing-comma\ es5 | |
nnoremap <silent> <leader>p gggqG<CR> | |
" I decided to disable running prettier on save b/c of how | |
" it loses the cursor position and instead just use `<leader>p` occasionally | |
" That said, here are the commands I used for auto-prettier on save | |
" autocmd BufWritePre *.js exe "normal! gggqG\<C-o>\<C-o>" | |
" autocmd BufWritePre *.jsx exe "normal! gggqG\<C-o>\<C-o>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment