Preview images, pdf, epub, video, and fonts from Neovim using Telescope.
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-telescope/telescope-media-files.nvim'
require('telescope').load_extension('media_files')
This extension can be configured using extensions
field inside Telescope
setup function.
require'telescope'.setup {
extensions = {
media_files = {
-- filetypes whitelist
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
filetypes = {"png", "webp", "jpg", "jpeg"},
-- find command (defaults to `fd`)
find_cmd = "rg"
}
},
}
:Telescope media_files
"Using lua function
lua require('telescope').extensions.media_files.media_files()
When you press <CR>
on a selected file, it will copy its relative path to the clipboard
- Chafa (required for image support)
- ImageMagick (optional, for svg previews)
- fd / rg / find or fdfind in Ubuntu/Debian.
- ffmpegthumbnailer (optional, for video preview support)
- pdftoppm (optional, for pdf preview support. Available in the AUR as poppler package.)
- epub-thumbnailer (optional, for epub preview support.)
- fontpreview (optional, for font preview support)
credit to https://github.com/cirala/vifmimg