wiki:Tools/Vim8

Classic Vim

For some historical reasons the default plug-in directory is ~/.vim/pack/plugins/start This assumes that you are not using any plug-in manager.

An old-school completion framework, now largely obsoleted by LSP based tools.

cd ~/.vim/pack/plugins/start
git clone git://github.com/Valloric/YouCompleteMe
cd YouCompleteMe
python3 install.py --all --system-boost --system-libclang

deoplete another (much smaller and simpler) completion framework for Neovim

To run under Vim8 it requires

cd ~/.vim/pack/plugins/start
git clone git://github.com/roxma/nvim-yarp
python3 -m pip install -U --user pyvim 
git clone git://github.com/roxma/vim-hug-neovim-rpc
cd ~/.vim/pack/plugins/start
git clone git://github.com/Shougo/deoplete.nvim

LSP support (the old way)

cd ~/.vim/pack/plugins/start
git clone git://github.com/prabirshrestha/async.vim
git clone git://github.com/prabirshrestha/vim-lsp

and in ~/.vimrc

if executable('rls')
    augroup rls
    au User lsp_setup call lsp#register_server({
        \ 'name': 'rls',
        \ 'cmd': {server_info->['rls']},
        \ 'whitelist': ['rust'],
        \ })
    autocmd FileType rs setlocal omnifunc=lsp#complete
    augroup end
endif

if executable('hie')
    augroup hie
    au User lsp_setup call lsp#register_server({
        \ 'name': 'hie',
        \ 'cmd': {server_info->['hie-wrapper']},
        \ 'whitelist': ['haskell'],
        \ })
    autocmd FileType py setlocal omnifunc=lsp#complete
    augroup end
endif

if executable('pyls')
    " pip install python-language-server
    augroup pyls 
    au User lsp_setup call lsp#register_server({
        \ 'name': 'pyls',
        \ 'cmd': {server_info->['pyls']},
        \ 'whitelist': ['python'],
        \ })
    autocmd FileType py setlocal omnifunc=lsp#complete
    augroup end
endif

let g:cpp_class_scope_highlight = 1
let g:c_no_curly_error=1

let g:clang_c_options = '-std=gnu11 -Wall -Wextra -pedantic'
let g:clang_cpp_options = '-std=c++1z -stdlib=libc++ -Wall -Wextra'

if executable('clangd')
    augroup lsp_clangd
        autocmd!
        autocmd User lsp_setup call lsp#register_server({
                    \ 'name': 'clangd',
                    \ 'cmd': {server_info->['clangd']},
                    \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
                    \ })
        autocmd FileType c setlocal omnifunc=lsp#complete
        autocmd FileType cpp setlocal omnifunc=lsp#complete
        autocmd FileType objc setlocal omnifunc=lsp#complete
        autocmd FileType objcpp setlocal omnifunc=lsp#complete
    augroup end
endif
Last modified 14 months ago Last modified on Dec 28, 2018, 12:54:18 PM
Note: See TracWiki for help on using the wiki.