Skip to content

Instantly share code, notes, and snippets.

@jsfaint
Last active July 1, 2020 01:50
Show Gist options
  • Save jsfaint/c5958e7dfca985609f1bb6045643af9e to your computer and use it in GitHub Desktop.
Save jsfaint/c5958e7dfca985609f1bb6045643af9e to your computer and use it in GitHub Desktop.
ncm2 config for vim
let s:rc_path = fnamemodify(expand('<sfile>'), ':h')
let s:vimplug = expand(s:rc_path . '/autoload')
if empty(glob(s:vimplug . '/plug.vim'))
execute '!git clone --depth=1 https://github.com/junegunn/vim-plug' s:vimplug
augroup vimrc
autocmd VimEnter * PlugInstall
augroup END
endif
call plug#begin(s:rc_path . '/plugged')
"Completion
if (has('nvim') || v:version >= 800) && has('python3')
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'ncm2/ncm2-html-subscope'
Plug 'ncm2/ncm2-markdown-subscope'
Plug 'ncm2/ncm2-rst-subscope'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-github'
Plug 'ncm2/ncm2-gtags'
Plug 'ncm2/ncm2-neoinclude' | Plug 'Shougo/neoinclude.vim'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-syntax' | Plug 'Shougo/neco-syntax'
Plug 'ncm2/ncm2-tagprefix'
Plug 'ncm2/ncm2-ultisnips'
"Language specific
Plug 'ncm2/ncm2-go'
Plug 'ncm2/ncm2-jedi'
Plug 'ncm2/ncm2-pyclang'
Plug 'ncm2/ncm2-vim' | Plug 'Shougo/neco-vim'
"Language server
Plug 'mattn/vim-lsp-settings'
Plug 'ncm2/ncm2-vim-lsp'
Plug 'prabirshrestha/vim-lsp'
set shortmess+=c
inoremap <expr> <CR> (pumvisible() ? "\<c-y>" : "\<CR>")
augroup vimrc
autocmd BufEnter * call ncm2#enable_for_buffer()
autocmd TextChangedI * call ncm2#auto_trigger()
augroup END
endif
call plug#end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment