GithubHelp home page GithubHelp logo

iamcco / markdown-preview.nvim Goto Github PK

View Code? Open in Web Editor NEW
6.1K 35.0 262.0 11.36 MB

markdown preview plugin for (neo)vim

License: MIT License

CSS 7.75% JavaScript 56.43% HTML 3.57% TypeScript 5.92% Batchfile 0.78% Shell 2.95% Vim Script 22.60%
neovim vim markdown preview

markdown-preview.nvim's Introduction

✨ Markdown Preview for (Neo)vim ✨

Powered by ❤️

Introduction

It only works on Vim >= 8.1 and Neovim

Preview Markdown in your modern browser with synchronised scrolling and flexible configuration.

Main features:

Note the plugin mathjax-support-for-mkdp is not needed for typesetting math.

animation of Markdown Preview with its own README.md

Installation & Usage

Install with vim-plug:

" If you don't have nodejs and yarn
" use pre build, add 'vim-plug' to the filetype list so vim-plug can update this plugin
" see: https://github.com/iamcco/markdown-preview.nvim/issues/50
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}


" If you have nodejs
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && npx --yes yarn install' }

Or install with dein:

call dein#add('iamcco/markdown-preview.nvim', {'on_ft': ['markdown', 'pandoc.markdown', 'rmd'],
					\ 'build': 'sh -c "cd app && npx --yes yarn install"' })

Or with minpac:

call minpac#add('iamcco/markdown-preview.nvim', {'do': 'packloadall! | call mkdp#util#install()'})

Or with Vundle:

Place this in your .vimrc or init.vim,

Plugin 'iamcco/markdown-preview.nvim'

... then run the following in Vim (to complete the Plugin installation):

:source %
:PluginInstall
:call mkdp#util#install()

Or with lazy.nvim:

Add this in your init.lua or plugins.lua

-- install without yarn or npm
{
    "iamcco/markdown-preview.nvim",
    cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
    ft = { "markdown" },
    build = function() vim.fn["mkdp#util#install"]() end,
}

-- install with yarn or npm
{
  "iamcco/markdown-preview.nvim",
  cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
  build = "cd app && yarn install",
  init = function()
    vim.g.mkdp_filetypes = { "markdown" }
  end,
  ft = { "markdown" },
},

Or with Packer.nvim:

Add this in your init.lua or plugins.lua

-- install without yarn or npm
use({
    "iamcco/markdown-preview.nvim",
    run = function() vim.fn["mkdp#util#install"]() end,
})

use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })

Or by hand:

use {'iamcco/markdown-preview.nvim'}

add plugin to the ~/.local/share/nvim/site/pack/packer/start/ directory:

cd ~/.local/share/nvim/site/pack/packer/start/
git clone https://github.com/iamcco/markdown-preview.nvim.git
cd markdown-preview.nvim
npx --yes yarn install
npx --yes yarn build

Please make sure that you have installed node.js and yarn. Open nvim and run :PackerInstall to make it workable

MarkdownPreview Config:

" set to 1, nvim will open the preview window after entering the Markdown buffer
" default: 0
let g:mkdp_auto_start = 0

" set to 1, the nvim will auto close current preview window when changing
" from Markdown buffer to another buffer
" default: 1
let g:mkdp_auto_close = 1

" set to 1, Vim will refresh Markdown when saving the buffer or
" when leaving insert mode. Default 0 is auto-refresh Markdown as you edit or
" move the cursor
" default: 0
let g:mkdp_refresh_slow = 0

" set to 1, the MarkdownPreview command can be used for all files,
" by default it can be use in Markdown files only
" default: 0
let g:mkdp_command_for_global = 0

" set to 1, the preview server is available to others in your network.
" By default, the server listens on localhost (127.0.0.1)
" default: 0
let g:mkdp_open_to_the_world = 0

" use custom IP to open preview page.
" Useful when you work in remote Vim and preview on local browser.
" For more details see: https://github.com/iamcco/markdown-preview.nvim/pull/9
" default empty
let g:mkdp_open_ip = ''

" specify browser to open preview page
" for path with space
" valid: `/path/with\ space/xxx`
" invalid: `/path/with\\ space/xxx`
" default: ''
let g:mkdp_browser = ''

" set to 1, echo preview page URL in command line when opening preview page
" default is 0
let g:mkdp_echo_preview_url = 0

" a custom Vim function name to open preview page
" this function will receive URL as param
" default is empty
let g:mkdp_browserfunc = ''

" options for Markdown rendering
" mkit: markdown-it options for rendering
" katex: KaTeX options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
" disable_sync_scroll: whether to disable sync scroll, default 0
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
"   middle: means the cursor position is always at the middle of the preview page
"   top: means the Vim top viewport always shows up at the top of the preview page
"   relative: means the cursor position is always at relative positon of the preview page
" hide_yaml_meta: whether to hide YAML metadata, default is 1
" sequence_diagrams: js-sequence-diagrams options
" content_editable: if enable content editable for preview page, default: v:false
" disable_filename: if disable filename header for preview page, default: 0
let g:mkdp_preview_options = {
    \ 'mkit': {},
    \ 'katex': {},
    \ 'uml': {},
    \ 'maid': {},
    \ 'disable_sync_scroll': 0,
    \ 'sync_scroll_type': 'middle',
    \ 'hide_yaml_meta': 1,
    \ 'sequence_diagrams': {},
    \ 'flowchart_diagrams': {},
    \ 'content_editable': v:false,
    \ 'disable_filename': 0,
    \ 'toc': {}
    \ }

" use a custom Markdown style. Must be an absolute path
" like '/Users/username/markdown.css' or expand('~/markdown.css')
let g:mkdp_markdown_css = ''

" use a custom highlight style. Must be an absolute path
" like '/Users/username/highlight.css' or expand('~/highlight.css')
let g:mkdp_highlight_css = ''

" use a custom port to start server or empty for random
let g:mkdp_port = ''

" preview page title
" ${name} will be replace with the file name
let g:mkdp_page_title = '「${name}」'

" use a custom location for images
let g:mkdp_images_path = /home/user/.markdown_images

" recognized filetypes
" these filetypes will have MarkdownPreview... commands
let g:mkdp_filetypes = ['markdown']

" set default theme (dark or light)
" By default the theme is defined according to the preferences of the system
let g:mkdp_theme = 'dark'

" combine preview window
" default: 0
" if enable it will reuse previous opened preview window when you preview markdown file.
" ensure to set let g:mkdp_auto_close = 0 if you have enable this option
let g:mkdp_combine_preview = 0

" auto refetch combine preview contents when change markdown buffer
" only when g:mkdp_combine_preview is 1
let g:mkdp_combine_preview_auto_refresh = 1

Mappings:

" normal/insert
<Plug>MarkdownPreview
<Plug>MarkdownPreviewStop
<Plug>MarkdownPreviewToggle

" example
nmap <C-s> <Plug>MarkdownPreview
nmap <M-s> <Plug>MarkdownPreviewStop
nmap <C-p> <Plug>MarkdownPreviewToggle

Commands:

" Start the preview
:MarkdownPreview

" Stop the preview"
:MarkdownPreviewStop

Custom Examples

Table of contents

one of

${toc}
[[toc]]
[toc]
[[_toc_]]

Image Size:

![image](https://user-images.githubusercontent.com/5492542/47603494-28e90000-da1f-11e8-9079-30646e551e7a.gif =400x200)

PlantUML:

@startuml
Bob -> Alice : hello
@enduml

Or

``` plantuml
Bob -> Alice : hello
```

KaTeX:

$\sqrt{3x-1}+(1+x)^2$

$$\begin{array}{c}

\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} &
= \frac{4\pi}{c}\vec{\mathbf{j}}    \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\

\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\

\nabla \cdot \vec{\mathbf{B}} & = 0

\end{array}$$

mermaid:

``` mermaid
gantt
    dateFormat DD-MM-YYY
    axisFormat %m/%y

    title Example
    section example section
    activity :active, 01-02-2019, 03-08-2019
```

js-sequence-diagrams:

``` sequence-diagrams
Andrew->China: Says
Note right of China: China thinks\nabout it
China-->Andrew: How are you?
Andrew->>China: I am good thanks!
```

Flowchart:

``` flowchart
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End|future:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|future

st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
```

dot:

``` dot
digraph G {

  subgraph cluster_0 {
    style=filled;
    color=lightgrey;
    node [style=filled,color=white];
    a0 -> a1 -> a2 -> a3;
    label = "process #1";
  }

  subgraph cluster_1 {
    node [style=filled];
    b0 -> b1 -> b2 -> b3;
    label = "process #2";
    color=blue
  }
  start -> a0;
  start -> b0;
  a1 -> b3;
  b2 -> a3;
  a3 -> a0;
  a3 -> end;
  b3 -> end;

  start [shape=Mdiamond];
  end [shape=Msquare];
}
```

chart:

``` chart
{
  "type": "pie",
  "data": {
    "labels": [
      "Red",
      "Blue",
      "Yellow"
    ],
    "datasets": [
      {
        "data": [
          300,
          50,
          100
        ],
        "backgroundColor": [
          "#FF6384",
          "#36A2EB",
          "#FFCE56"
        ],
        "hoverBackgroundColor": [
          "#FF6384",
          "#36A2EB",
          "#FFCE56"
        ]
      }
    ]
  },
  "options": {}
}
```

FAQ

Why is the synchronised scrolling lagging?

Set updatetime to a small number, for instance: set updatetime=100

WSL 2 issue: Can not open browser when using WSL 2 with terminal Vim.

if you are using Ubuntu you can install xdg-utils using sudo apt-get install -y xdg-utils checkout issue 199 for more detail.

How can I change the dark/light theme?

The default theme is based on your system preferences. There is a button hidden in the header to change the theme. Place your mouse over the header to reveal it.

How can I pass CLI options to the browser, like opening in a new window?

Answer: Add the following to your Neovim init script:

Linux

  function OpenMarkdownPreview (url)
    execute "silent ! firefox --new-window " . a:url
  endfunction
  let g:mkdp_browserfunc = 'OpenMarkdownPreview'

Replace firefox with chrome if you prefer. Both browsers recognize the --new-window option.

macOS

  function OpenMarkdownPreview (url)
    execute "silent ! open -a Firefox -n --args --new-window " . a:url
  endfunction
  let g:mkdp_browserfunc = 'OpenMarkdownPreview'

Replace Firefox with Google\ Chrome or Brave\ Browser if you prefer. They all recognize the --new-window option.

About Vim Support

Vim support is powered by @chemzqm/neovim

References

Buy Me A Coffee ☕️

btc

WeChat and AliPay

markdown-preview.nvim's People

Contributors

aap01 avatar abhinavdhere avatar akinsho avatar alkindi42 avatar avimitin avatar brentyi avatar cabaalexander avatar cnlinbo avatar dependabot[bot] avatar dmitry-ilyashevich avatar evan1533 avatar fundon avatar gregbowyer avatar hydenz avatar iamcco avatar imshakil avatar james-ingold avatar jf-lavoie avatar k33pn3xtlvl avatar kwatmdphd avatar mars90226 avatar mb720 avatar mrliux avatar mzlogin avatar nolleh avatar patreeceeo avatar r4mmer avatar richiware avatar snaptags avatar tonyseek 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  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

markdown-preview.nvim's Issues

没有匹配的自动命令

安装 markdown-preview.nvim 和 mathjax-support-for-mkdp 成功后,打开一个已经写好的 markdown 文件输入 :MarkdownPreview, vim 提示 没有匹配的自动命令。请问这有可能是什么情况造成的?

E475: Invalid argument: Channel id must be a positive integer

Really excited about this plugin - thanks!

I had a successful session but the last two times have run into this error:

Error detected while processing function 304_try_open_preview_page[4]..mkdp#rpc#stop_server:
line 19:
E475: Invalid argument: Channel id must be a positive integer

Environment is NVIM v0.3.4 on macOS inside of a tmux session

I tried kill -9 $(pgrep node) and killed the process, but then restarting but same error.

yarn install not working

Hi, when using vim-plug or by installing by hand, yarn is breaking:
:!cd app & yarn install

Calling shell to execute: "cd app & yarn install"
shell returned 1

I'm using the vim-plug instructions from the README.md.

Thoughts?

Thanks!

Error while running post update hook

The following error is generated when running PlugUpdate/PlugInstall :

Post-update hook for markdown-preview.nvim ... Vim(if):E117: Unknown function: trim

图片路径问题

图片相对路径超过1个层级则无法显示:![issue tracker - view list](../../image/issue-tracker-list-view.png)

image

还有这种绝对路径也无法显示:![](/home/asura/Pictures/520207.jpg)
image

Github Flavoured Markdown

Seems this project doesn't support Github Flavoured Makdown, how about adding Github Flavoured Markdown support?:satisfied:

功能请求:MarkdownPreviewToggle命令

现在需要定义两个快捷键,一个用来运行MarkdownPreview,一个用来运行MarkdownPreviewStop。
希望有一个MarkdownPreviewToggle命令,这样只需要一个快捷键就行了。

Auto close vim using `vim +PlugInstall +qall`

I installed using this commad vim +PlugInstall +qall.
It closed vim automatically after installed plugins.

But It does not close with the following message 😢

!./install.sh v0.0.9 [running]
[markdown-preview.nvim]: install completed

I also checked neovim. neovim is OK.

Info

VIM - Vi IMproved 8.1 (2018 May 18, compiled Mar 6 2019 21:38:32)

config

Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }}

Support for YAML metadata

It would be nice if YAML metadata could be hidden from the preview. Or it could be shown separately without the information on the top.

Synchronization doesn't work well with Goyo

I use Goyo for nice Zen mode, and it creates a new tab to provide that view. This seems to break :MarkdownPreview. Running :MarkdownPriview before entering Goyo, instant refresh stops working once entering Goyo mode, leaving it doesn't bring it back too. It's necessary to :MarkdownPreviewStop/:MarkdownPreview to make it work.

About the configuatio of katex

It seems that katex not support equation environment, and the solution given here not work for markdown-preview when I set it as:

let g:mkdp_preview_options = {
			\ 'katex': {
			\ delimiters: [
			\ {left: "$$", right: "$$", display: true},
			\ {left: "\\(", right: "\\)", display: false},
			\ {left: "\\[", right: "\\]", display: true},
			\ {left: "\\begin{equation}", right: "\\end{equation}", display: true}
			\ ]
 }

I guess the only option support is given in the doc of katex: https://katex.org/docs/options.html. But did there any way to use the delimiters as an option?

YAML metadata can end with `...`

The YAML metadata block can also end with ... instead of ---, but this currently breaks markdown-preview (it stops rendering until you delete the ... line).

No matching autocommands

vim version: 8.1
Plugin management tool: Vundle

~/.vimrc config:
For installation, so far I have tried:
Plugin 'iamcco/markdown-preview.nvim'
Plugin 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown', 'on': 'MarkdownPreview' }
Plugin 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }

Start the preview
:MarkdownPreview

I got

No matching autocommands

Is it because it does not support Vundle?

Error when running :MarkdownPreview using vim

When running :MarkdownPreview I get:

Error detected while processing function mkdp#util#open_preview_page[6]..mkdp#rpc#start_server[2]..<SNR>97_start_vim_node_rpc[4]..mkdp#nvim#rpc#start_server:
line   25:
E475: Invalid argument: env

I followed the nodejs and yarn vim-plug install instructions,

Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }

and the post install ran through Yarn successfully.

Additional details

NodeJS: v8.11.3
Yarn: 1.15.2
Vim: 8.0.550
vim-plug: 0.10.0
markdown-preview.nvim: v0.0.9

Local image not displayed on Firefox

Content of the test.md file:

![image](image.png)

The image.png is in the same folder as the test.md file, but it is not visible in the preview. The link of the img element in the HTML preview is http://127.0.0.1:8568/_local_image_image.png.

However, it works on Chromium.

Ability to remove CJK Brackets (「 」 ) from title output

Hi,

Let me say you've done an awesome job with this! ❤️

Is there any chance you could add an option to not put the 「 」 CJK brackets in the heading of the page? Perhaps there could be an option in vimrc.

I like to save the HTML output. I use a standard 104/105-key PC keyboard and don't have these characters so it's kind of annoying when editing markdown files in the shell and then wanting to open/move etc the HTML files.

Also you should have a Bitcoin donation option 😀.

axisFormat doesn;t work

Command axisFormat in mermaid gantts doesn't work. Maybe you should just update mermaid:

```mermaid
gantt
    dateFormat DD-MM-YYY
    axisFormat %m/%y

    title Example
    section example section
    activity :active, 01-02-2019, 03-08-2019
```

Test it here

在 vim 中使用时与 coc.nvim 有冲突?

Vim version Vi IMproved 8.1. patches 1-1017

  1. modified init.vim
set nocompatible

execute 'set rtp+=' . expand('<sfile>:p:h:h')
set rtp+=/path/to/neoclide/coc.nvim
vim -u init.vim test.md
:MarkdownPreview

执行之后没有任何响应

在 nvim 中是正常的。

No matching autocommands

为什么安装了运行MarkdownPreview显示 “No matching autocommands”?
用的是vim8.1, 通过vim-plug安装。

Do not installed/updated when vim-plug with more options by using Win10 Gvim8.1!

Hi, friends!

This plugin is work well after successfully installed.
" If you don't have nodejs and yarn " use pre build
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }}

But, When I use more options which vim-plug provide, like 'for', 'on', it can not installed/update even I use !
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': 'markdown', 'on': 'MarkdownPreview' }
:PlugUpdate! markdown-preview.nvim

snipaste20190330_205928
snipaste20190330_205928

Then, I test more, I find use the vim command :call mkdp#util#install() can work well !
the install.cmd can successfully run, and the plugin will lazy loading

snipaste20190330_212135
snipaste20190330_212135

Plug 'iamcco/markdown-preview.nvim', { 'do': ':call mkdp#util#install()', 'for': 'markdown', 'on': 'MarkdownPreview' }

I don not know how is work, but I think this is helpful to yours

[Feature request] Support for option in browser command

I really like this plugin! It's great! The only thing that I need more is the support for specifying browser options such as the "chromium --app=%U" for Chromium. As of now, it simply fails if g:mkdp_browser contains spaces, at least in Linux.

A workaround is a simple shell script:

#!/bin/sh
chromium --app=$@

Link to a filename containing spaces

First of all, thank you very much for this great plugin! It is very useful.

Here is a little bug I found regarding links. With this markdown:

* [page](page.md)
* [a page](a page.md)
* [another page](another\ page.md)

I get the following preview:

markdown-preview-nvim

As you can see, the second link is not correctly rendered in the preview. It is due to the space character in the filename specified in parenthesis. If spaces are escaped as the third link, the rendering is correct.

Would it be possible to consider that all characters between parenthesis, including spaces, are part of the filename?

Thank you.

预览同步问题

首先说一下,这个插件的模式才是vimmarkdow预览的正确工作方式。看了很多其他插件,基本都是调用本地浏览器渲染。但是基本上还在vim上折腾的都是服务端的,哪有浏览器调用(即使装了,也没桌面环境啊...)

在Windows的Chrome浏览器打开对应预览地址,预览没有问题,但是编辑位置同步的比较慢,而且Chrome中的预览没有正确定位到文尾,vim中光标已经到文尾了,但是Chrome中没拖到最后。

problem

另外希望在输入:MarkdownPreview后显示出url地址。翻了代码才知道url规则是http://ip:port/page/buffer_number

插件安装错误--Could not load library winpty64.dll

问题描述:
执行call mkdp#util#install()
出现Could not load library winpty64.dll

运行环境:
Windows 10, gVim 8.1 64bit with python and python3 support for 64 bit

我斗胆猜测是因为我的Vim是64位的……

Ability to only preview open folds

Hi,

My use case is that I have a very large markdown file (300,000+ words). Think of it as an entire book in a single file where I have L1 headers as chapters.

I often close all of the folds except for the chapter that I'm actively writing, and Vim is smart enough to only perform a lot of actions on open folds.

It would be amazing if you could add in a feature / option to your plugin so that it only previews open folds. Maybe some type of option like let g:mkdp_preview_closed_folds = 1, which acts exactly how it does now, but when set to 0 then only open folders will be previewed.

katex not rendering

Hi,

I just installed your package. Unfortunately it does not render katex (though it seems to load the scripts).

I saved the result as here.

Error when trying to preview markdown file on Mac

I have installed this nice plugin both on Windows 10 and Mac. On Windows, I can preview Markdown files with MarkdownPreview command without any problem. But on Mac, upon using this command, I get the following error:

Error detected while processing function mkdp#util#open_preview_page:
line    9:
E121: Undefined variable: s:try_open_preview_page
E116: Invalid arguments for function timer_start
E15: Invalid expression: timer_start(1000, s:try_open_preview_page)

I install this plugin via the pre-built file.

Neovim version: 0.3.3 (installed via Homebrew).

Installation instructions insufficient

I installed it through Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' } but when calling :MarkdownPreview, I don't get a new tab nor any errors.

$ nvim --version :

NVIM v0.3.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wconversion -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -Wno-array-bounds -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.3.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +jemalloc +tui

I also don't seem to have the command :MarkdownPreviewStop in console autocomplete.

Implement a :MarkdownExport option

It would be really nice if there was a :MarkdownSave command that would save the HTML file, css/js in the current directory. Ie File > Save Page As... from the web browser.

It would be good if such a command made sure the paths were relative so that the HTML page could be opened and they would be sourced correctly.

It would be good to be able to read the files from a file:/// location.

Might also be worth having an option there to not optimize output (ie remove line feeds from source).

let g:mkdp_browserfunc missing

Hi, i'm using let g:mkdp_browserfunc = 'Dbus_load_url' in my config for markdown-preview.vim and it seems to be missing in this version

Force preview window to be opened in new window

Hi,

I've been reviewing your code to figure out if it would be possible to launch the browser with a new window flag, like Google Chrome's --new-window so that my preview document is always open in its own browser window.

This would be really helpful in multi-desktop workflows where you have your browsing stuff (google, StackOverflow, etc) in one browser instance in one desktop, but want the preview window in the same desktop as the editor.

BTW thanks for your work, this plugin provides the best markdown editing experience for vim so far.

Scroll displays document in incorrect position

Steps to reproduce:

  1. create document in vim which fits in 3/4 of vim window height
  2. open markdown preview
  3. shrink browser window to show vertical scroll bar
  4. scroll to the bottom
  5. edit in vim the last line of file (add another line)

Actual result:

Browser window is scrolled to the top and the newly added content is hidden in browser

Expected result:

The browser window is always scrolled to bottom when editing last line of file

internal url links with spaces do not work on macs

I am using nvim 0.3.1 on a mac and internal url links do not work if they contain a space. This link:

![Close High Crosses](/images/Screenshot%202019.png)
does not work. Filenames that don't contain a space appear to work as expected.

I have also tried:
![Close High Crosses](/images/Screenshot\ 2019.png)
but this does not work either.

Also the link paths have to be relative to the folder that the markdown file is in. Is it possible to use the full path?

Error when running :MarkdownPreview

After installation, I opened a markdown file and ran:

:MarkdownPreview

And I get back two lines of error:

[vim-node-rpc] pre build and node not found!
Pre build and node is not found

Then nothing happens, of course. If I try to run the same command again, I get:

Pre build and node is not found

...every subsequent time.

I am on Mac OS Mojave with MacVim 8.1 (included patches: 1-577). Incidentally, I get the same error message in Vim 8.0 (in the terminal), but I know this plugin is not guaranteed to work with that version anyhow.

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.