# Git とのテキストエディタの関連付け

テキストエディタを使って Git でファイルを開いたり編集したりしてください。

## Visual Studio Code をエディターに使う

<div class="ghd-tool mac">

1. [Visual Studio Code](https://code.visualstudio.com/) (VS Code) をインストールします。 詳細については、VS Code ドキュメントの「[VS Code の設定](https://code.visualstudio.com/Docs/setup/setup-overview)」を参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "code --wait"
   ```

</div>

<div class="ghd-tool windows">

1. [Visual Studio Code](https://code.visualstudio.com/) (VS Code) をインストールします。 詳細については、VS Code ドキュメントの「[VS Code の設定](https://code.visualstudio.com/Docs/setup/setup-overview)」を参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "code --wait"
   ```

</div>

<div class="ghd-tool linux">

1. [Visual Studio Code](https://code.visualstudio.com/) (VS Code) をインストールします。 詳細については、VS Code ドキュメントの「[VS Code の設定](https://code.visualstudio.com/Docs/setup/setup-overview)」を参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "code --wait"
   ```

</div>

## エディタとして Sublime Text を使う

<div class="ghd-tool mac">

1. [Sublime Text](https://www.sublimetext.com/) をインストールします。 詳細については、Sublime Text の「[Installation](https://docs.sublimetext.io/guide/getting-started/installation.html)」(インストール) ドキュメントを参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "subl -n -w"
   ```

</div>

<div class="ghd-tool windows">

1. [Sublime Text](https://www.sublimetext.com/) をインストールします。 詳細については、Sublime Text の「[Installation](https://docs.sublimetext.io/guide/getting-started/installation.html)」(インストール) ドキュメントを参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w"
   ```

</div>

<div class="ghd-tool linux">

1. [Sublime Text](https://www.sublimetext.com/) をインストールします。 詳細については、Sublime Text の「[Installation](https://docs.sublimetext.io/guide/getting-started/installation.html)」(インストール) ドキュメントを参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "subl -n -w"
   ```

</div>

<div class="ghd-tool windows">

## エディタとして Notepad++ を使う

1. Notepad++ をhttps://notepad-plus-plus.org/からインストールしてください。 詳細については、Notepad++ の「[概要](https://github.com/notepad-plus-plus/npp-usermanual/blob/master/content/docs/getting-started.md)」のドキュメントを参照してください。
1. <span class="platform-mac">[ターミナル]</span><span class="platform-linux">[ターミナル]</span><span class="platform-windows">[Git Bash]</span> を開きます。
1. 次のコマンドを入力します。

   ```shell
   git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
   ```

</div>