ellisonleao/glow.nvim

github github
markdown plugin
star 319
stars
alert-circle 8
open issues
users 4
subscribers
git-branch 16
forks
CREATED

2020-08-12

UPDATED

29 days ago

packer

require('packer').startup(function()
  use 'ellisonleao/glow.nvim'
end)

paq

require "paq" { 
  'ellisonleao/glow.nvim'
}

glow.nvim

A glow preview directly in your neovim buffer.

Prerequisites

  • Neovim 0.5 or higher

Installing

with vim-plug

Plug 'ellisonleao/glow.nvim'

with packer.nvim

use {"ellisonleao/glow.nvim"}

Configuration

  • glow_binary_path

Use g:glow_binary_path for vimscript config or vim.g.glow_binary_path for lua config.

If set, this path will be used to execute glow. Otherwise rely on $PATH.

If glow is not on $PATH or glow_binary_path is set and glow is not found there, this path will be used to download the glow executable. It defaults to $HOME/.local/bin.

Example:

let g:glow_binary_path = $HOME . "/bin"
vim.g.glow_binary_path = vim.env.HOME .. "/bin"
  • glow_border

Use g:glow_border for vimscript config or vim.g.glow_border for lua config.

If set, this will change the border of the window. Type :help nvim_open_win for border options.

Example:

let g:glow_border = "rounded"
vim.g.glow_border = "rounded"
  • glow_width

Use g:glow_width for vimscript config or vim.g.glow_width for lua config.

If set, this will change the width of the window.

Example:

let g:glow_width = 120
vim.g.glow_width = 120

Usage

:GlowInstall

This will install the glow dependency into g:glow_binary_path or $HOME/.local/bin if not defined.

:Glow [path-to-md-file]
  • Pressing q will automatically close the window
  • No path arg means glow uses current path in vim
  • :Glow command will work as toogle feature, so calling it will open or close the current preview

You can also create a mapping getting a preview of the current file

noremap <leader>p :Glow<CR>

For users who want to make glow.nvim buffer fullscreen, there's a native vim keybinding

  • Ctrl-w + | set window's width max
  • Ctrl-w + _ set window's height max

Or you can have a fullscreen option by creating a mapping for setting both window's height and width max at once

noremap <C-w>z <C-w>\|<C-w>\_

Screenshot