Skip to content

sweichwald/vim2pmpm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

130 Commits
 
 
 
 
 
 

Repository files navigation

vim2pmpm: markdown preview for vim using pmpm

Forked from suan/vim-instant-markdown on 2020-04-30; original copyright and license notices are preserved in LICENSE and the same Apache License 2.0 applies to this repository; all changes are documented.


Trims down the original by a) removing unused functionality and configuration parameters and b) dropping support for and reference to the Node.js markdown preview server in favour of pmpm that supports Pandoc's Markdown.


vim2pmpm: markdown preview for vim using pmpm

Pipes to pmpm, which serves an html preview of the active buffer's markdown.

Installation

  • Install pmpm

  • For vim-plug, add the following to your .vimrc:

    Plug 'sweichwald/vim2pmpm', {'for': 'markdown'}
    filetype plugin on
  • Configuration (defaults shown below):

    "let g:pmpm_slow = 0
    "let g:pmpm_autostart = 1
    "let g:pmpm_autostop = 0
    "let g:pmpm_port = 9877

Configuration

g:pmpm_slow

By default, vim2pmpm will update the display frequently. If that taxes your system too much, you can specify

let g:pmpm_slow = 1

before loading the plugin (for example place that in your ~/.vimrc). This will cause vim2pmpm to only refresh on the following events:

  • No keys have been pressed for a while
  • A while after you leave insert mode
  • You save the file being edited

g:pmpm_autostart / -stop

By default, vim2pmpm will automatically launch (and not automatically close) the preview server when you open (or close, respectively) a markdown file. If you want to manually control this behavior, you can specify

let g:pmpm_autostart = 0
let g:pmpm_autostop = 1

in your .vimrc. You can always manually trigger preview via the command :PMPMStart and stop it via :PMPMStop.

g:pmpm_port

Choose a custom port for the pmpm websocket server instead of the default 9877.

let g:pmpm_port = 9877

About

Preview Pandoc Markdown in the browser while editing in vim

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Vim Script 100.0%