Created
January 6, 2022 03:43
-
-
Save fannheyward/d8faa8ef3d40dd2c865bc0d7cf04c3ba to your computer and use it in GitHub Desktop.
This file contains 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
set nocompatible | |
set runtimepath^=~/.config/nvim/plugged/coc.nvim | |
filetype plugin indent on | |
syntax on | |
set hidden | |
set runtimepath^=~/src/coc-clangd | |
"Completion settings | |
"Use complete_info() if you need confirm completion only when there's selected complete item | |
if exists('*complete_info') | |
inoremap <silent><expr> <cr> complete_info(['selected'])['selected'] != -1 ? "\<C-y>" : "\<C-g>u\<CR>" | |
endif | |
"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 | |
inoremap <silent><expr> <Tab> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<Tab>" : | |
\ coc#refresh() | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment