generated at
ddc.vim
概要
ddc.vimdenops.vimベースの入力補完プラグインです

ソース
一覧
ddc-nvim-lsp - Neovim組み込みのLSP機能を使用した入力補完を提供してくれます
ddc-vim-lsp - vim-lspを使用した入力補完を提供してくれます
ddc-zsh - deol.nvimなどとセットで使うとよいでしょう
ddc-around - 現在の行の周辺の単語を候補として抽出してくれます
ddc-nextwork - nextwordを使用した入力補完を提供してくれます
vim-vsnip - vim-vsnip-integddc.vimのソースが提供されています
設定方法
vim
" ソースを登録します call ddc#custom#patch_global('sources', [ \ 'vsnip', \ 'vim-lsp' \ ]) " ソースの設定を変更します call ddc#custom#patch_global('sourceOptions', { \ '_': { 'matchers': ['matcher_head'] }, \ 'vsnip': {'mark': 'vsnip'}, \ 'vim-lsp': { \ 'mark': 'lsp', \ 'forceCompletionPattern': '\\.|:|->', \ 'minAutoCompleteLength': 1 \ }, \ })

フィルタ
一覧
ddc-matcher_head - 入力中の文字列に基づいて候補の絞り込みを行ってくれます

設定例 (dein.vim)
toml
[[plugins]] repo = 'Shougo/ddc.vim' depends = 'denops.vim' on_event = 'InsertEnter' hook_source = ''' execute 'source' fnamemodify($MYVIMRC, ':h') . '/plugins/ddc.rc.vim' ''' [[plugins]] repo = 'shun/ddc-vim-lsp' on_source = 'ddc.vim' depends = 'vim-lsp' [[plugins]] repo = 'Shougo/ddc-matcher_head' on_source = 'ddc.vim' [[plugins]] repo = 'prabirshrestha/vim-lsp' on_func = 'lsp#enable' hook_source = ''' execute 'source' fnamemodify($MYVIMRC, ':h') . '/plugins/lsp.rc.vim' ''' [[plugins]] repo = 'mattn/vim-lsp-settings' on_source = 'vim-lsp' [[plugins]] repo = 'hrsh7th/vim-vsnip' on_cmd = ['VsnipOpen'] on_func = 'vsnip#expandable' on_source = 'ddc.vim' hook_source = ''' execute 'source' fnamemodify($MYVIMRC, ':h') . '/plugins/vim-vsnip.rc.vim' ''' [[plugins]] repo = 'hrsh7th/vim-vsnip-integ' on_source = 'vim-vsnip' [[plugins]] repo = 'vim-denops/denops.vim' on_func = 'denops#server#start' hook_source = 'call denops#server#start()'
ddc.rc.vim の内容は下記の通り
ddc.rc.vim
call ddc#custom#patch_global('sources', [ \ 'vsnip', \ 'vim-lsp' \ ]) call ddc#custom#patch_global('sourceOptions', { \ '_': { 'matchers': ['matcher_head'] }, \ 'vsnip': {'mark': 'vsnip'}, \ 'vim-lsp': { \ 'mark': 'lsp', \ 'forceCompletionPattern': '\\.|:|->', \ 'minAutoCompleteLength': 1 \ }, \ }) call ddc#custom#patch_filetype(['typescript', 'go', 'rust'], 'sources', ['vim-lsp', 'vsnip']) call ddc#custom#patch_filetype(['ruby', 'vim'], 'sources', ['vsnip']) inoremap <silent><expr> <TAB> \ pumvisible() ? '<C-n>' : \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ? \ '<TAB>' : ddc#manual_complete() inoremap <expr><S-TAB> pumvisible() ? '<C-p>' : '<C-h>' call ddc#enable()