-
Notifications
You must be signed in to change notification settings - Fork 52
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
[feature] Macos support. #17
Comments
Any updates on this? |
Any updates on this? |
Macos support +1. |
Hey guys! FYI, if anyone is looking for
to I'm not sure yet if that makes it work alltogether, I've only just successfully installed |
Since I got myself ueberzug installed as described in [this telescope-media-files.nvim-issue](nvim-telescope#17 (comment)) ... I deleted the unconditional process abortion for macOS ... and give it a shot
so, after adapting this very plugin - which initially forcefully bails out on darwin/macOS (just deleting this portion of the plugin script) - and installing my fork in my nvim-cfg ... I found I didn't get the simple bailout msg ... but some error msg ... If anyone has some knowledge of BTW, I'm using zsh and I found this to be a bash-script or so ... maybe the syntax error is to be overcome in a very few simple steps, but I lack knowledge and am out of time/energy ... |
please support macos |
Does anyone have a high-level idea of what a solution for MacOS would look like? What are the current blockers? Happy to collaborate and take a stab at it. |
Would also be happy to lend a hand if people so desire, at this point I feel it might be easier to build a new Telescope extension from the ground up specifically for macos. |
What about using imgcat? we can display images in iterm2 |
I feel like this is probably the best option. @jswent you want to start collaborating on this? I can start a slack channel or discord or something |
|
I found a way to use viu with this plugin. Here is the config I found require("telescope").setup({
defaults = {
preview = {
mime_hook = function(filepath, bufnr, opts)
local is_image = function(filepath)
local image_extensions = { "png", "jpg", "jpeg", "gif" } -- Supported image formats
local split_path = vim.split(filepath:lower(), ".", { plain = true })
local extension = split_path[#split_path]
return vim.tbl_contains(image_extensions, extension)
end
if is_image(filepath) then
local term = vim.api.nvim_open_term(bufnr, {})
local function send_output(_, data, _)
for _, d in ipairs(data) do
vim.api.nvim_chan_send(term, d .. "\r\n")
end
end
vim.fn.jobstart({
"viu",
filepath,
}, {
on_stdout = send_output,
stdout_buffered = true,
})
else
require("telescope.previewers.utils").set_preview_message(
bufnr,
opts.winid,
"Binary cannot be previewed"
)
end
end,
},
},
})
require("telescope").load_extension("media_files") I use Alacritty and the image quality is pretty shit but at least I got a peek of what the images look like, maybe iterm2 and kitty would be better. |
hey guys! So anyway, I found a way that might be of interest to other guys on MacOS or on any platform that supports the All one has to do, is tinker a bit with a fork of this repo and replace the line in the plugin where it calls the ueberzug script with a simple string Basically like that: M.media_preview = defaulter(function(opts)
return previewers.new_termopen_previewer {
get_command = function(entry)
local tmp_table = vim.split(entry.value, "\t");
local preview = opts.get_preview_window()
opts.cwd = opts.cwd and vim.fn.expand(opts.cwd) or vim.loop.cwd()
if vim.tbl_isempty(tmp_table) then
return { "echo", "" }
end
return {
'viu',
string.format([[%s/%s]], opts.cwd, tmp_table[1]),
preview.col,
preview.line + 1,
preview.width,
preview.height
}
end
}
end, {}) Also, I did fork that already, so, if you just wanna give it a shot if it works for you, you might want to temporarily try my unmaintained fork here: github.com/joehannes-os/telescope-media-files.nvim ... Cheers 🥳 |
@joehannes nice job, but you're a monster, use dark theme right now! |
There is also a PR that replaces Ueberzug with viu #35 which looked pretty good, i only had one nit otherwise it would have been merged already |
jep been working on this for a while. sad that I didn't see this comment before, Pull request has its kinks fixed now. should be good to merge. Feel free to use it as a base-point for hologram or other better non pixelated solutions. My next stop after getting this merged is going to be svg preview |
I would love to see this feature merged. Wondering whether this issue could receive more attention if the title would be changed to me less generic. (@singlexyz) |
that pull request i mentioned was actually merged in. it switched out ueberzeug with "Chafa", which uses text symbols to draw pictures with extreme ascii art |
Any update on macos support? |
Überzug doesn't support MacOs,
Then I found a Plugin:
https://github.com/edluffy/hologram.nvim
Maybe use its method to achieve image preview in Telescope.
The text was updated successfully, but these errors were encountered: