Closed albertocerrone closed 1 year ago
Hi! Does this happen when opening a doc? If you're talking about the picker's preview, the picker_cmd
option is missing in your config, you have to set it to true:
{
picker_cmd = true,
}
same issue, the cli is installed and the setup is exactly the same (calling setup instead of just opts) but preview doesn't render in glow and when picking it just displays pure markdown.
That's weird, I'm basically using the same options as in the example and it works for me. I'll try to investigate that.
Could you guys try to change the cmd with another command that can output things like cat
for example?
I tried with cat and this is the result: I don't think changed anything
Just for the sake of total clarity. My machine is a M2 macbook. I don't know if there are any problems related to this
Hi there!
I have tried to add glow like suggested by the documentation but seems not to be working. this is my config:
{ "luckasRanarison/nvim-devdocs", cmd = { "DevdocsFetch", "DevdocsInstall", "DevdocsUpdate", "DevdocsUpdateAll", "DevdocsUninstall", "DevdocsOpen", "DevdocsOpenFloat", }, opts = { wrap = true, float_win = { relative = "editor", height = 75, width = 170, border = "rounded", }, ensure_installed = { "python-3.11", "django-4.2", "bootstrap-5" }, }, previewer_cmd = "glow", cmd_args = {"-s", "dark", "-w", "80" }, picker_cmd_args = { "-p"}, dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", "nvim-treesitter/nvim-treesitter", }, },
thank you so much
I just realized you put this block outside opts
, it should be inside.
previewer_cmd = "glow",
cmd_args = {"-s", "dark", "-w", "80" },
picker_cmd_args = { "-p"},
Possible Solution
tl;dr: update to latest version of plugin
Details:
I had the same issue, and have what I believe to be the same configuration (see below).
However, once I updated to the latest version of the plugin (using Lazy
) and restarted, it worked ok.
The one issue I did have is I now need to re-install all my docs.
Hope this information helps!
For reference, my config:
require("nvim-devdocs").setup({
dir_path = vim.fn.stdpath("data") .. "/devdocs", -- installation directory
telescope = {}, -- passed to the telescope picker
telescope_alt = { -- when searching globally without preview
layout_config = {
width = 75,
},
},
float_win = { -- passed to nvim_open_win(), see :h api-floatwin
relative = "editor",
height = 25,
width = 100,
border = "rounded",
},
wrap = false, -- text wrap
previewer_cmd = "glow", -- for example: "glow"
cmd_args = { "-s", "dark", "-w", "80" },
picker_cmd = true,
picker_cmd_args = { "-p" },
ensure_installed = {}, -- get automatically installed
})
@luckasRanarison mate ahahhaha! I'm so sorry ahahah rookie mistake. Now seems working with glow. the only issue is that takes ages to load each of the docs (~15secs). Is this a known issue?
It's a problem with glow itself, glow is really slow and it only makes a single write after finishing processing the whole file. It'd be better if glow generates output line by line.
It's a problem with glow itself, glow is really slow and it only makes a single write after finishing processing the whole file. It'd be better if glow generates output line by line.
Would it be possible to cache the results from glow so it doesn't need to rerender each time? You'd have to make sure to bust the cache when the doc source is updated.
That would be another solution to the issue I mentioned here https://github.com/luckasRanarison/nvim-devdocs/issues/8#issuecomment-1693923918
Caching the preview may be possible but we can't reuse the preview when opening the doc like a normal buffer.
@luckasRanarison mate ahahhaha! I'm so sorry ahahah rookie mistake. Now seems working with glow. the only issue is that takes ages to load each of the docs (~15secs). Is this a known issue?
Update: the docs are now small enough, only the currently selected section is shown so rendering with glow should be fast now. See #42
Closing this as completed.
Hi there!
I have tried to add glow like suggested by the documentation but seems not to be working. this is my config:
thank you so much