1
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】file_scan_exclusionsでデフォルトの除外設定を維持したまま追加する方法

1
Posted at

Zed Preview 1.17.0から、file_scan_exclusions に "..." を指定することで、デフォルトの除外設定を維持したまま独自の除外パターンを追加できるようになりました。

設定方法

例えば、Zedのデフォルト設定に加えて node_modules を除外したい場合は、settings.json に次のように設定します。

{
  "file_scan_exclusions": [
    "**/node_modules",
    "..."
  ]
}

"..." の位置に既存の file_scan_exclusions が展開されるため、Zed標準の除外設定を維持したまま node_modules を追加できます。

従来との違い

以前は次のように設定すると、

{
  "file_scan_exclusions": [
    "**/node_modules"
  ]
}

Zedのデフォルトの除外設定を置き換えてしまうため、標準で除外されている .git や .DS_Store なども必要に応じて自分で記述する必要がありました。

Preview 1.17.0以降では、次のように "..." を追加するだけで既存設定を継承できます。

{
  "file_scan_exclusions": [
    "**/node_modules",
    "..."
  ]
}

なお、"..." を記述しなければ従来どおり既存の設定を置き換えます。

プロジェクト単位でも利用できる

プロジェクトの .zed/settings.json でも同じ記法を利用できます。

{
  "file_scan_exclusions": [
    "**/tmp",
    "..."
  ]
}

この場合、"..." にはユーザー設定まで適用した現在の file_scan_exclusions が引き継がれるため、ユーザー設定を維持しながらプロジェクト固有の除外パターンを追加できます。

参考

1
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
1
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?