[nvim] fix coc#status error/warning signs

This commit is contained in:
Dmytro Meleshko 2020-01-06 16:16:24 +02:00
parent ff47c00035
commit 42c2d37734
10 changed files with 28 additions and 25 deletions

View file

@ -1,7 +1,7 @@
let s:filetypes = ['c', 'cpp', 'objc', 'objcpp'] let s:filetypes = ['c', 'cpp', 'objc', 'objcpp']
let g:coc_filetypes += s:filetypes let g:coc_filetypes += s:filetypes
call coc#config('languageserver.ccls', { let g:coc_user_config['languageserver.ccls'] = {
\ 'filetypes': s:filetypes, \ 'filetypes': s:filetypes,
\ 'command': 'ccls', \ 'command': 'ccls',
\ 'rootPatterns': ['.ccls', 'compile_commands.json', '.vim/', '.git/', '.hg/'], \ 'rootPatterns': ['.ccls', 'compile_commands.json', '.vim/', '.git/', '.hg/'],
@ -10,10 +10,10 @@ call coc#config('languageserver.ccls', {
\ 'directory': '/tmp/ccls', \ 'directory': '/tmp/ccls',
\ }, \ },
\ }, \ },
\ }) \ }
" call coc#config('languageserver.clangd', { " let g:coc_user_config['languageserver.clangd'] = {
" \ 'filetypes': s:filetypes, " \ 'filetypes': s:filetypes,
" \ 'command': 'clangd', " \ 'command': 'clangd',
" \ 'rootPatterns': ['compile_flags.txt', 'compile_commands.json', '.vim/', '.git/', '.hg/'], " \ 'rootPatterns': ['compile_flags.txt', 'compile_commands.json', '.vim/', '.git/', '.hg/'],
" \ }) " \ }

View file

@ -1,2 +1,2 @@
call coc#add_extension('coc-css') let g:coc_global_extensions += ['coc-css']
let g:coc_filetypes += ['css', 'scss', 'less'] let g:coc_filetypes += ['css', 'scss', 'less']

View file

@ -1,8 +1,8 @@
let s:filetypes = ['haskell', 'lhaskell', 'chaskell'] let s:filetypes = ['haskell', 'lhaskell', 'chaskell']
let g:coc_filetypes += s:filetypes let g:coc_filetypes += s:filetypes
call coc#config('languageserver.haskell', { let g:coc_user_config['languageserver.haskell'] = {
\ 'filetypes': s:filetypes, \ 'filetypes': s:filetypes,
\ 'command': 'hie-wrapper', \ 'command': 'hie-wrapper',
\ 'rootPatterns': ['.stack.yaml', 'cabal.config', 'package.yaml'], \ 'rootPatterns': ['.stack.yaml', 'cabal.config', 'package.yaml'],
\ 'initializationOptions': {}, \ 'initializationOptions': {},
\ }) \ }

View file

@ -1,4 +1,4 @@
call coc#add_extension('coc-html', 'coc-emmet') let g:coc_global_extensions += ['coc-html', 'coc-emmet']
let s:emmet_filetype_mapping = { 'jinja': 'html' } let s:emmet_filetype_mapping = { 'jinja': 'html' }
let g:coc_filetypes += ['html'] + keys(s:emmet_filetype_mapping) let g:coc_filetypes += ['html'] + keys(s:emmet_filetype_mapping)
call coc#config('emmet.includeLanguages', s:emmet_filetype_mapping) let g:coc_user_config['emmet.includeLanguages'] = s:emmet_filetype_mapping

View file

@ -1,13 +1,13 @@
call coc#add_extension('coc-tsserver', 'coc-eslint', 'coc-prettier') let g:coc_global_extensions += ['coc-tsserver', 'coc-eslint', 'coc-prettier']
let g:coc_filetypes += ['javascript', 'javascript.jsx', 'typescript', 'typescript.jsx'] let g:coc_filetypes += ['javascript', 'javascript.jsx', 'typescript', 'typescript.jsx']
call coc#config('eslint', { let g:coc_user_config['eslint'] = {
\ 'filetypes': ['javascript', 'javascriptreact'], \ 'filetypes': ['javascript', 'javascriptreact'],
\ 'autoFixOnSave': v:true, \ 'autoFixOnSave': v:true,
\ }) \ }
call coc#config('prettier', { let g:coc_user_config['prettier'] = {
\ 'singleQuote': v:true, \ 'singleQuote': v:true,
\ 'trailingComma': 'all', \ 'trailingComma': 'all',
\ 'jsxBracketSameLine': v:true, \ 'jsxBracketSameLine': v:true,
\ 'eslintIntegration': v:true, \ 'eslintIntegration': v:true,
\ 'disableSuccessMessage': v:true \ 'disableSuccessMessage': v:true
\ }) \ }

View file

@ -1,2 +1,2 @@
call coc#add_extension('coc-json') let g:coc_global_extensions += ['coc-json']
let g:coc_filetypes += ['json', 'json5'] let g:coc_filetypes += ['json', 'json5']

View file

@ -1,7 +1,7 @@
call coc#add_extension('coc-python') let g:coc_global_extensions += ['coc-python']
let g:coc_filetypes += ['python'] let g:coc_filetypes += ['python']
call coc#config('pyls.plugins.pycodestyle.ignore', ['E501']) let g:coc_user_config['pyls.plugins.pycodestyle.ignore'] = ['E501']
call coc#config('python', { let g:coc_user_config['python'] = {
\ 'autocomplete': { 'showAdvancedMembers': v:false }, \ 'autocomplete': { 'showAdvancedMembers': v:false },
\ 'formatting': { 'provider': 'black' }, \ 'formatting': { 'provider': 'black' },
\ 'linting': { \ 'linting': {
@ -9,4 +9,4 @@ call coc#config('python', {
\ 'flake8Enabled': v:true, \ 'flake8Enabled': v:true,
\ 'flake8Args': ['--ignore', 'E501'], \ 'flake8Args': ['--ignore', 'E501'],
\ }, \ },
\ }) \ }

View file

@ -1,3 +1,3 @@
call coc#add_extension('coc-rls') let g:coc_global_extensions += ['coc-rls']
let g:coc_filetypes += ['rust'] let g:coc_filetypes += ['rust']
call coc#config('rust', { 'clippy_preference': 'on' }) let g:coc_user_config['rust'] = { 'clippy_preference': 'on' }

View file

@ -74,13 +74,16 @@ endif
command! -nargs=0 -range -bar CocFormat call s:CocFormat(<range>, <line1>, <line2>) command! -nargs=0 -range -bar CocFormat call s:CocFormat(<range>, <line1>, <line2>)
" }}} " }}}
call coc#add_extension('coc-snippets') let g:coc_global_extensions = []
call coc#config('diagnostic', { let g:coc_user_config = {}
let g:coc_global_extensions += ['coc-snippets']
let g:coc_user_config['diagnostic'] = {
\ 'virtualText': v:true, \ 'virtualText': v:true,
\ 'enableMessage': 'jump', \ 'enableMessage': 'jump',
\ 'errorSign': 'XX', \ 'errorSign': 'XX',
\ 'warningSign': '!!', \ 'warningSign': '!!',
\ }) \ }
runtime! coc-languages/*.vim runtime! coc-languages/*.vim

View file

@ -135,7 +135,7 @@ endif
let g:airline_section_{a:section} = g:airline_section_{a:section} . airline#section#create_left([''] + a:items) let g:airline_section_{a:section} = g:airline_section_{a:section} . airline#section#create_left([''] + a:items)
endfunction endfunction
function s:tweak_airline() function s:tweak_airline()
if exists('*coc#status') if g:vim_ide
call s:airline_section_prepend('x', ['coc#status']) call s:airline_section_prepend('x', ['coc#status'])
endif endif
call s:airline_section_append('y', ['filesize']) call s:airline_section_append('y', ['filesize'])