This plugin integrates neosnippet.vim in vim-lsp to provide Language Server Protocol snippets. You can use both Vim's built-in omnifunc or asyncomplete.vim for completion.
This plugin requires neosnippet.vim, vim-lsp and their dependencies. If these are already installed and you are using vim-plug, you can simply add this to your vimrc:
Plug 'thomasfaingnaert/vim-lsp-snippets' Plug 'thomasfaingnaert/vim-lsp-neosnippet'
Otherwise, you can install these using vim-plug as well:
Plug 'Shougo/neosnippet.vim' Plug 'prabirshrestha/async.vim' Plug 'prabirshrestha/vim-lsp' Plug 'thomasfaingnaert/vim-lsp-snippets' Plug 'thomasfaingnaert/vim-lsp-neosnippet'Disable for specific language servers
By default, snippet integration is enabled for all language servers. You can disable snippets for one or more servers manually as follows:
autocmd User lsp_setup call lsp#register_server({ \ 'name': 'clangd', \ 'cmd': {server_info->['clangd']}, \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], \ 'config': { 'snippets': 0 } \ })Example Configuration (using omnifunc)
call plug#begin() Plug 'Shougo/neosnippet.vim' Plug 'prabirshrestha/async.vim' Plug 'prabirshrestha/vim-lsp' Plug 'thomasfaingnaert/vim-lsp-snippets' Plug 'thomasfaingnaert/vim-lsp-neosnippet' call plug#end() imap <expr> <Tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<Tab>" smap <expr> <Tab> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<Tab>" if executable('clangd') augroup vim_lsp_cpp autocmd! autocmd User lsp_setup call lsp#register_server({ \ 'name': 'clangd', \ 'cmd': {server_info->['clangd']}, \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp', 'cc'], \ }) autocmd FileType c,cpp,objc,objcpp,cc setlocal omnifunc=lsp#complete augroup end endif if has('conceal') set conceallevel=2 concealcursor=niv endif set completeopt+=menuone
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4