• This repository has been archived on 06/Feb/2020
  • Stars
    star
    793
  • Rank 57,419 (Top 2 %)
  • Language
    CSS
  • Created about 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

⚠️ PLEASE USE https://github.com/iamcco/markdown-preview.nvim INSTEAD

Introduction

Join the chat at https://gitter.im/iamcco/markdown-preview.vim

中文

Using the markdown-preview.vim plugin, you can preview Markdown in real-time with a web browser.

This plugin needs your Vim to support Python 2 / Python 3 features. Tested on Windows / Ubuntu 14 / Mac OS X.

Note: PLEASE USE markdown-preview.nvim INSTEAD

Screenshots

Markdown preview

screenshot

Typeset math

screenshot

Installation

With vim-plug:

Add Plug 'iamcco/markdown-preview.vim' to the vimrc or init.vim file and type :PlugInstall.

Or with MathJax support for typesetting math:

Plug 'iamcco/mathjax-support-for-mkdp'
Plug 'iamcco/markdown-preview.vim'

Usage

Command:

    MarkdownPreview
    " Open preview window in markdown buffer

    MarkdownPreviewStop
    " Close the preview window and server

When MarkdownPreview command can't open the preview window, you can use the MarkdownPreviewStop command before using MarkdownPreview command.

Default Setting:

    let g:mkdp_path_to_chrome = ""
    " Path to the chrome or the command to open chrome (or other modern browsers).
    " If set, g:mkdp_browserfunc would be ignored.

    let g:mkdp_browserfunc = 'MKDP_browserfunc_default'
    " Callback Vim function to open browser, the only parameter is the url to open.

    let g:mkdp_auto_start = 0
    " Set to 1, Vim will open the preview window on entering the Markdown
    " buffer.

    let g:mkdp_auto_open = 0
    " Set to 1, Vim will automatically open the preview window when you edit a
    " Markdown file.

    let g:mkdp_auto_close = 1
    " Set to 1, Vim will automatically close the current preview window when
    " switching from one Markdown buffer to another.

    let g:mkdp_refresh_slow = 0
    " Set to 1, Vim will just refresh Markdown when saving the buffer or
    " leaving from insert mode. With default 0, it will automatically refresh
    " Markdown as you edit or move the cursor.

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

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

Key Mapping:

By default this plugin has no mapping: if you want to have your own mappings, you can map the keys to <Plug>MarkdownPreview for opening the Markdown preview window and map keys to <Plug>StopMarkdownPreview for closing the preview window.

Examples for mapping the F8 key to open Markdown preview window and F9 key to close preview window:

" for normal mode
nmap <silent> <F8> <Plug>MarkdownPreview
" for insert mode
imap <silent> <F8> <Plug>MarkdownPreview
" for normal mode
nmap <silent> <F9> <Plug>StopMarkdownPreview
" for insert mode
imap <silent> <F9> <Plug>StopMarkdownPreview

For OS X users, you can set the g:mkdp_path_to_chrome as below (if you use Chrome):

let g:mkdp_path_to_chrome = "open -a Google\\ Chrome"
" or
let g:mkdp_path_to_chrome = "/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome"

See issue #1 for details.

FAQ

Q: The Firefox preview window didn't close when leaving the Markdown file in Vim.

A: If you want the plugin to auto-close the preview window in Firefox, you have to do some configuration:

  1. Open Firefox.
  2. Type about:config in the address bar and press the Enter key.
  3. Search for dom.allow_scripts_to_close_windows and set its value to true.

You have to know what will happen when you make the above changes.

Changelog

  • 2017/07/16: Add g:mkdp_open_to_the_world option.
  • 2016/11/19: MathJax support with mathjax-support-for-mkdp plugin.
  • 2016/08/28: Set the title of preview page with filename.
  • 2016/05/18: Support key mapping and new g:mkdp_command_for_global option item.
  • 2016/03/12: New Github-like Markdown styles markdown.css and support task list.
  • 2016/01/24: Support to display the local picture in Markdown.

Buy Me A Coffee ☕️

image

More Repositories

1

markdown-preview.nvim

markdown preview plugin for (neo)vim
JavaScript
6,530
star
2

vim-language-server

VImScript language server, LSP for vim script
JavaScript
496
star
3

coc-flutter

flutter support for (Neo)vim
TypeScript
472
star
4

diagnostic-languageserver

diagnostic language server integrate with linters
TypeScript
410
star
5

coc-tailwindcss

tailwindcss class name completion for (neo)vim
TypeScript
333
star
6

coc-spell-checker

A basic spell checker that works well with camelCase code for (Neo)vim
TypeScript
263
star
7

coc-diagnostic

diagnostic-languageserver extension for coc.nvim
TypeScript
246
star
8

coc-vimlsp

viml language server
TypeScript
211
star
9

coc-angular

Angular Language Service coc extension for (neo)vim
TypeScript
145
star
10

ds-pinyin-lsp

Dead Simple Pinyin Language Server
Rust
114
star
11

coc-actions

Actions menu for Neovim
TypeScript
102
star
12

coc-rainbow-fart

🌈 rainbow-fart for (neo)vim 一个在你编程时疯狂称赞你的 coc.nvim 扩展插件 | An coc.nvim extension that keeps giving you compliment while you are coding, it will checks the keywords of code to play suitable sounds.
TypeScript
84
star
13

dict.vim

vim简单的翻译工具
Python
74
star
14

markdown.css

markdown styles
CSS
60
star
15

coc-post

post extension for coc.nvim
TypeScript
55
star
16

dotfiles

my dotfiles
Vim Script
52
star
17

git-p.nvim

Git plus for (neo)vim
JavaScript
38
star
18

clock.nvim

A Big Clock For Neovim
JavaScript
33
star
19

coc-leetcode

leetcode 扩展
TypeScript
33
star
20

coc-svg

A Powerful SVG Language Support coc Extension for (neo)vim
TypeScript
31
star
21

async-await.lua

Write async function more like javascript async/await
Lua
28
star
22

coc-zi

look or google 10000 english for (neo)vim
TypeScript
28
star
23

coc-cspell-dicts

Ext spell dictionary extension for coc-spell-checker
TypeScript
21
star
24

coc-gitignore

gitignore extension for coc.nvim
TypeScript
20
star
25

mathjax-support-for-mkdp

mathjax support for markdown-preview.vim plugin
JavaScript
19
star
26

coc-project

project extension for coc.nvim
TypeScript
18
star
27

bg.workflow

追番,alfred3 workflow 查看每日新番
Python
10
star
28

Bencode

解析torrent文件
Python
9
star
29

coc-clock

clock for neovim
TypeScript
8
star
30

coc-webpack

Autocomplete support for webpack config
TypeScript
7
star
31

htom

convert html to markdown
JavaScript
4
star
32

iamcco.github.io

Too young Too simple Sometimes naive
HTML
3
star
33

manga-download

漫画下载
Python
3
star
34

sran.nvim

simple request and notification call for (neo)vim
JavaScript
3
star
35

denite-source.vim

denite source of denite sources
Python
3
star
36

gh-pages-webpack-plugin

gh-pages plugin for webpack
JavaScript
3
star
37

file-manager.vim

Denite source for file management
Python
3
star
38

statusline.vim

Vim Script
3
star
39

smartIM.nvim

smart IM for neovim
Python
2
star
40

yuuko

An hexo theme inspire by Time axis of Qzone
CSS
2
star
41

coc-bootstrap-classname

JavaScript
2
star
42

buzuo.vim

😱 buzuo(不做)list for vim/neovim
Vim Script
2
star
43

HomePage

My home page
JavaScript
2
star
44

next-theme

refind next theme dark
2
star
45

gitignore.vim

denite source for gitignore
Python
2
star
46

rxjs-operators

rxjs 操作符补完计划
TypeScript
2
star
47

go-to-file.vim

go to the file from require or import
Vim Script
2
star
48

md-it-mermaid

markdown-it plugin for mermaid
JavaScript
1
star
49

coc-action-source.nvim

CocAction source of coc.nvim
Python
1
star
50

nichijou

yuuko mio mai hakase nano sakamoto no monogatari
1
star
51

git-blame.vim

git blame
Vim Script
1
star
52

vimrc.backup

vimrc配置/字体等备份
Vim Script
1
star
53

BEND

JavaScript
1
star
54

exec-frequent

exec function frequent
JavaScript
1
star
55

redux-async-combine-reducers

Asynchronous add reducers
JavaScript
1
star
56

RotateGame

JavaScript
1
star
57

react-error-codes.vim

Denite sources for react error codes
Python
1
star
58

hello-dt

Using DevTerm as a print server
TypeScript
1
star
59

fzf-source.vim

denite source of fzf source for (neo)vim
Python
1
star
60

.github

1
star
61

float2

move the dot of float
JavaScript
1
star
62

rxh

RxJS hook for React with no magic
JavaScript
1
star
63

save-cloud-vita

PSVita 游戏存档云备份工具!
Rust
1
star