Skip to content

Instantly share code, notes, and snippets.

@awinograd
Last active April 16, 2017 21:18

Revisions

  1. awinograd revised this gist Apr 16, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion .vimrc
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@ autocmd FileType javascript set formatprg=prettier\ --stdin\ --single-quote\ --t
    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
    " 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>"
  2. awinograd revised this gist Apr 16, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion .vimrc
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    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>
    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
    " autocmd BufWritePre *.js exe "normal! gggqG\<C-o>\<C-o>"
    " autocmd BufWritePre *.jsx exe "normal! gggqG\<C-o>\<C-o>"
  3. awinograd created this gist Apr 16, 2017.
    3 changes: 3 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    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>