coc-nvim replaced vim-lsp

This commit is contained in:
ManjaroOne666 2018-11-25 17:55:50 +00:00
parent 690acc8ed0
commit a35c2177c5
3 changed files with 103 additions and 70 deletions

View File

@ -1,6 +1,13 @@
{
"coc.preferences.triggerAfterInsertEnter": true,
"coc.preferences.autoTrigger": "always",
"coc.preferences.timeout": 200
"coc.preferences.triggerAfterInsertEnter": false,
"coc.preferences.autoTrigger": "none",
"coc.preferences.triggerSignatureHelp": true,
"coc.preferences.diagnostic.warningSign": "λ",
"coc.preferences.diagnostic.errorSign": "Λ",
"coc.preferences.diagnostic.infoSign": "λ",
"coc.preferences.diagnostic.hintSign": "λ",
"coc.preferences.timeout": 200,
"coc.source.buffer.ignoreGitignore": true
}

View File

@ -281,11 +281,11 @@
[ "SpellRare", "NONE", fg_spellrare, "NONE", fg_spellcap ],
[ "WildMenu", ui_bg, ui_fg_strong4, "bold" ],
[ "ErrorMsg", "NONE", ui_fg_errormsg, "bold" ],
[ "ModeMsg", "NONE", ui_fg_strong4, "bold" ],
[ "MoreMsg", "NONE", ui_fg_strong4, "NONE" ],
[ "Question", "NONE", ui_fg_question, "NONE" ],
[ "WarningMsg", "NONE", ui_fg_warningmsg, "bold" ],
[ "ErrorMsg", "NONE", ui_fg_errormsg, "italic" ],
[ "ModeMsg", "NONE", ui_fg_strong4, "italic" ],
[ "MoreMsg", "NONE", ui_fg_strong4, "italic" ],
[ "Question", "NONE", ui_fg_question, "italic" ],
[ "WarningMsg", "NONE", ui_fg_warningmsg, "italic" ],
[ "Cursor", ui_cursor_bg, ui_cursor_fg, "bold" ],
[ "CursorColumn", bg_cursorcolumn, "NONE", "NONE" ],
@ -594,12 +594,16 @@
# plugins
[ "CocErrorSign", "ErrorMsg" ],
[ "CocWarningSign", "WarningMsg" ],
[ "CocInfoSign", "Question" ],
[ "CocHintSign", "Question" ],
[ "LspErrorText", "ErrorMsg" ],
[ "LspWarningText", "WarningMsg" ],
[ "LspInformationText", "Question" ],
[ "LspHintText", "Question" ],
[ "ALEErrorSign", "ErrorMsg" ],
[ "ALEWarningSign", "ErrorMsg" ],
[ "ALEWarningSign", "WarningMsg" ],
# ctrl-p highlighting
# :h ctrlp-customization

144
vimrc
View File

@ -10,28 +10,51 @@ endif
if !has('nvim')
call plug#begin('~/.vim/bundle')
" #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>
nmap <silent> \d <Plug>(coc-definition)
nmap <silent> \y <Plug>(coc-type-definition)
nmap <silent> \i <Plug>(coc-implementation)
nmap <silent> \r <Plug>(coc-references)
nmap \n <Plug>(coc-rename)
vmap \f <Plug>(coc-format-selected)
nmap \f <Plug>(coc-format-selected)
command! -nargs=0 Format :call CocAction('format')
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" augroup coc_augroup
" autocmd!
" autocmd CursorHold * silent call CocActionAsync('highlight')
" augroup END
function! s:show_documentation()
if &filetype == 'vim' || &filetype == 'help'
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
"}}}
" #ALE {{{
" https://github.com/w0rp/ale
Plug 'w0rp/ale'
nnoremap <space>ne :lnext<cr>
nnoremap <space>pe :lprev<cr>
let g:ale_sign_error = '>>'
let g:ale_sign_warning = '>'
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': []}
" let g:ale_linters = {'scss': ['stylelint'], 'javascript': [], 'php':['php'], 'html':['htmlhint'], 'python': [], 'vue': []}
let g:ale_html_htmlhint_options = '-c ~/.htmlhintrc --format=unix'
let g:ale_fixers = {'javascript': ['eslint']}
let g:ale_sign_error = '▷'
let g:ale_sign_warning = '▷'
let g:ale_sign_error = 'Α'
let g:ale_sign_warning = 'α'
"}}}
" #coc.nvim{{{
" https://github.com/neoclide/coc.nvim
" Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
"}}}
" #colorV {{{
" original:
@ -357,53 +380,53 @@ let g:mta_filetypes = {
"}}}
" #vim-lsp {{{
" https://github.com/prabirshrestha/vim-lsp
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
let g:lsp_signs_enabled = 1
let g:lsp_signs_error = {'text': '▶'}
let g:lsp_signs_warning = {'text': '▶'}
let g:lsp_signs_information = {'text': '◆'}
let g:lsp_signs_hint = {'text': '◆'}
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_diagnostics_echo_delay = 0
nnoremap \l :cclose<CR>:LspDocumentDiagnostics<cr>
nnoremap \h :LspHover<cr>
nnoremap \d :LspDefinition<cr>
nnoremap \r :LspReferences<cr>
nnoremap \n :LspRename<cr>
nnoremap \s :LspDocumentSymbol<cr>
nnoremap \w :LspWorkspaceSymbol<cr>
nnoremap \ff :LspDocumentFormat<cr>
nnoremap \fr :LspDocumentRangeFormat<cr>
augroup User lsp_setup
autocmd!
if executable('vls') "{{{
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'vue',
\ 'cmd': {server_info->['vls']},
\ 'whitelist': ['vue'],
\ })
endif
"}}}
if executable('pyls') "{{{
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
"}}}
if executable('typescript-language-server') "{{{
au User lsp_setup call lsp#register_server({
\ 'name': 'typescript-language-server',
\ 'cmd': { server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri': { server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_directory(lsp#utils#get_buffer_path(), '.git/..'))},
\ 'whitelist': ['typescript', 'javascript', 'javascript.jsx']
\ })
endif
"}}}
augroup END
" Plug 'prabirshrestha/async.vim'
" Plug 'prabirshrestha/vim-lsp'
"
" let g:lsp_signs_enabled = 1
" let g:lsp_signs_error = {'text': '▶'}
" let g:lsp_signs_warning = {'text': '▶'}
" let g:lsp_signs_information = {'text': '◆'}
" let g:lsp_signs_hint = {'text': '◆'}
" let g:lsp_diagnostics_echo_cursor = 1
" let g:lsp_diagnostics_echo_delay = 0
" nnoremap \l :cclose<CR>:LspDocumentDiagnostics<cr>
" nnoremap \h :LspHover<cr>
" nnoremap \d :LspDefinition<cr>
" nnoremap \r :LspReferences<cr>
" nnoremap \n :LspRename<cr>
" nnoremap \s :LspDocumentSymbol<cr>
" nnoremap \w :LspWorkspaceSymbol<cr>
" nnoremap \ff :LspDocumentFormat<cr>
" nnoremap \fr :LspDocumentRangeFormat<cr>
" augroup User lsp_setup
" autocmd!
" if executable('vls') "{{{
" autocmd User lsp_setup call lsp#register_server({
" \ 'name': 'vue',
" \ 'cmd': {server_info->['vls']},
" \ 'whitelist': ['vue'],
" \ })
" endif
" "}}}
" if executable('pyls') "{{{
" autocmd User lsp_setup call lsp#register_server({
" \ 'name': 'pyls',
" \ 'cmd': {server_info->['pyls']},
" \ 'whitelist': ['python'],
" \ })
" endif
" "}}}
" if executable('typescript-language-server') "{{{
" au User lsp_setup call lsp#register_server({
" \ 'name': 'typescript-language-server',
" \ 'cmd': { server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
" \ 'root_uri': { server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_directory(lsp#utils#get_buffer_path(), '.git/..'))},
" \ 'whitelist': ['typescript', 'javascript', 'javascript.jsx']
" \ })
" endif
" "}}}
" augroup END
""}}}
" #vim-repeat{{{
@ -948,8 +971,7 @@ set hlsearch
" set previewheight=24
" set splitbelow
set completeopt=longest,menuone
set completeopt-=preview
set completeopt=longest,menuone,preview
set nospell
set spelllang=en_gb