0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Zed】マルチカーソルで選択した箇所をまとめて表示する方法

0
Posted at

editor: open selections in multibuffer

マルチカーソルで複数箇所を選択していると、それらが多くの行に分散していることがあります。このとき、コマンドパレットから editor: open selections in multibuffer を実行すると、すべての選択箇所だけを集めたマルチバッファが開きます。

スクロールして一件ずつ確認する必要がなくなり、置換前の内容をまとめてレビューできます。

実際の使い方

  1. editor: select nexteditor: select all matches などで複数の箇所を選択する
  2. コマンドパレット(cmd-shift-p / ctrl-shift-p)を開く
  3. open selections in multibuffer と入力して実行する

すると、選択された箇所だけが数行間隔で並んだマルチバッファが新しいタブで開きます。

キーバインドを設定する

頻繁に使う場合は keymap.json にキーバインドを登録しておくと便利です。

{
  "context": "Editor",
  "bindings": {
    "cmd-alt-m": "editor::OpenSelectionsInMultibuffer"
  }
}

contextEditor に限定しておくことで、エディタ以外での誤作動を防げます。

参考

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?