Closed ls-devs closed 1 year ago
this can be caused by any of 3 2 reasons:
I have an alternative in the works (that also works on OSX), but I need to refine it a bit still with proper image scaling, you can find it here: https://github.com/nvim-telescope/telescope-media-files.nvim/pull/35
you can import it as:
Plug 'HendrikPetertje/telescope-media-files.nvim', { 'branch': 'fix-replace-ueber-with-viu' }
or
use({
"HendrikPetertje/telescope-media-files.nvim",
branh = "fix-replace-ueber-with-viu"
requires = { { "nvim-lua/popup.nvim" } }
})
(make sure to install VIU as per instructions on https://github.com/nvim-telescope/telescope-media-files.nvim/blob/26cf84d25007544140a835c0644728e7a7e57d43/README.md)
My dotfile configuration for comparison: https://git.hendrikpeter.net/hendrikpeter/pico-vim/-/blob/master/lua/peva/telescope.lua
(notice that on line 40 i call for the media-search specifically.. these image and video searches are not bundled in to the default git_files
or find_files
)
Hi, I've tried to use it but I still get an error, please see (actually testing on my mac, not on my linux) : (Not supported)
What I've done :
Installing the plugin with your branch :
use({
"HendrikPetertje/telescope-media-files.nvim",
branh = "fix-replace-ueber-with-viu",
requires = { { "nvim-lua/popup.nvim" } },
})
Installing viu :
tried with cargo, tried with brew too. viu is working with cli , see :
My configuration for telescope (tried to follow yours) :
local telescope = require("telescope")
local actions = require("telescope.actions")
if not telescope then
return
end
if not actions then
return
end
local function is_git_repo()
local is_repo = vim.fn.system("git rev-parse --is-inside-work-tree")
return vim.v.shell_error == 0
end
telescope.setup({
defaults = {
file_ignore_patterns = {
".git/",
"node_modules/*",
},
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
},
n = {
["<Tab>"] = actions.toggle_selection + actions.move_selection_worse,
["<S-Tab>"] = actions.toggle_selection + actions.move_selection_better,
},
},
},
extensions = {
media_files = {
-- filetypes whitelist
filetypes = { "png", "webp", "jpg", "jpeg", "gif", "mp4", "pdf" },
},
},
pickers = {
find_files = {
theme = "dropdown",
previewer = false,
},
buffers = {
theme = "dropdown",
previewer = false,
},
},
})
telescope.load_extension("media_files")
vim.keymap.set(
'n',
'<leader>,',
function()
if (is_git_repo()) then
builtin.git_files()
else
builtin.find_files()
end
end
, {})
vim.keymap.set('n', '<leader>mf', telescope.extensions.media_files.media_files, {})
thanks for the reply @ls-devs, I removed the "not supported" warnings early on in my pull request (which where initially there to stop OSX users from using the app) and made them a lot more verbose in my pull request later on. are you sure that you cleaned the old repo up from your packer cache before installing mine?
thanks for the reply @ls-devs, I removed the "not supported" warnings early on in my pull request (which where initially there to stop OSX users from using the app) and made them a lot more verbose in my pull request later on. are you sure that you cleaned the old repo up from your packer cache before installing mine?
I didn't, but now even after cleaning cache and reinstalling I still get this error on OSX. On my Linux, I have no errors, but the image is not displayed on the right panel too (viu cli works on my linux too I can see the image displayed in terminal). Thanks for taking your time helping.
i pushed a little fix up to always render in blocks. i noticed on Iterm and on my gnome terminal that nothing was being rendered when i was outside tmux... it can't fit images in.
it's odd that you are getting this error, I don't think there is any code left in the bash script that could echo that error to the console view in the preview window 😅
So how did you manage to make it work on your presentation ?
i pushed a little fix up to always render in blocks. i noticed on Iterm and on my gnome terminal that nothing was being rendered when i was outside tmux... it can't fit images in.
Can't see any new commit on your repository, where did you push your fix ?
I'll try to run it with your config in a while. mine seems to be working fine, pushed additional things, but that is not fixing your issue i think (just resizing)
I'll try to run it with your config in a while. mine seems to be working fine, pushed additional things, but that is not fixing your issue i think (just resizing)
If you want to see the full config you can visit my nvim setup repository. Thank you for helping 👍🏼
I ran your full config and I can reproduce your whoes!
it looks like when telescope-media-files gets pulled down that it just completely ignores the branch setting.
Everything starts working when i manually checkout to the correct branch, that's not really a desirable option though, I'm still on the Plug side of things, you might do some research to see if you can force packer to use the right branch.
(side-note: interesting choice to put leader on space-bar, took me a while to figure that one out :p)
I ran your full config and I can reproduce your whoes!
it looks like when telescope-media-files gets pulled down that it just completely ignores the branch setting.
Everything starts working when i manually checkout to the correct branch, that's not really a desirable option though, I'm still on the Plug side of things, you might do some research to see if you can force packer to use the right branch.
(side-note: interesting choice to put leader on space-bar, took me a while to figure that one out :p)
Wow ! A huge thank ! I never would have thought to check this... It works now, but as you said, the image is not really well sized.
Forgot to mention I use the space-bar, I learned nvim this way !
(side-note: writing this, I discovered why packer didn't use the right branch, Ii'm gonna let you find out in the next code ahah
use({
"HendrikPetertje/telescope-media-files.nvim",
branh = "fix-replace-ueber-with-viu",
requires = { { "nvim-lua/popup.nvim" } },
})
)
branh 🥇
small thing after my changes today. I switched from VIU to "chafa" as it is much better at putting things in the center and more importantly it uses glyphs with background/foreground colouring to make higher res images https://github.com/nvim-telescope/telescope-media-files.nvim/pull/35#issuecomment-1368915792
so since you've been testing with viu you might get some breaking changes (or warnings to install a picture lib) chafa is available on homebrew.
@HendrikPetertje
Installed chafa, it's working of course, but can't get the image to display correctly.
Please see :
Original image :
it turns images in to ASCII art at the capability of the terminal you are working in (an inline terminal inside a vim popup) as shown here https://hpjansson.org/chafa/ when displaying an image it's not going to be able to represent each little detail (especially small text) perfectly as it does a best effort of turning the picture into ascii art
Hi, I just installed the extension, everything seems to be working, I have no errors but the images are not showing on the right panel, I got no preview. See :![image](https://user-images.githubusercontent.com/58638832/208525425-609a9f79-f64f-45b2-97af-7ba5c6918e59.png)
Config :
Nvim :
Packer :
Telescope.lua :