概要
IntelliJの全体設定(~/.IntelliJIdea14や~/.IdeaIC14など)はバージョン管理することが難しいです(理由: Scala - [個人メモ] IntelliJ IDEA 設定ファイルマニアックス - Qiita)。
しかし各環境ごとに設定がバラバラであるのは避けたいので、設定手順とその項目をここにまとめます。
設定項目は自分向けなので汎用性はありませんが、手順は参考になるかもしれません。
特にみんなで同じコードを書くために有用なのはCode Style, Inspections, File Encodings, FIle and Code Templatesの部分です。その他の項目は操作性や好みの部分なので真似しなくてOK
手順
- Welcomeダイアログ | Configure | Plugins からScalaプラグインをインストール
-
Welcomeダイアログ | Configure | Settings を開く
- Appearance & Behavior | Keymap からEmacsを選択
- Appearance & Behavior | System Settings | Startup/Shutdown からReopen last project on startupのチェックボックスを外す
- Editor | General | Appearance | Show line numbersをチェック
- Editor | General | Appearance | Show method separatorsをチェック
-
Editor | General | Appearance | Show whitespacesをチェック
- Editor | General | Appearance | Show whitespaces | Leading および Innerのチェックを外す
- Editor | General | Editor Tabs | Tab Appearance | Show tabs in single rowのチェックを外す
- Editor | General | Editor Tabs | Tab Appearance | Hide file extension in editor tabsのチェックを外す
- Editor | General | Editor Tabs | Tab Closing Policy | When closing active editor | Activate most recently opened tabを選択
-
Editor | General を開く
- Strip trailing spaces on SaveをAllに変更
- Ensure line feed at file end on Saveのチェックボックスにチェック
-
Editor | Colors & Fonts からScheme nameをDarculaへ変更
- (追加)Editor | Colors & Fonts | Font からDarculaスキーマをコピー、Primary fontをRicty サイズ15に変更
-
Editor | Code Style を開く
- DefaultスキーマをMy Defaultスキーマとしてコピー
- Schemeドロップダウンメニューで選択状態になっていることを確認
- LIne separator (for new files)をUnix And OS X(\n)に変更
- Right margin (columns)を100に変更(ここが100なのはStyle Guide - Declarations - Scala Documentationなどが理由だが120の人もいる)
- Default Indent Options | Detect and use existing file indents for editingのチェックを外す
- Editor | Code Style | Scala を開き、以下で指摘されている部分を変更
-
Editor | Inspections を開く
- Scala: General | Advanced language featuresのチェックを外す
- Scala: Method signature | Empty-paren method accessed as parameterlessのチェックを外す
- Scala: Method signature | Empty-paren Scala method overriden as parameterlessのチェックを外す
- Scala: Method signature | Java accessor method called as empty-parenのチェックを外す
- Scala: Method signature | Java accessor method overriden as empty-parenのチェックを外す
- Scala: Method signature | Java mutator method accessed as parameterlessのチェックを外す
- Scala: Method signature | Java mutator method overriden as parameterlessのチェックを外す
-
Editor | File Encodings を開く
- IDE EncodingをUTF-8へ変更
- Project EncodingをUTF-8へ変更
- Projerties Files | Default encoding for properties filesをUTF-8へ変更
- Editor | File and Code Templates | Includes で右上のエディタ画面の文字列をすべて削除(参考: java - How to edit comment template and add type or function comment in JetBrains IntelliJ IDEA? - Stack Overflow)
- Version Control | Confirmation | When files are created | Do not addを選択
- Version Control | Confirmation | When files are deleted | Do not removeを選択