From 7a518f6fb32a716d736ea7b80e4db6ebf20dbe3d Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Wed, 16 Jan 2019 23:08:30 +0000 Subject: [PATCH] ale eslint fixer --- vimrc | 79 ++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 30 deletions(-) diff --git a/vimrc b/vimrc index 72d0e13..e408b7e 100644 --- a/vimrc +++ b/vimrc @@ -163,12 +163,18 @@ Plug 'studio-vx/vim-qlist' nnoremap gc :Gcommit nnoremap gl :Glog nnoremap gp :Gpush:copen + nnoremap gp :Gpushjob:copen "}}} " #wakatime{{{ " https://wakatime.com/vim Plug 'wakatime/vim-wakatime' + "}}} +" #wal.vim {{{ + " https://github.com/dylanaraps/wal.vim + Plug 'dylanaraps/wal.vim' + "}}} if g:vimrc_load_dev_plugins @@ -179,40 +185,46 @@ if g:vimrc_load_dev_plugins let g:ale_sign_column_always = 1 let g:ale_open_list = 0 - let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []} + " when coc enabled + " let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []} + " when coc not enabled + let g:ale_linters = {'scss': ['stylelint'], 'javascript': ['eslint'], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': ['eslint']} + let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix' - let g:ale_fixers = {'javascript': ['eslint']} + let g:ale_fixers = {'javascript': ['eslint'], 'vue': ['eslint']} let g:ale_sign_error = 'Α' let g:ale_sign_warning = 'α' + nmap af (ale_fix) + "}}} -" #coc.nvim{{{ - " https://github.com/neoclide/coc.nvim - Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}} - - let g:coc_snippet_next = '' - let g:coc_snippet_prev = '' - - inoremap coc#refresh() - nnoremap K :call show_documentation() - nnoremap \d (coc-definition) - nnoremap \y (coc-type-definition) - nnoremap \i (coc-implementation) - nnoremap \r (coc-references) - nnoremap \n (coc-rename) - vnoremap \f (coc-format-selected) - nnoremap \f (coc-format-selected) - command! -nargs=0 Format :call CocAction('format') - command! -nargs=? Fold :call CocAction('fold', ) - - function! s:show_documentation() - if &filetype == 'vim' || &filetype == 'help' - execute 'h '.expand('') - else - call CocAction('doHover') - endif - endfunction - "}}} +" " #coc.nvim{{{ +" " https://github.com/neoclide/coc.nvim +" Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}} +" +" let g:coc_snippet_next = '' +" let g:coc_snippet_prev = '' +" +" inoremap coc#refresh() +" nnoremap K :call show_documentation() +" nnoremap \d (coc-definition) +" nnoremap \y (coc-type-definition) +" nnoremap \i (coc-implementation) +" nnoremap \r (coc-references) +" nnoremap \n (coc-rename) +" vnoremap \f (coc-format-selected) +" nnoremap \f (coc-format-selected) +" command! -nargs=0 Format :call CocAction('format') +" command! -nargs=? Fold :call CocAction('fold', ) +" +" function! s:show_documentation() +" if &filetype == 'vim' || &filetype == 'help' +" execute 'h '.expand('') +" else +" call CocAction('doHover') +" endif +" endfunction +" " }}} " #colorV {{{ " original: " https://github.com/gu-fan/colorv.vim @@ -988,7 +1000,14 @@ command! -nargs=1 -complete=command Redir silent call Redir() " :Redir hi ............. show the full output of command ':hi' in a scratch window " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window "}}} - +function Test() abort "{{{ + let job = job_start('ls -lah', {'callback': 'Testcallback'}) +endfunction +"}}} +function Testcallback(channel, msg) abort + echom a:channel . ': ' . a:msg +endfunction +"}}} "----------------------------------------------------------------------------}}} "#commands{{{ " TrimWhitespace{{{