Shougo / ddu-kind-file

File kind for ddu.vim
MIT License
25 stars 9 forks source link

Feature request: Able to specify the method of the executeSystem. #18

Closed kyoh86 closed 7 months ago

kyoh86 commented 7 months ago

Sometimes I want to call wslview as a priority over vim.ui.open. Currently, ddu#kind#file#open does a good job of selecting the system calls that are available in the environment, but in some cases, I would like to control the priority from the config. Is it possible to achieve this with an actionParams or something like that? I would like to be able to specify a parameter like "method" in the actionParams of executeSystem.

e.g.:

call ddu#custom#patch_global({
    \ "actionParams": {
        \ "executeSystem": {
            \ "method": "wslview" # calls wslview.exe
        \ }
    \ }
})
call ddu#custom#patch_global({
    \ "actionParams": {
        \ "executeSystem": {
            \ "method": "neovim" # uses vim.ui.open
        \ }
    \ }
})
call ddu#custom#patch_global({
    \ "actionParams": {
        \ "executeSystem": {
            \ "method": "gnome" # calls gnome-open
        \ }
    \ }
})
call ddu#custom#patch_global({
    \ "actionParams": {
        \ "executeSystem": {
            \ "method": "wincmd-rundll32" # calls rundll32 over cmd.exe
        \ }
    \ }
})
Shougo commented 7 months ago

Implemented.