From f87daf3cb342dc9358264fdc2fcd2aaddccad1fe Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Wed, 9 Oct 2019 17:45:20 +0200 Subject: [PATCH] Tidy up js settings --- vim/ftplugin/javascript.vim | 45 +++++++++---------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/vim/ftplugin/javascript.vim b/vim/ftplugin/javascript.vim index 7e500e8..1c1380f 100644 --- a/vim/ftplugin/javascript.vim +++ b/vim/ftplugin/javascript.vim @@ -1,40 +1,17 @@ -if has("nvim") - " use prettier in ALE - let g:ale_fixers = {} - let g:ale_fixers['javascript'] = ['prettier'] - let g:ale_javascript_prettier_options = '--no-semi --single-quote' - let g:ale_fixers['vue'] = ['prettier'] - let g:ale_vue_prettier_options = '--no-semi --single-quote' - let g:ale_fix_on_save = 1 - let g:ale_javascript_prettier_use_local_config = 1 - - " deoplete-tern {{{ - let g:deoplete#sources#ternjs#docs = 1 - let g:deoplete#sources#ternjs#case_insensitive = 1 - "Add extra filetypes for deoplete tern - let g:deoplete#sources#ternjs#filetypes = [ - \ 'jsx', - \ 'javascript.jsx', - \ 'vue', - \ ] - " }}} -else - " Syntastic {{{ - "let g:syntastic_javascript_checkers = ['standard'] - let g:syntastic_javascript_checkers = ['eslint'] - let g:syntastic_javascript_eslint_exe = '$(npm bin)/eslint' - let g:syntastic_javascript_eslint_args = ['--fix'] - - " And also for vue - let g:syntastic_vue_checkers = ['eslint'] - let g:syntastic_vue_eslint_exe = '$(npm bin)/eslint' - let g:syntastic_vue_eslint_args = ['--fix'] - "}}} -endif - +" use prettier in ALE +let g:ale_fixers = {} +let g:ale_fixers['javascript'] = ['prettier'] +let g:ale_javascript_prettier_options = '--no-semi --single-quote' +let g:ale_fixers['vue'] = ['prettier'] +let g:ale_vue_prettier_options = '--no-semi --single-quote' +let g:ale_fix_on_save = 1 +let g:ale_javascript_prettier_use_local_config = 1 "autocmd bufwritepost *.js silent !standard --fix % set wildignore+=node_modules set tabstop=2 set shiftwidth=2 + +" Create jsdoc with ,h +nnoremap h :JsDoc