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

Open pdf files in pdf viewer after search #1453

Open
5 tasks done
initzx opened this issue Jan 17, 2023 · 1 comment
Open
5 tasks done

Open pdf files in pdf viewer after search #1453

initzx opened this issue Jan 17, 2023 · 1 comment

Comments

@initzx
Copy link

initzx commented Jan 17, 2023

After search for a pdf, I would like to open the pdf in a viewer rather than to have a binary buffer opened in vim. For example it would be nice to somehow have fzf.vim recognize the filetype, and use xdg-open to open the file accordingly. Right now if I find a pdf file, then the pdf is opened in nvim as binary text.

@freddiegar
Copy link

No problem!, by example I open pdf files in browser from Vim(9) with this autocmd:

autocmd BufEnter *.pdf GoUrl(expand('<afile>')) | bwipeout

def GoUrl(uri: string): void
    silent execute "!/usr/bin/firefox '" .. shellescape(uri, 1) .. "'"

    silent redraw!
enddef

You can use zathura or whatever what do you want

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

2 participants