Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Language Server Protocol snippets in vim using vim-lsp and neosnippet.vim

License

NotificationsYou must be signed in to change notification settings

thomasfaingnaert/vim-lsp-neosnippet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This plugin integratesneosnippet.vim invim-lsp to provide Language Server Protocol snippets.You can use both Vim's built-in omnifunc orasyncomplete.vim for completion.

Demo

GIF demo

Quick Start

This plugin requiresneosnippet.vim,vim-lsp and their dependencies.If these are already installed and you are usingvim-plug, you can simply add this to your vimrc:

Plug'thomasfaingnaert/vim-lsp-snippets'Plug'thomasfaingnaert/vim-lsp-neosnippet'

Otherwise, you can install these usingvim-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:

autocmdUserlsp_setupcalllsp#register_server({\'name':'clangd',\'cmd': {server_info->['clangd']},\'whitelist': ['c','cpp','objc','objcpp','cc'],\'config': {'snippets':0 }\})

Example Configuration (using omnifunc)

callplug#begin()Plug'Shougo/neosnippet.vim'Plug'prabirshrestha/async.vim'Plug'prabirshrestha/vim-lsp'Plug'thomasfaingnaert/vim-lsp-snippets'Plug'thomasfaingnaert/vim-lsp-neosnippet'callplug#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>"ifexecutable('clangd')augroupvim_lsp_cppautocmd!autocmdUserlsp_setupcalllsp#register_server({\'name':'clangd',\'cmd': {server_info->['clangd']},\'whitelist': ['c','cpp','objc','objcpp','cc'],\})autocmdFileTypec,cpp,objc,objcpp,ccsetlocalomnifunc=lsp#completeaugroupendendififhas('conceal')set conceallevel=2 concealcursor=nivendifsetcompleteopt+=menuone

About

Language Server Protocol snippets in vim using vim-lsp and neosnippet.vim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp