Coder Social home page Coder Social logo

preview-markdown.vim's Introduction

preview-markdown.vim

This plugin is no longer to develop. If you want to use, you can fork and improve it yourself

This is vim plugin that can preview markdown in Vim terminal.

Requirements

Installation

e.g dein.vim

[[plugins]]
repo = 'skanehira/preview-markdown.vim'

Usage

:PreviewMarkdown [left|top|right|bottom|tab]

Options

option description
g:preview_markdown_parser Use specified command to parse markdown, default is mdr
g:preview_markdown_auto_update Update preview window when write to buffer.

Markdown parser

Author

skanehira

preview-markdown.vim's People

Contributors

akirahasegawa1997 avatar aquatix avatar hituzi-no-sippo avatar huyu398 avatar mkakh avatar mursts avatar skanehira avatar takezyou 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

preview-markdown.vim's Issues

Sometimes preview can't start

Sometimes occurre this error.

Error detected while processing function <SNR>105_auto_preview[4]..preview_markdown#preview:
line   70:
E948: Job still running (add ! to end the job)

Neovim support?

Neovim fails to render the preview with the message; preview-markdown.vim: this version doesn't support terminal
Are you planning to support neovim?

Preview does not load in regular vim

When viewing a markdown file in vim, and doing the :PreviewMarkdown for a few weeks now I get this error:

Error detected while processing function preview_markdown#preview:
line   68:
E119: Not enough arguments for function: bufnr
E116: Invalid arguments for function term_getjob(bufnr())

Using vim 8.1.1401

The plugin used to work; I checked, the last commit working here is 13a8f21 After that, 3265c3e breaks it.

Error E900: Invalid channel id

Hello, I cannot use PreviewMarkdown as it always returns this error:

Error detected while processing function preview_markdown#preview[37]..<SNR>80_stop_job:                                                                                                                 
line    4:
E900: Invalid channel id
Press ENTER or type command to continue

I have tried with both mdr and glow. However, I can successfully can mdr myfile.md or glow myfile.md.

My configuration:

NVIM v0.4.4
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-u4YhjF/neovim-0.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-u4YhjF/neovim-0.4.4/build/config -I/build/neovim-u4YhjF/neovim-0.4.4/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-u4YhjF/neovim-0.4.4/build/src/nvim/auto -I/build/neovim-u4YhjF/neovim-0.4.4/build/include
Compiled by [email protected]

Render markdown from stdin rather than tmpfile

I noticed that there's a bunch of code dealing with creating/reading/cleaning up temporary files, but also that all of the markdown renderers support reading from stdin:

  • echo "foo" | glow -
  • echo "foo" | mdr
  • echo "foo" | mdcat

Would it be worth to simplify the code and generalize the parser command support to just take any command that reads from stdin?

Doesn't work on neovim

With neovim, when I call :PreviewMarkdown it error with Undefined variable: opt which I think is from this line

After I remove the opt or define it with let opt = {} the error is error while reading file: open /tmp/nvimv2tjpV/3.md: no such file or directory

glow errors out with "Error: missing markdown source"

Hi!

I've set up the plugin so that it uses glow (let g:preview_markdown_parser = "glow") and when I run :PreviewMarkdown on a buffer with a .md file, it does open a new window and runs glow, but it errors out with:

Error: missing markdown source

It feels like preview_markdown#preview() is not passing any file name to glow.

Am I doing something wrong?

Thank you so much for the plugin and for any help! ๐Ÿ™‡โ€โ™‚๏ธ

E916 error when :PreviewMarkdown on any file

Hi,

I've installed the plugin as described with Vundle and also installed mdr as well as glow. Whenever I try to get the Preview with :PreviewMarkdown I get the following error:

Error detected while processing function preview_markdown#preview:
line   70:
E916: not a valid job
Press ENTER or type command to continue

then, an new empty window with [No Name] shows up.

I've tried with

let g:preview_markdown_parser = "mdr"

as well as with

let g:preview_markdown_parser = "glow"

, same result.

I've copied the mdr binary into /usr/local/bin and made sure it's in $PATH. When I run

mdr myFile.md

it works just fine.
My vim version is:

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 18 2020 18:29:15)
Included patches: 1-1453

preview window in the left

when I press :PreviewMarkdown and enter, the preview window shows in the left, can I modify it to make it display in the right

mdr preview only a part of markdown file

Screenshot from 2021-03-30 00-23-27

This issue is described in the image above. I also already trying with glow but still getting an error: no such tmp file exception. Here is my nvim config:

Plug 'skanehira/preview-markdown.vim'
let g:preview_markdown_vertical=1
let g:preview_markdown_parser='glow'

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.