Skip to content

Instantly share code, notes, and snippets.

@jryio
Last active November 11, 2021 23:57
Show Gist options
  • Save jryio/52e9902568703438875ea26334724a13 to your computer and use it in GitHub Desktop.
Save jryio/52e9902568703438875ea26334724a13 to your computer and use it in GitHub Desktop.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Use `[g` and `]g` to navigate diagnostics
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call CocActionAsync("doHover")<CR>
{
"coc.preferences.enableFloatHighlight": true,
// IMPORTANT - Have to add file types here otherwise they will not be formatted on save (use their default formatter)
"coc.preferences.formatOnSaveFiletypes": [
"go",
"rust",
],
"diagnostic.errorSign": "✗",
"diagnostic.infoSign": "ℹ️",
"diagnostic.messageTarget": "float",
"diagnostic.virtualText": true,
"diagnostic.warningSign": "▲",
"git.addGBlameToVirtualText": true,
"json.format.enable": false,
"rust-analyzer.diagnostics.enable": true,
"rust-analyzer.trace.server": "verbose",
"rust-analyzer.updates.channel": "nightly",
"rust-analyzer.checkOnSave.allFeatures": true,
"rust-analyzer.checkOnSave.overrideCommand": [
"cargo",
"clippy",
"--workspace",
"--message-format=json",
"--all-targets",
"--all-features"
],
"signature.target": "float",
"suggest.floatEnable": true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment