[[plugins]]
repo = 'Shougo/ddu.vim'
depends = ['denops.vim']
# on_source = ['denops.vim']
hook_source = '''
let s:patch_global = {}
let s:sourceOptions = {}
let s:sourceParams = {}
let s:uiParams = {}
let s:kindOptions = {}

let s:patch_global.ui = 'ff'
let s:sourceOptions._ = {
      \ 'ignoreCase': v:true,
      \ 'matchers': ['matcher_fzf'],
      \ }
let s:sourceOptions.file_old = {
      \ 'matchers': ['matcher_fzf', 'matcher_relative', 'matcher_hidden'],
      \ }
let s:sourceOptions.file_external = {
      \ 'matchers': ['matcher_fzf', 'matcher_hidden'],
      \ }

let s:sourceParams.file_external = {
      \ 'cmd': ['git', 'ls-files', '-co', '--exclude-standard'],
      \ }

let s:uiParams.ff = {
    \ 'split': has('nvim') ? 'floating' : 'horizontal',
    \ 'prompt': '> ',
    \ }

let s:kindOptions.file = {
      \ 'defaultAction': 'open',
      \ }
let s:kindOptions.readme_viewer = {
      \ 'defaultAction': 'open',
      \ }
let s:kindOptions.colorscheme = {
      \ 'defaultAction': 'set',
      \ }
let s:kindOptions.help = {
      \ 'defaultAction': 'open',
      \ }

let s:patch_global.sourceOptions = s:sourceOptions
let s:patch_global.sourceParams = s:sourceParams
let s:patch_global.uiParams = s:uiParams
let s:patch_global.kindOptions = s:kindOptions
call ddu#custom#patch_global(s:patch_global)
'''

[plugins.ftplugin]
ddu-ff = '''
nnoremap <silent><buffer> <CR>
      \ <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <silent><buffer> <Space>
      \ <Cmd>call ddu#ui#ff#do_action('toggleSelectItem')<CR>
nnoremap <silent><buffer> i
      \ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <silent><buffer> <C-l>
      \ <Cmd>call ddu#ui#ff#do_action('refreshItems')<CR>
nnoremap <silent><buffer> p
      \ <Cmd>call ddu#ui#ff#do_action('preview')<CR>
nnoremap <silent><buffer> q
      \ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
'''

ddu-ff-filter = '''
inoremap <silent><buffer> <CR>
      \ <Esc><Cmd>close<CR>
nnoremap <silent><buffer> <CR>
      \ <Cmd>close<CR>
'''

[[plugins]]
repo = 'Shougo/ddu-commands.vim'
depends = ['ddu.vim']
on_cmd = ['Ddu']

# UI

[[plugins]]
repo = 'Shougo/ddu-ui-ff'
on_source = 'ddu.vim'

# filters

[[plugins]]
repo = 'Shougo/ddu-filter-matcher_hidden'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-filter-matcher_relative'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-filter-matcher_substring'
on_source = 'ddu.vim'

[[plugins]]
repo = 'yuki-yano/ddu-filter-fzf'
on_source = 'ddu.vim'

# kinds

[[plugins]]
repo = 'Shougo/ddu-kind-file'
on_source = 'ddu.vim'

# sources

[[plugins]]
repo = '4513echo/ddu-source-colorscheme'
on_source = 'ddu.vim'

[[plugins]]
repo = '4513echo/ddu-source-ghq'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-source-file'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-source-file_old'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-source-file_point'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-source-file_rec'
on_source = 'ddu.vim'

[[plugins]]
repo = 'Shougo/ddu-source-line'
on_source = 'ddu.vim'

[[plugins]]
repo = 'matsui54/ddu-source-file_external'
on_source = 'ddu.vim'

[[plugins]]
repo = 'matsui54/ddu-source-help'
on_source = 'ddu.vim'

[[plugins]]
repo = 'shun/ddu-source-buffer'
on_source = 'ddu.vim'

[[plugins]]
repo = 'shun/ddu-source-rg'
on_source = 'ddu.vim'