ddc.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
\ },
\ })
フィルタ
一覧
設定例 (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.vimcall 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()