Mercurial > dotfiles
comparison dot_config/nvim/init.vim @ 284:3c5523f18d0a
Clean up autocomplete options
author | zegervdv <zegervdv@me.com> |
---|---|
date | Mon, 31 Aug 2020 08:33:52 +0200 |
parents | 6279917e1aaa |
children | d48b05b03ddf |
comparison
equal
deleted
inserted
replaced
283:a795980b700e | 284:3c5523f18d0a |
---|---|
57 Plug 'sgur/vim-editorconfig' | 57 Plug 'sgur/vim-editorconfig' |
58 | 58 |
59 " Brackets | 59 " Brackets |
60 Plug 'tpope/vim-surround' | 60 Plug 'tpope/vim-surround' |
61 Plug 'raimondi/delimitMate' | 61 Plug 'raimondi/delimitMate' |
62 Plug 'tommcdo/vim-exchange' | 62 Plug 'zegervdv/vim-endwise' |
63 | 63 |
64 " Formatting | 64 " Formatting |
65 Plug 'junegunn/vim-easy-align', { 'on' : [] } | 65 Plug 'junegunn/vim-easy-align', { 'on' : [] } |
66 augroup load_easy_align | 66 augroup load_easy_align |
67 autocmd! | 67 autocmd! |
1203 function! s:check_back_space() abort | 1203 function! s:check_back_space() abort |
1204 let col = col('.') - 1 | 1204 let col = col('.') - 1 |
1205 return !col || getline('.')[col - 1] =~# '\s' | 1205 return !col || getline('.')[col - 1] =~# '\s' |
1206 endfunction | 1206 endfunction |
1207 | 1207 |
1208 " inoremap <silent><expr> <TAB> | |
1209 " \ pumvisible() ? "\<C-n>" : | |
1210 " \ <SID>check_back_space() ? "\<TAB>" : | |
1211 " \ coc#refresh() | |
1212 " inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | |
1213 " " Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position. | |
1214 " " Coc only does snippet and additional edit on confirm. | |
1215 " inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" | |
1216 " " Or use `complete_info` if your vim support it, like: | |
1217 " " inoremap <expr> <cr> complete_info()["selected"] != "-1" ? "\<C-y>" : "\<C-g>u\<CR>" | |
1218 " autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif | |
1219 " Use <Tab> and <S-Tab> to navigate through popup menu | |
1220 " inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
1221 inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" | |
1222 | 1208 |
1223 " Auto close popup menu when finish completion | 1209 " Auto close popup menu when finish completion |
1224 autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif | 1210 autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif |
1225 inoremap <silent><expr> <TAB> | 1211 |
1226 \ pumvisible() ? "\<C-n>" : | 1212 " Use <Tab> and <S-Tab> to navigate through popup menu |
1227 \ <SID>check_back_space() ? "\<TAB>" : | 1213 inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" |
1228 \ completion#trigger_completion() | 1214 inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" |
1215 | |
1216 " Set completeopt to have a better completion experience | |
1217 set completeopt=menuone,noinsert,noselect | |
1218 | |
1219 " Avoid showing message extra message when using completion | |
1220 set shortmess+=c | |
1229 | 1221 |
1230 let g:completion_enable_snippet = 'UltiSnips' | 1222 let g:completion_enable_snippet = 'UltiSnips' |
1231 "Fallback for https://github.com/Raimondi/delimitMate expanding on enter | 1223 "Fallback for https://github.com/Raimondi/delimitMate expanding on enter |
1232 let g:completion_confirm_key_rhs = "\<Plug>delimitMateCR" | 1224 let g:completion_confirm_key_rhs = "\<Plug>delimitMateCR" |
1233 let g:UltiSnipsJumpForwardTrigger="<c-b>" | 1225 let g:UltiSnipsJumpForwardTrigger="<c-b>" |