mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[nvim] fix coc#status error/warning signs
This commit is contained in:
parent
ff47c00035
commit
42c2d37734
10 changed files with 28 additions and 25 deletions
|
@ -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/'],
|
||||||
" \ })
|
" \ }
|
||||||
|
|
|
@ -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']
|
||||||
|
|
|
@ -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': {},
|
||||||
\ })
|
\ }
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
\ })
|
\ }
|
||||||
|
|
|
@ -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']
|
||||||
|
|
|
@ -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'],
|
||||||
\ },
|
\ },
|
||||||
\ })
|
\ }
|
||||||
|
|
|
@ -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' }
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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'])
|
||||||
|
|
Loading…
Reference in a new issue