Skip to content

Instantly share code, notes, and snippets.

@awinograd

awinograd/.vimrc

Last active Apr 16, 2017
Embed
What would you like to do?
vimrc for prettier
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