# インデント

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/ja-jp/help/clion/llms.txt).

インデント設定は、プログラミング言語ごとに個別に構成されます。

CLion はインデント情報を [ステータスバー](guided-tour-around-the-user-interface.html#status-bar) に表示します。 そのため、プロジェクトに種類の異なるファイルがある場合、現在のインデントスタイルを確認し、対応する設定にアクセスする最も簡単な方法は、   インデント   ウィジェットを使用することです。

![インデントウィジェット](https://resources.jetbrains.com/help/img/idea/2026.3/cl_indentation-widget.png)

インデントはプログラミング言語ごとに個別に構成されるため、表示されるインデントの数は開いている項目によって異なる場合があります。 ステータスバーでインデントを表示するには、該当するコードを含むファイルをエディターで開きます。

## インデントスタイルの構成

CLion では、 [コードスタイルスキーム](configuring-code-style.html) または  `[.editorconfig](editorconfig.html)`  ファイルでインデントを構成できます。

> **Note:**
> プロジェクトで EditorConfig を使用できるようにするには、   [.editorconfig](editorconfig.html)   プラグインを有効化します。

コードスタイルスキーム:

Procedure: コードスタイルスキームでインデント設定を開く

1. ウィジェットをクリックし、   C/C++ のインデントを構成   を選択します。

2. In the dialog that opens, you can change settings for tabs and indents and also configure other code style settings.   OK   をクリックします。

3. [整形](reformat-and-rearrange-code.html) して、プロジェクトの必要な部分に新しいインデント設定を適用します。

EditorConfig一ก},{:

Procedure: .editorconfig でインデント設定を開く

[.editorconfig](editorconfig.html) ファイルを介してコードスタイル設定が指定されているファイルには、ウィジェットに ![](https://resources.jetbrains.com/help/img/idea/2026.3/app-client.expui.ide.configFile.svg) アイコンが表示されます。

1. ウィジェットをクリックし、   .editorconfig を開く   を選択します。

IDE は、現在作業しているファイルに影響する最も近い  `.editorconfig`  ファイルを開きます。 使用可能なすべての  `.editorconfig`  ファイルのリストを表示するには、   プロジェクト関連のファイルを表示…   をクリックします。

![インデントウィジェットから開いた EditorConfig メニュー](https://resources.jetbrains.com/help/img/idea/2026.3/editorconfig-widget-menu.png)

2. 変更を行い、 [整形](reformat-and-rearrange-code.html) して、プロジェクトの必要な部分に新しいインデント設定を適用します。

## インデントを自動的に検出

You can configure CLion to detect the indentation style in the current file and use this style instead of the indents specified in the code style settings for a specific language.

Procedure:

1. `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) を押して設定を開き、  `エディター | コードスタイル`  を選択します。

2. 編集に既存のファイルインデントを検出して使用する   チェックボックスを選択します。

3. 変更を適用し、ダイアログを閉じます。

自動インデントを無効化するには、設定に戻ってチェックボックスの選択を解除するか、   インデント   ウィジェットをクリックして   インデント検出の無効化   を選択します。

## エディターにインデントガイドを表示

インデントガイドは、コードのインデントレベルを確認しやすくする薄い垂直線です。 設定でインデントガイドを有効化できます:

Procedure:

1. `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) を押して設定を開き、  `エディター | 一般 | 外観`  を選択します。

2. インデントガイドを表示する   オプションを有効化します。 変更を適用し、ダイアログを閉じます。

その後、インデントレベルを示す垂直線がエディターに表示されます。

## See also

### プロシージャ

[EditorConfig一ก},{](editorconfig.html) [Code style schemes](configuring-code-style.html) [Reformat code](reformat-and-rearrange-code.html)

### リファレンス

[Settings | Code Style](settings-code-style.html)

