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({
    \ &#039;name&#039;: &#039;nim&#039;,
    \ &#039;whitelist&#039;: [&#039;nim&#039;],
    \ &#039;completor&#039;: {opt, ctx -> nim#suggest#sug#GetAllCandidates({start, candidates -> asyncomplete#complete(opt[&#039;name&#039;], ctx, start, candidates)})}
    \ })

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

set incsearch ignorecase smartcase
set nohlsearch

Add a code snippet to your website: www.paste.org