🐙

[まとめ] Cursor Settings

2025/01/30に公開

はじめに

今更ですが、Cursorで開発し始めました。
Cursor Settingsを眺めていたところ分からない項目が多かったので、設定項目についてまとめてみました。

バージョン情報

Version: 0.45.5
VSCode Version: 1.96.2
Commit: e599ee6d2218c8b6fef45980f8cc964bacc0caa0
Date: 2025-01-28T22:23:41.566Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.19045

なお、Cursorは Hobby - Free プランでの利用になります。

Cursor Settings 全体像

Cursor Settings
├ General
│  ├ Account
│  ├ Rules for AI
│  ├ Project Rules
│  ├ Editor
│  └ Privacy mode
├ Models
│  ├ Model Names
│  ├ OpenAI API Key
│  ├ Anthropic API Key
│  ├ Google API Key
│  └ Azure API Key
├ Features
│  ├ Cursor Tab
│  ├ Chat & Composer
│  ├ Codebase Indexing
│  ├ Docs
│  ├ Editor
│  └ Terminal
└ Beta
   └ Beta features

General

Account

Account

ログインしているユーザのアカウントが表示されます。
Manage でCursorのアカウントページが開き、現在の使用状況を確認できます。

VS Code Import

Instantly use all of your extensions, settings and keybindings
すべての拡張機能、設定、キーバインドをVSCodeからインポートできる機能のようです。
Import をクリックすると、本当に実行するかの確認メッセージが表示されます。

Rules for AI

https://docs.cursor.com/context/rules-for-ai

Rules for AI

These rules get shown to the AI on all chats and Ctrl+K sessions.
Cursorに搭載されているAIアシスタントの振る舞いを調整するための設定機能です。

どのようなルールを定めたらよいかは、下記のサイトに有志の方々が投稿してくださっています。

https://cursor.directory/

私は下記の記事を参考にさせていただき、設定しています。

https://qiita.com/tichise/items/751d7a6c01a4d74b766c

Include .cursorrules file

If off, we will not include any .cursorrules files in your Rules for AI.
オフにすると、Rules for AIに .cursorrules ファイルで定義されている項目が含まれなくなります。

公式ドキュメントに従えば、プロジェクト固有の設定については、プロジェクトルートに .cursorruls ファイルを配置し、そこで指示出しをするのが良いみたいですね。

まとめると、次のような違いがあります。

項目 Rules for AI .cursorrules
対象範囲 ユーザ個人 プロジェクト
設定 Cursor リポジトリルート

Project Rules

Project-specific rules that help the AI understand your codebase and follow your project's conversations. They can be automatically included or fetched by an agent. These are synced with your codebase.

プロジェクト内タスクを自動化し、プロンプトを設定して効率よく作業を進められるようになる設定。

+ Add new rule をクリックし、ファイル名を入力すると、.cursor/rules/{file_name}.mdc が生成されます。

大きく3つの設定項目があります。

  • Description: ルールの概要を記述
  • Globs: 対象ファイルを正規表現で指定
  • Rule: 実行処理を記述

Editor

VSCodeの設定とキーボードショートカットなどへのリンクがまとめられています。

Privacy mode

If on, none of your code will be stored by us. If off, we may save prompts and collect telemetry data to improve Cursor.

いわゆるオプトアウトの設定になります。
設定を有効にすることで、コードが保存またはトレーニングされることはなくなります。企業で使用する場合はほぼ必須項目ですね。

https://www.cursor.com/privacy

Models

https://docs.cursor.com/advanced/models

https://docs.cursor.com/advanced/api-keys

Model Names

Add new models to Cursor, Often used to configure the latest OpenAI models or OpenRouter models.

ここで選択されている項目をCursorが使用できるようになります。
記載のないモデルを使用したい場合は、 + Add model から追加できる。正確なモデル名を入力する必要があることに注意。
モデル名はOpenRouterのドキュメントに記載があるものであれば使えるはず。使えないものもあるかもしれません。

https://openrouter.ai/models

OpenAI API Key

Cursorではなく独自のOpenAI APIキーを使用したい場合に設定します。
OpenRouterを使用したい場合は、OpenRouterのAPI Keyを入力し、Base URLにOpenRouterのBase URL

https://openrouter.ai/api/v1

を入力すればOKです。

Anthropic API Key

同様に、独自のAnthropic APIキーを使用したい場合に設定します。

Google API Key

同様に、独自のGoogle AI Studio APIキーを使用したい場合に設定します。

Azure API Key

OpenAI APIを利用する代わりに、Azure APIを利用する場合に設定します。

Features

Cursor Tab

https://docs.cursor.com/tab/overview

Cursor Tab

A powerful Copilot replacement that can suggest changes across multiple lines. Previously called Copilot++.

強力なコード補完機能です。

  • 追加のコードの挿入だけでなく、カーソルの周囲の編集を提案
  • 複数行を一度に変更
  • 最近の変更とリンターエラーに基づいて提案

Freeユーザは2,000件の提案まで、ProとBusinessユーザは無制限に使用できるみたいですね。

Partial accepts

Accept the next word of a suggestion via Ctrl + RightArrow

Ctrl + → で部分的に補完の提案を受け入れることができます。

例えば上記のような補完があるとき、Tab キーを押すと全ての補完の提案を受け入れることになります。
この設定を有効化し Ctrl + → を押すと部分的に受け入れられるので、途中までは受け入れたいけど後半は要らない時などに便利です。

Cursor Prediction

Predicts the next line you will move to. Allows you to tab-tab-tab throught edits

補完を受け入れた後に Tab キーを押すと、次に移動する行を予測してくれます。

Suggestions in Comments

Enable or disable Cursor Tab suggestions in comments

コメント内で提案をしてもらうかどうかの設定です。

Show whitespace only changes

Show whitespace only Cursor Tab suggestions

空白のみの変更を含む提案を表示するかどうかの設定です。

Auto Import

Tab to import necessary modules with Cursor Tab. Only supports TypeScript

必要なモジュールをタブ操作でインポートできる設定です。TypeScriptにのみ対応しているとのこと。

Auto Import for Python (BETA)

Enable auto import for Python. This is a beta feature.

同様に、必要なモジュールをタブ操作でインポートできる設定です。Pythonはベータ版とのこと。

Chat & Composer

https://docs.cursor.com/chat/overview

https://docs.cursor.com/composer/overview

ChatとComposerについての解説は行いません。

Auto-scroll to bottom

Automatically scroll to the bottom of the composer pane when a new message is generated

新しいメッセージが生成されると、パネルの一番下まで自動的にスクロールします。

Auto-apply to files outside context

Allow the composer to auto-apply changes to files outside the current context

現在のコンテキスト外のファイルにも変更を自動的に適用することを許可します。

Enable yolo mode

Allow agent composers to run tools without asking for confirmation, such as executing commands and writing to files

確認なしでツールを実行するなど、エージェントが自由に動作できるようにします。
有効化すると、追加の設定項目が表示されます。

Yolo prompt
使用しているモデルが判断する範囲で、自動的に実行されるべきコマンドの説明

Command allowlist
実行可能なコマンド

Command denylist
絶対に実行されてはならないコマンド

Delete file protection
有効にすると、エージェントがファイルを自動的に削除することを防げる

各種コマンドが自動的に実行されることから、導入には慎重な判断が求められそうです。

Large context

When enabled, Composer / Agent use longer context windows. This may use more fast requests.

コンポーザー/エージェンが長いコンテクストを扱えるようにします。

Collapse input box pills in pane or editor

Collapse pills in the composer pane or editor input box to save space

コンポーザーパネルやエディターの入力ボックス内のピルを折りたたんでスペースを節約します。

Render pills instead of blocks

Collapse composer code blocks into pills instead of rendering as code blocks

コンポーザーパネル内のコードブロックを折りたたみ、ピルとして表示します。

Agent composer iterate on lints

If enabled, agent composers will iterate on linter errors to fix them automatically

有効にすると、エージェントがリントエラーに対して自動的に修正を試みます。

Auto context (BETA)

Automatically include relevant codebase context for composer

リントエラーがある場合、通常のコンポーザーも修正を試みます。

Review changes (BETA)

List and group changes made in a composer session with an LLM for you to review

コンポーザーに関するコードベースのコンテキストを自動的に含めます。

Codebase Indexing

https://docs.cursor.com/context/codebase-indexing

Codebase Indexing

Embeddings improve your codebase-side answers. Embeddings and metadata are stored in the cloud, but all code is stored locally.

埋め込みを行い、コードベース全体の回答精度を向上させます。
埋め込みとメタデータはクラウドに保存され、コード自体はローカルに保存されます。

https://www.cursor.com/security#codebase-indexing

埋め込みの保存先は Turbopuffer とのこと。

https://turbopuffer.com/

Index new folders by default

When set to true, Cursor will by default index any new folders opened. If turned off, you can still manually index folders by clicking the "Compute Index" button. Folders with more than 10,000 files will not be auto-indexed.

自動的に新しく開いたフォルダにインデックスを作成するかどうかの設定です。

Ignore files

Configure the files that Cursor will ignore when indexing your repository (in addition to your .gitignore)

Cursorがリポジトリのインデックスを作成する際に無視するファイルを設定できます。

Git graph file relationships

When enabled, Cursor will index your git history to help understand which files are related to each other. Code and commit messages are stored locally, but metadata about commits (SHAs, number of changes, and obfuscated file names) are stored on the server.

有効にすると、Cursorはgit履歴のインデックスを作成し、どのファイルが互いに関連しているかを理解しやすくします。
コードとコミットメッセージはローカルに保存されますが、コミットに関するメタデータはサーバに保存されます。

Docs

Manage the custom docs that you've added.
カスタムドキュメントを追加できます。URL形式である必要があります。
ここで追加したドキュメントに対してCursorはクローリングを行い、インデックスを作成するみたいです。

例えば、langgraphのドキュメントを追加したい場合、次のような流れになります。

ドキュメントが追加されていることが確認できます。
これを、Chat & Composerで渡すことができるので、RAGのような感じで使えますね。

https://docs.cursor.com/context/@-symbols/@-docs

Editor

Show chat/edit tooltip

Show a chat/edit tooltip near highlighted code in the editor

エディター内でハイライトされたコードの近くにチャット/編集ツールチップを表示します。

Automatically parse links when pasted into ^/⌘ + K input

^/⌘ + K で貼り付けられたリンクを自動的に解析します。

Auto select for Ctrl/⌘ + K

Automatically select regions for inline code editing

インラインコード編集用に領域を自動選択します。

Use themed diff backgrounds

Use themed background colors for inline diffs

インライン差分にテーマ背景色を使用します。

Use character-level diffs

Use character-level diffs for inline diffs

インライン差分に文字単位の差分を使用します。

Terminal

Terminal hint

Show the hint text at the bottom of the terminal

ターミナルの下部にヒントテキストを表示します。

Show terminal hover hint

Show hints like 'Add to chat' in the terminal

ターミナルで「Add to chat」などのヒントを表示します。

Use preview box for terminal Ctrl + K

If tuned off, responses are streamed directly into the shell

無効にすると、応答が直接シェルにストリーミングされます。

Beta

Beta features

Notepads

Craft and share context between chat and composers
メモ帳を使用して、チャットとコンポーザー間でコンテクストを共有するか否かの設定

Explorerに NOTEPADS という欄があるので、そこから追加する。

一般的な使用例:

  1. 動的な定型文生成
  • 一般的なコードパターンのテンプレートを作成する
  • プロジェクト固有のスキャフォールディングルールを保存する
  • チーム全体で一貫したコード構造を維持する
  1. アーキテクチャドキュメント
  • フロントエンド仕様
  • バックエンド設計パターン
  • データモデルのドキュメント
  • システムアーキテクチャガイドライン
  1. 開発ガイドライン
  • コーディング標準
  • プロジェクト固有のルール
  • ベストプラクティス
  • チームコンベンション

以下のことは書かないようにした方が良い:

  • 一時的なメモや下書き
  • バージョン管理(git など)に属する情報
  • 機密データまたは認証情報
  • 頻繁に変更される不安定な情報

https://docs.cursor.com/features/beta/notepads

Bug Finder

Run a bug finder on your current git diff to find bugs.
バグを見つけてくれるようだが、公式ドキュメントが見当たらず。

下記のフォーラムによれば、これは実験的なものであり、コードベースの変更業をすべて調べてバグを探すので高価になるとのこと。

https://forum.cursor.com/t/bug-finder-how-is-it-paid/29974

おわりに

十分に検証できていない項目が多いですが、使用する過程でアップデートを加えていければ。
Cursorを使用して開発されている皆様の参考になれば幸いです。

記載内容に誤りがないように心掛けていますが、誤りを見つけた場合はご指摘くださいませ。

Discussion