Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as Plain Text by evoalg ( 4 years ago )
call plug#begin('~/.vim/plugged')
Plug 'alaviss/nim.nvim'
Plug 'prabirshrestha/asyncomplete.vim'
call plug#end()

inoremap <expr> <Tab>   pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr>    pumvisible() ? asyncomplete#close_popup() . "\<cr>" : "\<cr>"

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'nim',
    \ 'whitelist': ['nim'],
    \ 'completor': {opt, ctx -> nim#suggest#sug#GetAllCandidates({start, candidates -> asyncomplete#complete(opt['name'], ctx, start, candidates)})}
    \ })

" to turn off popups, uncomment the following line:
let g:asyncomplete_auto_popup = 0

set incsearch ignorecase smartcase
set nohlsearch

 

Revise this Paste

Your Name: Code Language: