124

GitHub - kannokanno/previm: Realtime preview by Vim. (Markdown, reStructuredText...

 6 years ago
source link: https://github.com/kannokanno/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 in English

Previm

プレビュー用のVimプラグインです。

previm

対応フォーマット

変換のため

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の場合)

  1. .vimrc にて g:previm_open_cmd を定義します
    • この値はコマンドラインから実行できるコマンドです
    • たとえばMacなら open -a Safari などです
    • :help g:previm_open_cmd を参照してください
    • open-browserを使う場合は設定不要です
  2. filetype がMarkdownのファイルの編集を開始します
  3. :PrevimOpen を実行してブラウザを開きます
  4. 元のVimバッファに戻り編集を続けます
  5. 変更の度にブラウザの表示内容が更新されます

Safari13.0.3ではブラウザが「Loading...」のままで止まってしまうことが報告されています

previmを動作させるために以下の設定をしてください

  1. メニューバーの Safari > 環境設定 > 詳細 > メニューバーに"開発"メニューを表示にチェック
  2. メニューバーの 開発 > ローカルファイルの制限を無効にする を選択

mermaid

mermaidに対応しています。

```mermaid
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->E;
```

previm

PlantUML

PlantUML に対応しています。

```plantuml
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: another authentication Response
@enduml
```

PlantUML preview

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK