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?

VSCodeのCtrl+DとvimのCtrl+Dを共存させる

Last updated at Posted at 2024-09-14

VSCodeのCtrl+D(同じ文字列を複数選択するやつ)もvimのCtrl+D(emacsのC-vみたいな機能)も好きだったので、うまいこと両立できないかなとあれこれしたらとりあえずできたので報告です。

setting.jsonは一番下なので、とにかく設定が欲しい方は下まで行ってください。

どんな挙動?

vscode-vim-setting.gif

解説

  • ノーマルモード
    • Ctrl+U: 上スクロール
    • Ctrl+D: 下スクロール
  • 挿入、ビジュアルモード
    • Ctrl+D: 同じ文字列を選択
    • Ctrl+U: 選択したものを戻す

setting.json

vimプラグインの設定の近くにコピペしてあげてください

"vim.normalModeKeyBindingsNonRecursive": [
		{
			"before": ["<C-d>"],
			"after": ["<C-d>"]
		}
	],
	"vim.insertModeKeyBindings": [
		{
			"before": ["<C-d>"],
			"commands": ["editor.action.addSelectionToNextFindMatch"]
		},
		{
			"before": ["<C-u>"],
			"commands": ["cursorUndo"]
		}
	],
	"vim.visualModeKeyBindingsNonRecursive": [
		{
			"before": ["<C-d>"],
			"commands": ["editor.action.addSelectionToNextFindMatch"]
		},
		{
			"before": ["<C-u>"],
			"commands": ["cursorUndo"]
		}
	],

参考サイト

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?