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?

【VSCode】VSCodeVimでカーソル移動した際に折りたたみが展開されないようにする

Last updated at Posted at 2024-06-07

状況

カーソルを j, kで移動させ、折りたたみを通過した際に以下のように展開されてしまいました。

画面収録 2024-06-07 23.46.13.gif

対処法

settins.jsonに以下の設定を追記します。

settings.json
{
  "vim.foldfix": true,
  "vim.normalModeKeyBindingsNonRecursive": [
    {
      "before": ["<C-u>"],
      "after": ["H", "z", "z"]
    },
    {
      "before": ["<C-d>"],
      "after": ["L", "z", "z"]
    }
  ]
}

"vim.foldfix": true, だけでは <C-d><C-u> でスクロールした際に展開されてしまうため、 "vim.normalModeKeyBindingsNonRecursive" も合わせて設定する必要があります。

参考

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?