Skip to content

Instantly share code, notes, and snippets.

@osa1
Last active May 15, 2020 15:04
Show Gist options
  • Save osa1/3b034b1d99863b61d0d61537f94aa8d6 to your computer and use it in GitHub Desktop.
Save osa1/3b034b1d99863b61d0d61537f94aa8d6 to your computer and use it in GitHub Desktop.
" Make CTRL-T work correctly with goto-definition.
setlocal tagfunc=CocTagFunc
nmap <leader>gre <Plug>(coc-references)
nmap <leader>grn <Plug>(coc-rename)
" nmap <leader>ge <Plug>(coc-diagnostic-info)
nmap <leader>ge :<C-u>CocList diagnostics<CR>
nmap <leader>gp <Plug>(coc-diagnostic-prev)
nmap <leader>gn <Plug>(coc-diagnostic-next)
nmap <leader>gi <Plug>(coc-implementation)
nmap <leader>gy <Plug>(coc-type-definition)
nmap <leader>gd <Plug>(coc-definition)
nmap <silent> K :call <SID>show_documentation()<CR>
" Search workspace symbols.
nnoremap <leader>s :<C-u>CocList -I symbols<CR>
" Outline
nnoremap <leader>o :<C-u>CocList outline<CR>
nnoremap <silent> K :call CocAction('doHover')<CR>
" Trigger auto-completion with C-space.
inoremap <silent><expr> <c-space> coc#refresh()
" Make <TAB> select next completion and Shift-<TAB> to select previous.
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <silent><expr> <S-TAB>
\ pumvisible() ? "\<C-p>" :
\ <SID>check_back_space() ? "\<S-TAB>" :
\ coc#refresh()
" Make <CR> confirm completion.
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
{
"diagnostic.enable": true,
"diagnostic.virtualText": false,
"diagnostic.joinMessageLines": true,
"diagnostic.checkCurrentLine": true,
"diagnostic.messageTarget": "float",
"diagnostic.level": "information",
"suggest.autoTrigger": "none",
"signature.enable": false,
"coc.preferences.snippets.enable": false,
"rust-analyzer.diagnostics.enable": false,
"rust-analyzer.inlayHints.chainingHints": true,
"rust-analyzer.serverPath": "/home/omer/.cargo/bin/rust-analyzer",
"languageserver": {
"ocaml-lsp": {
"command": "opam",
"args": ["config", "exec", "--", "ocamllsp"],
"filetypes": ["ocaml", "reason"]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment