Created
September 3, 2020 16:32
-
-
Save nikki93/6ea403d3e2cbff2b3d32d4528edf5ee5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coc.nvim config only | |
let g:coc_global_extensions = ['coc-clangd', 'coc-tsserver', 'coc-json', 'coc-html', 'coc-css', 'coc-go', 'coc-rust-analyzer'] | |
function! s:CheckBackSpace() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~# '\s' | |
endfunction | |
inoremap <silent><expr> <TAB> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>CheckBackSpace() ? "\<TAB>" : | |
\ coc#refresh() | |
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | |
if exists('*complete_info') | |
inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>" | |
else | |
imap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | |
endif | |
nmap <silent> ;g <Plug>(coc-definition) | |
nmap <silent> ;d :call CocAction('doHover')<CR> | |
nmap <silent> ;t <Plug>(coc-type-definition) | |
nmap <silent> ;e :CocList diagnostics<CR> | |
nmap <silent> ;r <Plug>(coc-rename) | |
nmap <silent> ;h :CocCommand clangd.switchSourceHeader<CR> | |
nmap <silent> ;R :CocRestart<CR> | |
nmap <silent> <Space>o :CocList outline<CR> | |
nmap <silent> <Space>s :CocList symbols<CR> | |
function! MyReloadCoc(timerId) | |
silent call coc#client#restart('coc') | |
endfunction | |
if has('macunix') | |
call coc#config('clangd', { | |
\ 'path': '/Users/nikki/.config/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd', | |
\}) | |
elseif has('win32') | |
call coc#config('clangd', { | |
\ 'path': 'C:\\Program Files\\LLVM\\bin\\clangd.exe', | |
\}) | |
autocmd FileType c,cpp,objc,objcpp autocmd BufWritePost <buffer> call timer_start(40, 'MyReloadCoc') | |
endif | |
hi! CocErrorSign guifg=#fb4934 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"coc.source.around.enable": false, | |
"coc.source.buffer.enable": false, | |
"coc.preferences.hoverTarget": "float", | |
"signature.target": "echo", | |
"diagnostic.refreshOnInsertMode": false, | |
"suggest.floatEnable": false, | |
"suggest.autoTrigger": "none", | |
"go.goplsOptions": { | |
"deepCompletion": false, | |
"completeUnimported": true | |
}, | |
"clangd.fallbackFlags": ["-std=c++17"], | |
"languageserver": { | |
"nim": { | |
"command": "nimlsp", | |
"filetypes": ["nim"] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment