From 58f116db7a1597f136dddde79b8900509e1a4f47 Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 14 Aug 2020 20:14:52 +0100 Subject: [PATCH 1/2] update mapping, remove ALE --- init.plugins.vim | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/init.plugins.vim b/init.plugins.vim index 63b9c7d..e84c700 100644 --- a/init.plugins.vim +++ b/init.plugins.vim @@ -13,43 +13,6 @@ call plug#begin('~/.config/nvim/bundle') "}}} -" #ALE {{{ - " https://github.com/w0rp/ale - - Plug 'w0rp/ale' - " let g:ale_completion_enabled = 1 - - let g:ale_disable_lsp = 1 - let g:ale_sign_column_always = 1 - let g:ale_open_list = 0 - let g:ale_fix_on_save = 1 - let g:ale_fix_on_save_ignore = { 'vue': ['eslint'] } - - let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'javascriptreact': [], 'json': [], 'php':['php'], 'python': [], 'html':['htmlhint'], 'vue': []} - let g:ale_fixers = {'scss': ['stylelint'], 'javascript': [], 'javascriptreact': [], 'json': ['jq'], 'python': [], 'vue': []} - - let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix' - - let g:ale_python_pyls_config = { -\ 'pyls': { -\ 'pycodestyle': { 'enabled': v:false }, -\ 'configurationSources': ['flake8'] -\ } -\ } - - let g:ale_sign_error = 'Α' - let g:ale_sign_warning = 'α' - - nmap aa (ale_hover) - nmap ad (ale_detail) - nmap af (ale_fix) - nmap ar (ale_find_references) - nmap ag (ale_go_to_definition) - nmap aD (ale_documentation) - nmap an (ale_next) - nmap ap (ale_previous) - - "}}} " #coc.nvim{{{ " https://github.com/neoclide/coc.nvim @@ -72,14 +35,13 @@ call plug#begin('~/.config/nvim/bundle') nnoremap ca :call CocAction('codeAction') nnoremap cs :call CocAction('documentSymbols') nnoremap cS :call CocAction('workspaceSymbols') - nnoremap cn :call CocAction('diagnosticNext') - nnoremap cp :call CocAction('diagnosticPrevious') + nnoremap ]c :call CocAction('diagnosticNext') + nnoremap [c :call CocAction('diagnosticPrevious') " vnoremap \f (coc-format-selected) " nnoremap \f (coc-format-selected) command! -nargs=0 Format :call CocAction('format') command! -nargs=? Fold :call CocAction('fold', ) - " }}} " #delimitMate{{{ " https://github.com/Raimondi/delimitMate From 01c728204bde459a3a565efafb509bde621daa8c Mon Sep 17 00:00:00 2001 From: ray Date: Fri, 14 Aug 2020 21:18:52 +0100 Subject: [PATCH 2/2] add coc-sh and plugin vim-shellcheck --- coc-settings.json | 2 ++ init.plugins.vim | 11 +++++++---- init.vim | 14 -------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/coc-settings.json b/coc-settings.json index b5fa2b7..6e0e952 100644 --- a/coc-settings.json +++ b/coc-settings.json @@ -23,6 +23,8 @@ "python.formatting.provider": "black", "python.formatting.blackPath": "/home/ray/.local/bin/black", "coc.preferences.formatOnSaveFiletypes": ["python", "vue"], + "sh.enable": true, + "sh.highlightParsingErrors": true, "eslint.enable": true, "eslint.autoFixOnSave": true, diff --git a/init.plugins.vim b/init.plugins.vim index e84c700..ebda6a5 100644 --- a/init.plugins.vim +++ b/init.plugins.vim @@ -26,7 +26,6 @@ call plug#begin('~/.config/nvim/bundle') " inoremap coc#refresh() nnoremap :call CocAction('doHover') - nnoremap cc :call CocAction('doHover') nnoremap cf :call CocAction('doQuickfix') nnoremap cg :call CocAction('jumpDefinition') nnoremap ci :call CocAction('jumpImplementation') @@ -37,8 +36,6 @@ call plug#begin('~/.config/nvim/bundle') nnoremap cS :call CocAction('workspaceSymbols') nnoremap ]c :call CocAction('diagnosticNext') nnoremap [c :call CocAction('diagnosticPrevious') - " vnoremap \f (coc-format-selected) - " nnoremap \f (coc-format-selected) command! -nargs=0 Format :call CocAction('format') command! -nargs=? Fold :call CocAction('fold', ) @@ -257,6 +254,12 @@ let g:mta_filetypes = { Plug 'studio-vx/Vim-Jinja2-Syntax' "}}} +" #vim-shellcheck{{{ +" https://github.com/itspriddle/vim-shellcheck + Plug 'itspriddle/vim-shellcheck' + + "}}} + " #vim-SyntaxRange{{{ " https://github.com/inkarkat/vim-SyntaxRange " Plug 'inkarkat/vim-SyntaxRange' @@ -379,7 +382,7 @@ let g:vim_markdown_fenced_languages = ['bash=sh'] call plug#end() runtime macros/matchit.vim " TODO - try 'coc-tsserver' -call coc#add_extension( 'coc-vetur', 'coc-python', 'coc-phpls', 'coc-json', 'coc-css', 'coc-prettier', 'coc-eslint', 'coc-vimlsp', 'coc-tsserver') +call coc#add_extension( 'coc-vetur', 'coc-python', 'coc-phpls', 'coc-json', 'coc-css', 'coc-prettier', 'coc-eslint', 'coc-vimlsp', 'coc-tsserver', 'coc-sh') diff --git a/init.vim b/init.vim index c2a5fb5..1ae8a30 100644 --- a/init.vim +++ b/init.vim @@ -160,18 +160,6 @@ 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! AleLinterStatus() abort "{{{ - let l:counts = ale#statusline#Count(bufnr('')) - - let l:all_errors = l:counts.error + l:counts.style_error - let l:all_non_errors = l:counts.total - l:all_errors - - return l:counts.total == 0 ? '' : printf( - \ '[ %dW %dE ]', - \ all_non_errors, - \ all_errors - \) -endfunction "}}} function! ToggleHighlights() abort "{{{ if ! exists('b:toggle_highlights_state') @@ -324,8 +312,6 @@ set statusline+=%-20(%l\ of\ %L\ (%p%%)%) set statusline+=%-10(:%c\ %((%V)%)%) " separator, highlight color set statusline+=%=%#StatusLineNC# -" Ale errors -set statusline+=%{AleLinterStatus()}\ " CoC status set statusline+=%{coc#status()} " separator