Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error detected while processing function ... Vim(let):E684: list index out of range:1 #1454

Closed
5 tasks done
linrongbin16 opened this issue Jan 24, 2023 · 2 comments
Closed
5 tasks done

Comments

@linrongbin16
Copy link

linrongbin16 commented Jan 24, 2023

Installed with packer.nvim

    use { 'junegunn/fzf', run = ":call fzf#install()", }
    use { 'junegunn/fzf.vim' }

I defined a custom command, trying to find files with fd --no-ignore --hidden:

    command! -bang -nargs=? FzfFilesNoIgnore
        \ call fzf#vim#grep('fd -tf -tl -i -u --exclude ".git" '.shellescape(<q-args>), 0, fzf#vim#with_preview(), <bang>0)

It's good to open fd and fuzzy search a file. But when enter to open the file. There's an error:

image

Please help me with that.

@linrongbin16
Copy link
Author

linrongbin16 commented Jan 25, 2023

I have found two similar issues:

The fzf#run and fzf#wrap should solve this issue.

@linrongbin16
Copy link
Author

Finally, the correct command is:

    command! -bang -nargs=? -complete=dir UnrestrictedFiles
        \ call fzf#run(
        \   fzf#vim#with_preview(
        \     fzf#wrap({ 'source': 'fd -tf -tl -i -u --exclude ".git" '.shellescape(<q-args>) }, <bang>0)
        \   )
        \ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant