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?

Cursorで「Cmd + クリック」を使って定義先へ移動する設定方法

Posted at

Cursorではデフォルトの設定と異なり、多くのIDEのように「Cmd(またはCtrl)+クリック」で定義先へジャンプできるよう設定を変更できます。

この記事では、Cursorのキーボードショートカット設定(keybindings.json)を編集して、Cmd + クリックで定義先へジャンプする方法を紹介します。

設定方法

手順1: keybindings.jsonを開く

  • Cursorを起動します。
  • コマンドパレットを開きます(Cmd + Shift + P)。
  • 「Preferences: Open Keyboard Shortcuts (JSON)」を選択します。

手順2: ショートカット設定を追加する

開いたkeybindings.jsonファイルに、以下の設定を追加します。

[
  {
    "key": "cmd+click",
    "command": "goToNextReference",
    "when": "inReferenceSearchEditor || referenceSearchVisible"
  },
  {
    "key": "f12",
    "command": "-goToNextReference",
    "when": "inReferenceSearchEditor || referenceSearchVisible"
  }
]
  • 1つ目の設定: cmd+clickで定義先にジャンプする動作を有効化します。
  • 2つ目の設定: デフォルトのF12の割り当てを解除します(任意)。

手順3: 設定を保存して確認

  • 設定ファイルを保存します。
  • エディタ上で定義先へ移動したい変数や関数などにカーソルを合わせ、「Cmd + クリック」します。
  • 定義先へジャンプすることを確認します。
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?