Skip to content

Commit

Permalink
feat(vim): add Fix command for eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasnorrby committed Jul 1, 2020
1 parent 74a3fa4 commit a69220d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions editor/neovim/plugins.d/neoclide/coc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ omap af <Plug>(coc-funcobj-a)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')

" Add `:Fix` command to fix eslint errors
command! -nargs=0 Fix :call CocAction('runCommand', 'eslint.executeAutofix')

" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)

Expand Down Expand Up @@ -110,6 +113,7 @@ nmap <silent> gr <Plug>(coc-references)
" Formatting
xmap <leader>f <Plug>(coc-format-selected)
nnoremap <silent> <leader>ff :Format<cr>
nnoremap <silent> <leader>fe :Fix<cr>
nmap <leader>cr <Plug>(coc-rename)
nmap <leader>ca <Plug>(coc-codeaction)
Expand Down

0 comments on commit a69220d

Please sign in to comment.