Skip to content

Commit

Permalink
coc configuration formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
David Chen committed Aug 22, 2020
1 parent 1a9d18c commit 3e29aa1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 52 deletions.
8 changes: 4 additions & 4 deletions coc-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"variable": "\ue71b"
},
"diagnostic.signOffset": 1,
"diagnostic.errorSign": "×",
"diagnostic.warningSign": "»",
"diagnostic.infoSign": "",
"diagnostic.hintSign": "",
"diagnostic.errorSign": "\uf467",
"diagnostic.warningSign": "\uf071",
"diagnostic.infoSign": "\uf129",
"diagnostic.hintSign": "\uf864",
"diagnostic.displayByAle": false,
"diagnostic.refreshOnInsertMode": false,
"diagnostic.refreshAfterSave": false,
Expand Down
86 changes: 38 additions & 48 deletions init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -615,42 +615,32 @@ nnoremap <LEADER>g= :GitGutterNextHunk<CR>
" ===
" === coc.nvim
" ===
" fix the most annoying bug that coc has
"silent! au BufEnter,BufRead,BufNewFile * silent! unmap if
let g:coc_global_extensions = [
\ 'coc-actions',
\ 'coc-css',
\ 'coc-diagnostic',
\ 'coc-explorer',
\ 'coc-flutter-tools',
\ 'coc-gitignore',
\ 'coc-html',
\ 'coc-json',
\ 'coc-lists',
\ 'coc-prettier',
\ 'coc-pyright',
\ 'coc-python',
\ 'coc-snippets',
\ 'coc-sourcekit',
\ 'coc-stylelint',
\ 'coc-syntax',
\ 'coc-tasks',
\ 'coc-todolist',
\ 'coc-translator',
\ 'coc-tslint-plugin',
\ 'coc-tsserver',
\ 'coc-vimlsp',
\ 'coc-vimlsp',
\ 'coc-yaml',
\ 'coc-yank']
"set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
"nmap <silent> <TAB> <Plug>(coc-range-select)
"xmap <silent> <TAB> <Plug>(coc-range-select)
" use <tab> for trigger completion and navigate to the next complete item
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
\ 'coc-actions',
\ 'coc-css',
\ 'coc-diagnostic',
\ 'coc-explorer',
\ 'coc-flutter-tools',
\ 'coc-gitignore',
\ 'coc-html',
\ 'coc-json',
\ 'coc-lists',
\ 'coc-prettier',
\ 'coc-pyright',
\ 'coc-python',
\ 'coc-snippets',
\ 'coc-sourcekit',
\ 'coc-stylelint',
\ 'coc-syntax',
\ 'coc-tasks',
\ 'coc-todolist',
\ 'coc-translator',
\ 'coc-tslint-plugin',
\ 'coc-tsserver',
\ 'coc-vimlsp',
\ 'coc-vimlsp',
\ 'coc-yaml',
\ 'coc-yank']
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
Expand All @@ -665,23 +655,27 @@ inoremap <silent><expr> <c-space> coc#refresh()
inoremap <silent><expr> <c-o> coc#refresh()
function! Show_documentation()
call CocActionAsync('highlight')
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction
nnoremap <LEADER>h :call Show_documentation()<CR>
" autocmd CursorHold * silent call CocActionAsync('highlight')

" Open up coc-commands
nnoremap <silent><nowait> <LEADER>d :CocList diagnostics<cr>
nmap <silent> <LEADER>- <Plug>(coc-diagnostic-prev)
nmap <silent> <LEADER>= <Plug>(coc-diagnostic-next)
nnoremap <c-c> :CocCommand<CR>
" Text Objects
xmap kf <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap kf <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)
xmap kc <Plug>(coc-classobj-i)
omap kc <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Useful commands
nnoremap <silent> <space>y :<C-u>CocList -A --normal yank<cr>
nmap <silent> gd <Plug>(coc-definition)
Expand Down Expand Up @@ -710,11 +704,7 @@ vmap <C-e> <Plug>(coc-snippets-select)
let g:coc_snippet_next = '<c-e>'
let g:coc_snippet_prev = '<c-n>'
imap <C-e> <Plug>(coc-snippets-expand-jump)
let g:snips_author = 'David'

nmap <silent> <LEADER>- <Plug>(coc-diagnostic-prev)
nmap <silent> <LEADER>= <Plug>(coc-diagnostic-next)
let g:snips_author = 'David Chen'


" ===
Expand Down

0 comments on commit 3e29aa1

Please sign in to comment.