ale eslint fixer

This commit is contained in:
ManjaroOne666 2019-01-16 23:08:30 +00:00
parent 1f2ed1f12d
commit 7a518f6fb3
1 changed files with 49 additions and 30 deletions

79
vimrc
View File

@ -163,12 +163,18 @@ Plug 'studio-vx/vim-qlist'
nnoremap <silent> <space>gc :Gcommit<CR>
nnoremap <silent> <space>gl :Glog<CR>
nnoremap <silent> <space>gp :Gpush<CR>:copen<CR>
nnoremap <silent> <space>gp :Gpushjob<CR>:copen<CR>
"}}}
" #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 <space>af <Plug>(ale_fix)
"}}}
" #coc.nvim{{{
" https://github.com/neoclide/coc.nvim
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
let g:coc_snippet_next = '<tab>'
let g:coc_snippet_prev = '<s-tab>'
inoremap <silent><expr> <c-n> coc#refresh()
nnoremap <silent> K :call <SID>show_documentation()<CR>
nnoremap <silent> \d <Plug>(coc-definition)
nnoremap <silent> \y <Plug>(coc-type-definition)
nnoremap <silent> \i <Plug>(coc-implementation)
nnoremap <silent> \r <Plug>(coc-references)
nnoremap \n <Plug>(coc-rename)
vnoremap \f <Plug>(coc-format-selected)
nnoremap \f <Plug>(coc-format-selected)
command! -nargs=0 Format :call CocAction('format')
command! -nargs=? Fold :call CocAction('fold', <f-args>)
function! s:show_documentation()
if &filetype == 'vim' || &filetype == 'help'
execute 'h '.expand('<cword>')
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 = '<tab>'
" let g:coc_snippet_prev = '<s-tab>'
"
" inoremap <silent><expr> <c-n> coc#refresh()
" nnoremap <silent> K :call <SID>show_documentation()<CR>
" nnoremap <silent> \d <Plug>(coc-definition)
" nnoremap <silent> \y <Plug>(coc-type-definition)
" nnoremap <silent> \i <Plug>(coc-implementation)
" nnoremap <silent> \r <Plug>(coc-references)
" nnoremap \n <Plug>(coc-rename)
" vnoremap \f <Plug>(coc-format-selected)
" nnoremap \f <Plug>(coc-format-selected)
" command! -nargs=0 Format :call CocAction('format')
" command! -nargs=? Fold :call CocAction('fold', <f-args>)
"
" function! s:show_documentation()
" if &filetype == 'vim' || &filetype == 'help'
" execute 'h '.expand('<cword>')
" 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(<q-args>)
" :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{{{