99
GitHub - previm/previm: Realtime preview by Vim. (Markdown, reStructuredText, te...
source link: https://github.com/previm/previm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.mkd
Previm
プレビュー用のVimプラグインです。
対応フォーマット
- Markdown
- reStructuredText
- textile
- AsciiDoc
依存
変換のため
Markdownとtextileの場合は必須なものはありません。
reStructuredTextの場合はrst2html.py
が必要です。docutils
をインストールするとrst2html.py
コマンドが使えるようになります。
% pip install docutils
% rst2html.py --version
rst2html.py (Docutils 0.12 [release], Python 2.7.5, on darwin)
プレビューを開くため
必須なものはありません。
open-browser.vimは任意で使用できます。
使い方(Markdownの場合)
- .vimrc にて
g:previm_open_cmd
を定義します- この値はコマンドラインから実行できるコマンドです
- たとえばMacなら
open -a Safari
などです :help g:previm_open_cmd
を参照してください- open-browserを使う場合は設定不要です
filetype
がMarkdownのファイルの編集を開始します- 注意:拡張子が
.md
の場合はmarkdown
ではなくmodula2
として認識されてしまいます。その場合は以下の設定を.vimrcに記述してください
augroup PrevimSettings autocmd! autocmd BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} set filetype=markdown augroup END
- 注意:拡張子が
:PrevimOpen
を実行してブラウザを開きます- 元のVimバッファに戻り編集を続けます
- 変更の度にブラウザの表示内容が更新されます
mermaid
mermaidに対応しています。
```mermaid graph TD; A-->B; A-->C; B-->D; C-->E; ```
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK