Closed jeffwillette closed 2 years ago
For those who may find this later. I found the examples in the documentation for the ff
UI and not in the main ddu documentation. Using the stock example there seems to work well. Below should be added to the init.vim
autocmd FileType ddu-ff call s:ddu_ff_my_settings()
function! s:ddu_ff_my_settings() abort
nnoremap <buffer> <CR>
\ <Cmd>call ddu#ui#ff#do_action('itemAction')<CR>
nnoremap <buffer> <Space>
\ <Cmd>call ddu#ui#ff#do_action('toggleSelectItem')<CR>
nnoremap <buffer> i
\ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
nnoremap <buffer> q
\ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
inoremap <buffer> <CR>
\ <Esc><Cmd>close<CR>
nnoremap <buffer> <CR>
\ <Cmd>close<CR>
endfunction
" open list of buffers, open directory for seatch, search for test in files (rg)
nnoremap <leader><leader> <Cmd>call ddu#start({'sources': [{'name': 'buffer'}]})<CR>
nnoremap <leader><Space> <Cmd>call ddu#start({'sources': [{'name': 'file_rec'}]})<CR>
"nnoremap <leader><Space><Space> <Cmd>call ddu#start({'volatile': v:true, 'sources': [{'name': 'rg'}]})<CR>
nnoremap <leader><Space><Space> <Cmd>call <SID>ddu_rg_live()<CR>
"nnoremap <CR> <Cmd>ddu#ui_action('default')<CR>
I still have a remaining problem though. Now when I call the defaultAction, I get an error which reads
[ddu] Invalid kind: file
I see now that the 'kind' is actually another module which needs to be installed to implement file operations. I did not know everything would be so modular down to this micro level. Sorry for the noise, I hope this thread helps someone in the future.
This is what I needed to install https://github.com/Shougo/ddu-kind-file
Yes. All features are modular in ddu.vim.
For those who may find this later. I found the examples in the documentation for the ff UI and not in the main ddu documentation.
Because, it is UI feature instead of ddu.vim
.
You need to read sources documentation. For example, in ddu-source-file:
## Required
### denops.vim
https://github.com/vim-denops/denops.vim
### ddu.vim
https://github.com/Shougo/ddu.vim
### ddu-kind-file
https://github.com/Shougo/ddu-kind-file
The dependency is already documented.
Warning: I will close the issue without the minimal init.vim and the reproduction instructions.
Problems summary
Hi. I am migrating from Denite and I get the general flow of how this new plugin works, but I cannot figure out how to accomplish two things.
1) How to define and call actions in the init.vim file? Currently I can pull up the ddu buffer, but then I have no way to open files. 2) How to refine input with the fuzzy finder? for instance if 'file_rec' pulls up too many files, how can I refine my search after the buffer comes up?
Expected
I have looked through the documentation, but I do not see any examples of how to do this.
Environment Information
ddu.vim version (SHA1): 649e50b2db53a63c7be5de942e356ac4e914b5d6
denops.vim version (SHA1): d01a89773b158255073cefa88f6527fb9f522e59
deno version(
deno -V
output): deno 1.20.6OS: Ubuntu 20.04
neovim/Vim
:version
output: NVIM v0.7.0-dev+1254-g6dc2c8293:checkhealth
or:CheckHealth
result(neovim only):Provide a minimal init.vim/vimrc with less than 50 lines (Required!)
How to reproduce the problem from neovim/Vim startup (Required!)
Screenshot (if possible)