LoginSignup
0
0

More than 3 years have passed since last update.

VS Code terminal で Ctrl + P などの shortcut 操作を快適にする

Posted at

VS Code の terminal は言うまでもなく非常に便利ですが、標準設定では Ctrl + p などの shortcut を使うと、VS Code 側での shortcut が機能してしまい、不便すぎます。
以下のように設定することで、特定の shortcut を terminal 側で優先できるようになります。

1. 設定を開く

VS Code Command Palette を開き (Windows/Linux の場合 Shift + Ctrl + p)、Keyboard Shortcuts の設定を開く。(図にあるように Ctrl + k -> Ctrl + s でも可)
image.png
(念の為、macOS では ⌘ + Shift + p です)

2. 特定する

shortcut list が表示されたら、上部の検索窓で terminal での動作を優先したい shortcut を探す。以下の例では Ctrl + e を見つけています。
image.png
(Ctrl + e は shell で入力の末尾に飛ぶ shortcut で、よく使いますよね)

3. 設定する

目的の shortcut の context menu (右クリックメニュー) を開き、"When Expression" を編集する。ここに "terminal にいるときは無視する" ための合言葉 "!terminalFocus" を入力します。
image.png

4. 試す

terminal に行き、設定した shortcut を押して、VS Code に focus が移らなくなっていることを確認します。

以上です。

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