Skip to content

Instantly share code, notes, and snippets.

@yuki-yano
Last active December 2, 2021 23:19
Show Gist options
  • Select an option

  • Save yuki-yano/2e4bb6df75c2aba4236d56a28df02a81 to your computer and use it in GitHub Desktop.

Select an option

Save yuki-yano/2e4bb6df75c2aba4236d56a28df02a81 to your computer and use it in GitHub Desktop.
ddc-fzf-matcher sample
let s:DEIN_BASE_PATH = $HOME . '/.cache/vim/tmp_bundle/'
let s:DEIN_PATH = expand(s:DEIN_BASE_PATH . 'repos/github.com/Shougo/dein.vim')
if !isdirectory(s:DEIN_PATH)
execute '!git clone --depth=1 https://github.com/Shougo/dein.vim' s:DEIN_PATH
endif
let &runtimepath .= ',' . s:DEIN_PATH
if dein#load_state(s:DEIN_BASE_PATH)
call dein#begin(s:DEIN_BASE_PATH)
call dein#add('vim-denops/denops.vim')
call dein#add('Shougo/ddc.vim')
call dein#add('Shougo/ddc-matcher_head')
call dein#add('Shougo/ddc-sorter_rank')
call dein#add('matsui54/ddc-buffer')
call dein#add('yuki-yano/ddc-fzf')
call dein#end()
call dein#save_state()
endif
filetype plugin indent on
call dein#install()
function! s:init_ddc()
let l:sources = []
call ddc#custom#patch_global('completionMode', 'popupmenu')
let l:sources += ['buffer']
call ddc#custom#patch_global('sourceOptions', {
\ '_': {
\ 'matchers': ['matcher_fzf'],
\ 'sorters': ['sorter_fzf']
\ },
\ 'buffer': {'mark': 'B'},
\ })
call ddc#custom#patch_global('sources', l:sources)
call ddc#custom#patch_global('postFilters', ['post_filter_fzf'])
call ddc#enable()
endfunction
call s:init_ddc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment