LoginSignup
8
7

More than 5 years have passed since last update.

VSCodeでCtrl+Shift+A(orE)で行頭・行末までのテキスト選択を有効化する

Posted at

SublimeTextで効いていた以下の操作を有効化するためのキー設定。
個人的に無いと不便かつ毎回設定を忘れるのでメモ。

  • Ctrl+Shift+A : 現在のカーソル位置から行頭まで選択
  • Ctrl+Shift+E : 現在のカーソル位置から行末まで選択

以下はついでに入れておいた

  • Ctrl+Shift+→ : 現在のカーソル位置から次の単語の先頭まで選択/選択解除
  • Ctrl+Shift+← : 現在のカーソル位置から前の単語の末尾まで選択/選択解除

手順

  1. cmd+K→cmd+Sでkeybinding.jsonを開く
  2. 以下をユーザ設定側に追加
[{
  "key": "ctrl+shift+a",
  "command": "cursorHomeSelect",
  "when": "editorTextFocus"
}, {
  "key": "ctrl+shift+e",
  "command": "cursorEndSelect",
  "when": "editorTextFocus"
}, {
  "key": "ctrl+shift+left",
  "command": "cursorWordStartLeftSelect",
  "when": "editorTextFocus"
}, {
  "key": "ctrl+shift+right",
  "command": "cursorWordEndRightSelect",
  "when": "editorTextFocus"
}]
8
7
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
8
7