GithubHelp home page GithubHelp logo

ellisonleao / glow.nvim Goto Github PK

View Code? Open in Web Editor NEW
1.2K 1.2K 51.0 93 KB

A markdown preview directly in your neovim.

License: MIT License

Lua 98.12% Makefile 1.88%
glow golang lua markdown neovim neovim-plugin nvim preview vim

glow.nvim's Introduction

glow.nvim's People

Contributors

aemonge avatar ahmedelgabri avatar andrew15-5 avatar annacruz avatar ashishbinu avatar bitsapien avatar caleb-mitchell avatar ellisonleao avatar fffed avatar github-actions[bot] avatar h5vx avatar hsun-code avatar iaroki avatar joshddunn avatar junkmechanic avatar jupblb avatar lbartoletti avatar mengano-net avatar michaelbeaumont avatar mnacamura avatar mrcjkb avatar nocturnalbeast avatar pynappo avatar pyqlsa avatar qvieth avatar rickarubio avatar riderius avatar rywng avatar strogiyotec avatar willeccles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glow.nvim's Issues

Glow Preview completely blank in Powershell

Describe the bug
I try running :Glow on Windows with Powershell 7.1.3 but the popup window is completely blank.

If I go into insert mode in the floating window and press enter I get the message An unknown element "" was received. This can happen if the remote process closed or ended abnormally

Weirdly enough, it works perfectly well with the original cmd shell.

While this plugin probably doesn't have Windows too high on its compatibility list, I would appreciate any help.

To Reproduce
Set the shell to pwsh or powershell
Run :Glow

Expected behavior
There will be a markdown preview in the pop up window

Additional context
Neovim Version: NVIM v0.5.0-dev+1233
OS: Windows 10
Terminal: Windows Terminal 1.8.14444.0

highlights

When i first opened glow floating window it looked like this
Screenshot_20210512_125503
By adjusting NormalFloat highlight group i can change background and border colors of a floating window, but i can not figure out how to change text color, can you advice me if possible how to change it?

Error occurred during installation on Windows

Description

When running :PlugInstall to install the plugin, I encountered this error:
E5108: Error executing lua Vim:E903: Process failed to start: no such file or directory: "/bin/bash"

Environment

OS: Windows 10
Nvim: v0.5.0-828-g0a95549d6

better handling of glow installation

Current instalation is broken. The basic steps now are:

git clone https://github.com/charmbracelet/glow.git
cd glow
go build && mv glow $GOPATH/bin

Magenta background

Hey! Trying out glow, but for some reason the background is magenta. It's persisent across both the built in light and dark theme and other colour schemes for my terminal. Any ideas why? Here's a screenshot. Using neovim on arch. Terminal is alacritty.
2022-04-14-14-41-12_

Installation isn't working on macOS

I've followed the instructions from the readme (using vim-plug) and installation fails:

tar: Error opening archive: Unrecognized archive format

[Process exited 1]

If I try to run :Glow after it says it's not installed, and to run :GlowInstall, which gives me the error above as well. I noticed locally in the folder I was in, there's a glow.tar.gz file, but it doesn't seem to be a proper tar file, hence the error:

~ ls -la
-rw-r--r--  1 omar  staff     9B Jul  1 13:42 glow.tar.gz
~ file glow.tar.gz
glow.tar.gz: ASCII text, with no line terminators
~ cat glow.tar.gz
Not Found%

:GlowInstall [Process exited 2]

Describe the bug
I do :GlowInstall and it gives me an error
image

To Reproduce
Steps to reproduce the behavior:
Using the paq package manager

  1. Go to init.lua
  2. Add
paq {'npxbr/glow.nvim', run=function() vim.cmd ':GlowInstall' end, branch='main'}
  1. Do :PaqInstall
  2. Get Error
  3. Try doing :GlowInstall manually, still get error.

Expected behavior
Glow installs successfully!

Additional context
Neovim Version: NVIM v0.5.0-dev+1330
Distro: Arch Linux
Terminal: Windows Terminal (Using WSL2)

paq-nvim installation fails

Whenever i try to install glow.nvim with paq-nvim, it simply doesn't works, there's no error output, i'm unable to run both :GlowInstall and :Glow, they give no output at all, my plugins.lua file is like this at the moment:

require 'paq' {
    {'npxbr/glow.nvim', opt = true, run = vim.cmd('GlowInstall')};
}

Does glow supports paq-nvim or only packer?

Blank output

Hi I installed the plugin and :Glow gives me a blank floating window

image

Could not install plugin with Plug

Following the readme, i put the following line in my plug.vim

Plug 'ellisonleao/glow.nvim', {'do': ':GlowInstall', 'branch': 'main'}

After running PlugInstall, I got the following error:
image

nvim version: 0.5.0 stable
OS: fedora 40
plugin commit: 794649f

Question about hover

Hi! Thank you for the aweome plugin. I have a question about usage. Is it possible to use to for hover and diagnostic LSP messages? It uses markdown, but built-in Markdown renderer in Neovim is not good :)

nvim failed to call cmd a nil value

The Details

I just installed this plugin by doing

git clone https://github.com/npxbr/glow.nvim.git ~/.vim/pack/npxbr/start/glow.nvim

I am also running Neovim 0.4.4 via apt packages. However,now when I start Neovim, I get the following error.

Error detected while processing /home/filbot/.vim/pack/npxbr/start/glow.nvim/plugin/glow.vim:                                                                                                                                                                                 
line    6:                                                                                                                                                                                                                                                                    
E5105: Error while calling lua chunk: /home/filbot/.vim/pack/npxbr/start/glow.nvim/lua/glow.lua:67: attempt to call field 'cmd' (a nil value)

The glow command is in my PATH and able to be ran.

Make preview window scrollable

It seems like :Glow floating window only shows end of rendered output (depending on window size) and does not allow to scroll its content as pressing any button just closes the window (it always prints [Process exited 0] at the bottom of floating window, which also could be hidden if no errors were detected).

Looks very promising though, will be happy to replace iamcco/markdown-preview.nvim.

Files cannot be opened if their names or paths have a space in them

Using glow.nvim freshly installed through vimplug and glow 1.0.1, running :Glow on files whose names or paths contain at least one space produces an error.

Here’s the message that appears when I try it with /tmp/markdown text.md:

Error: open /tmp/markdown: no such file or directory
Usage:
  glow SOURCE [flags]
  glow [command]

Available Commands:
  help        Help about any command
  stash       Stash a markdown

Flags:
  -a, --all            show system files and directories (TUI-mode only)
  -h, --help           help for glow
  -p, --pager          display with pager
  -s, --style string   style name or JSON path (default "auto")
  -v, --version        version for glow
  -w, --width uint     word-wrap at width

Use "glow [command] --help" for more information about a command.


[Process exited 255]

If I rename the file to markdown-text.md, the plugin works as expected.

"OS not supported/recognized" on M1 Macbook

I'm not sure what the effort is to support the M1. I just got this new laptop and was looking to migrate away from emacs for my notes (it doesn't work great on M1 either). I haven't looked much into the code for why this isn't working. let me know if there's any more info I can provide

Error when executing :Glow

Hi,
not sure what's the issue here: I open a markdown file in my vim-wiki, then issue :Glow<CR> but I get this error:

E5105: Error while calling lua chunk: /home/USER/.config/nvim/plugged/glow.nvim/lua/glow.lua:36: attempt to index field 'fn' (a nil value)

Glow.nvim with math expression(LaTex)

Sorry I have not found document related to using Glow.nvim with markdown file that include LaTeX formulas. And so far it seems that if markdown files include LaTex formula such as $$x^2$$, Glow.nvim will skip this line (the whole line). At the same time, I'm using vim.markdown and it could display correctly.
Did I do something wrong or miss any documents?

Rmarkdown Files Not Supported

I'm getting a "glow only support markdown files" when I try to open a .rmd file, even though the filetype is markdown. Could this extension please be added :)

Great plugin by the way!

.markdown files not supported

I'm getting a "glow only support markdown files" when I try to open a .markdown file, even though the filetype is markdown. Opening .md works well.

OS not supported

Hi:

Great plugin by the way, thanks for your efforts.

I upgraded nvim at some point in the recent past, now :Glow won't run, I'm not sure what changed, here is my config:

  • nvim version
❯ nvim --version
NVIM v0.8.0-dev+555-gd07a39c54
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /Applications/Xcode_13.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/Users/runner/work/neovim/neovim/build/cmake.config -I/Users/runner/work/neovim/neovim/src -I/Users/runner/work/neovim/neovim/.deps/usr/include -I/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include -I/Library/Frameworks/Mono.framework/Headers -I/Users/runner/work/neovim/neovim/build/src/nvim/auto -I/Users/runner/work/neovim/neovim/build/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"
  • macOS Monterry 12.5
  • :lua print(vim.loop.os_uname().sysname) = "Darwin"
  • I use wbthomason/packer.nvim to manage my plugins, this is my :Glow snippet:
  use({
    "ellisonleao/glow.nvim",
    branch = "main",
    config = {
      function()
        require("glow").setup({
          border = "rounded",
          width = 100,
        })
      end,
    },
  })

Open glow when not in path

I would like to have :Glow work even when glow is not in my path but it exists in g:glow_binary_path. Currently it opens the terminal up and says command not found. I believe it could be fixed by changing

vim.fn.termopen(string.format("glow %s", vim.fn.shellescape(path)))
line to vim.fn.termopen(string.format("%s/glow %s", bin_path, vim.fn.shellescape(path)))

Packer installation fail

Already if I try to install like mentioned in reamdme, :PackerSync fail to install the plugin which occurs bc packer haven't loaded plugin so executing GlowInstall command fail for packer
I can open markdown and manually execute GlowInstall this way works but it's not automated

Live editing

Is glow.nvim's main intention to be a .md reader - eg. "there's this .md file in my project's documentation. I'm reading it in neovim. It's a bit painful to read raw markdown so I'll use glow.nvim"?

Would something like having two splits side by side:

  • one with the .md file (regular editable nvim buffer)
  • one with the glow preview (that updates live whenever you write something in the .md file, and is also scroll-locked to the .md pane) on the right be outisde of the scope of this project?

Live editing is already possible in https://github.com/iamcco/markdown-preview.nvim but it requires opening a separate browser window. glow.nvim is entierly vim based

Glow syntax highlight / color(s) woundn't work on windows platform

I find glow syntax highlighting don't work on Windows. I have another Ubuntu machine with same neovim init scripts & glow syntax coloring works fine there. I am using neovim 0.6.1 with packer on both Ubuntu and Windows.

Failure

I have intstalled glow to this path & updated glow_binary_path

vim.g.glow_binary_path="c:\\Neovim\\bin"

P.S. this woks fine on windows terminal prompt too.
Success

`uname -p` check reports the cpu model name on WSL

glow.nvim/lua/glow.lua

Lines 88 to 95 in d862813

arch = vim.fn.trim(vim.fn.system("uname -p"))
if arch == "unknown" then
arch = vim.fn.trim(vim.fn.system("uname -m"))
end
if not has_value({"armv6", "armv7", "i386", "x86_64"}, arch) then
api.nvim_err_writeln("Architecture not supported/recognized!")
return
end

I've checked with two wsl distros and for me uname -p reports the cpu model (not x86_64 for example).
uname -m does however respond with x86_64. Due to this the order of assignment for arch the utility fails incorrectly. Why is the -p needed at all?

Unable to configure binary path on windows

Hello,
I'm having a problem trying to configure the plugin in windows. I have installed glow using scoop as they suggest in their website, but whenever I try to execute the command :Glow, the message I get is "Install script not supported on Windows yet. ...".
I've tried to set the global variable g:glow_binary_path to the path where glow is installed, but it doesn't fix it either. Any solutions?

Thank you so much in advance

Install Glow binary at $HOME/.local/bin as per Freedesktop.org XDG standards

I believe the major desktop environments on Linux follow the XDG standards. The recommended location to install binaries is in $HOME/.local/bin. On most Linux and Linux-like distributions, this location is already in $PATH.

Can this be the default location for Glow, at least on Linux? It save users from configuring paths, creating new folders, and what not.

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

Packer problem

image

I ran :PackerInstall and then when executing :GlowInstall it fails I suppose and show the above

this is on mac running fish and also in Iterm

file does not exists

I can't open any other file

:Glow /path/to/file.md

error: file does not exist 

except for this file

:Glow
:Glow %

Suggested mapping in README

Hi. Thanks a lot for creating this nice plugin.

In README, the following mapping is suggested.

nmap <leader>p :Glow<CR>

Since this plugin is specific to markdown files, I tried buffer-specific mapping:

augroup glow
autocmd!
autocmd FileType markdown nnoremap <buffer> <silent> <Space> <Cmd>Glow<CR>
augroup END

Unfortunately with this mapping, I cannot toggle the glow preview window by hitting <Space> because the mapping is not enabled in the preview buffer.
So my thought about mapping is that it could be better to enable users to customize mapping to toggle (or close) preview window in the preview buffer. What do you think about it?

Glow in my neovim look weird

Hi, First of all thx a lot to make great thing, I'd like you help me about weird stuff

image

as you see in the picture it have | | |

I'm use Ubuntu 22.04.1 LTS
and neovim version NVIM v0.8.0-dev+237-g6e414b698

Linux AMD64 system failed with "Architecture not supported/recognized!"

Hello, devs
Thanks for your plugin, but when I enter :GlowInstall , it failed with:

installing glow..                                                     
Error in packer_compiled: ...vim/site/pack/packer/opt/packer.nvim/lua/
packer/load.lua:83: Vim(lua):Architecture not supported/recognized!   
Please check your config for correctness

I'm using packer, and the config is:

    use {"ellisonleao/glow.nvim", branch = 'main', cmd = {"Glow", "GlowInstall"}}

And the os is gentoo linux, uname -a returns:

Linux laptop 5.17.0-pf3-juan #3 SMP PREEMPT Sun May 8 10:16:45 HKT 2022 x86_64 AMD Ryzen 7 PRO 4750U with Radeon Graphics AuthenticAMD GNU/Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.