LoginSignup
59
46

More than 5 years have passed since last update.

【VSCode】エディタ、サイドバー、ターミナル間のフォーカスのショートカットを設定する

Posted at

これまでエディタやターミナル間の切り替えをクリックで行っていたのですが、少しストレスに感じていました。そこで、キーバインドを設定してみたところかなり快適になったのでご紹介します。

今回設定したものはこちらです。僕はVimmerなのでVimっぽいショートカットにしました。

キーバインド 動作
Ctl + h エディタ→サイドバー
Ctl + j エディタ→ターミナル
Ctl + l サイドバー→エディタ
Ctl + k ターミナル→エディタ

環境

  • Visual Studio Code 1.27.2
  • macOS Sierra

手順

Code > Preferences > Keyboard Shortcutsをクリック

Screen Shot 2018-09-27 at 10.27.50.png

「keybindings.json」をクリックして設定ファイルを開きます

Screen Shot 2018-09-27 at 10.04.39.png

このように設定します。「key」はお好みで設定してみてください。

keybindings.json
[
  {
    "key": "ctrl+h",
    "command": "workbench.action.focusSideBar",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+j",
    "command": "workbench.action.terminal.focus",
    "when": "editorTextFocus"
  },
  {
    "key": "ctrl+l",
    "command": "workbench.action.focusFirstEditorGroup",
    "when": "filesExplorerFocus"
  },
  {
      "key": "ctrl+k",
      "command": "workbench.action.focusFirstEditorGroup",
      "when": "terminalFocus"
  }
]

よいVSCodeライフを!

参考にさせていただいた記事
https://qiita.com/rai_suta/items/05e69f0b9065989b19c1

59
46
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
59
46