Closed luckasRanarison closed 1 year ago
Exactly the first thing i did! fetching the doc and immediately using glow on it
was gonna create an issue for this, so yeah something like glow works perfectly for this cause seeing raw markdown in a buffer isn't exactly functional... id rather just use the browser
was gonna create an issue for this, so yeah something like glow works perfectly for this cause seeing raw markdown in a buffer isn't exactly functional... id rather just use the browser
vim.cmd[[
augroup AutoCloseMarkdownGlow
autocmd!
autocmd FileType markdown,glowpreview nnoremap <buffer> q :q<CR>
augroup END
]]
vim.cmd[[
augroup MarkdownKeymaps
autocmd!
autocmd FileType markdown nnoremap <buffer> <leader>dd :lua MyGlow()<CR>
autocmd FileType glowpreview nnoremap <buffer> <leader>dd :<CR>
augroup END
]]
function MyGlow()
vim.cmd('Glow')
for _, winid in ipairs(vim.fn.getwininfo()) do
local bufnr = winid.bufnr
local filetype = vim.api.nvim_buf_get_option(bufnr, 'filetype')
if filetype == 'markdown' then
vim.cmd('bw ' .. bufnr)
return
end
end
end
-- Keymap for DevdocsOpenFloat
vim.api.nvim_set_keymap("n", "<leader>dd", ":DevdocsOpenFloat<CR>", {noremap = true, silent = true})
Screencast from 2023-08-12 16-32-04.webm
vim.cmd('Glow')
vim.defer_fn(function()
vim.cmd('bdelete ' .. buf)
end, 2000) -- you can adjust the timing
New in 5b6ba3c Good news guys... You can now use custom cmds for previewing docs! Checkout the new config options for more details. It's still not available for the telescope previewer however, I'm still thinking on how to improve the performance...
I tried the glow support by adding previewer_cmd = 'glow',
.
At first I was getting nothing at all displayed. But I was using glow 1.4.1. I upgraded it to 1.5.1 and now I'm getting something displayed, and it's the glow output, for instance links are handled differently.. However I'm getting no syntax highlighting at all. Not sure why for now.
I'm using linux.
EDIT: fixed, see next comment
ok, with the --s flags you give in the documentation i get syntax highlighting :+1:
ok, with the --s flags you give in the documentation i get syntax highlighting 👍
could you show me your setup options ? i cant make it work for me
New in 5b6ba3c Good news guys... You can now use custom cmds for previewing docs! Checkout the new config options for more details. It's still not available for the telescope previewer however, I'm still thinking on how to improve the performance...
would you mind sharing your colorscheme theme and wallpaper background ? 🍾
@I-Own-You I just used the settings from the readme, namely:
previewer_cmd = 'glow',
cmd_args = { "-s", "dark", "-w", "80" },
All pickers have previews now and support custom commands so I think I can close this.
Use tools like glow to render documentations inside a terminal buffer