LoginSignup
4
5

More than 5 years have passed since last update.

[VSCode]markdownでplantumlを表示した時にplantuml内でスニペットを挿入できるようにする

Last updated at Posted at 2019-01-10

概要

markdownでplantumlを記述したいときがあって、その際に.puで作成した時に使用できていたスニペットが使えなかったので、
自前でスニペットを用意して代用してみた。

.pu
2019-01-10_23h54_52.png

.md
2019-01-10_23h57_27.png

やること

「ファイル」→「基本設定」→「ユーザースニペット」を選択。
入力画面が出るのでjavascriptを検索してjavascript.jsonを探す。

2019-01-11_00h06_30.png

なんでjavascriptなのかというと、インテリセンスで表示した時にjavascriptと書いてあったので。
2019-01-10_23h44_54.png

javascript.jsonが出てきたら最後の行に好きなスニペットを追加する。
適当に継承のスニペットを作ってみる。

参考
独自のスニペットを作成

javascript.json
{
"create Inheritance" : {
        "prefix": "inheritance",
        "body": [
            "${1:base} <|-- ${2:derivation}",
            ],
        "description": "継承"
    },
}

定義したら保存し、再度mdファイルのplantumlの中でインテリセンスを出して自前で作ったスニペットが出てきたら成功。
2019-01-10_23h58_52.png

2019-01-10_23h59_09.png

欠点

vscodeでjsファイルを編集しようとしたときにも先程作った自前のスニペットが出てしまうので、よくjavascriptを使う人は注意。

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5