[[VSCode Neovim]]を使って[[VSCode]]で `init.lua` を読み込んだときだけ、[[lazy.nvim]]の特定プラグイン読み込みをしない設定。`cond` を指定する。
> Behaves the same as enabled, but won't uninstall the plugin when the condition is false. Useful to disable some plugins in vscode, or firenvim for example.
## やり方
[[lazy.nvim]]のセットアップ時に `cond` のデフォルト値を
- [[VSCode]]の場合は `false`
- それ以外の場合は `true`
とする。
```lua
require("lazy").setup({
spec = {
{ import = "plugins" },
},
diff = { cmd = "terminal_git" },
change_detection = {
notify = false,
},
defaults = {
-- ★これを追加
cond = function()
return not vim.g.vscode
end,
},
})
```
その後、[[VSCode]]でも有効にしたいプラグインの設定で `cond = true` を上書きするように指定すればよい。
```lua
return {
"rapan931/lasterisk.nvim",
cond = true,
}
```