3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

IntelliJで設定していること

Last updated at Posted at 2020-10-20

前提

私が、WindowsでIntellijを使って、Javaの開発をする場合に設定していることです。

File > Settings

Languages & Frameworks

  • SQL Dialects
    • Global SQL Dialect: DB種類を選択

Editor

  • Code Style
    • Java
      • Tabs and Indents
        • Tab size: 4
        • Indent: 4
        • Continuation indent: 4
        • Label indent: 0
      • Wrapping and Braces
        • Blank Lines
          • Keep Maximum Blank Lines: 全部1にする(2行空くのが嫌なので)
  • Inspections
    • Internationalization
      • Non-ASCII characters: チェック外す(テストメソッドに日本語を使うため)
    • Java
      • Visibility
        • Parameter hides field: チェックを入れる
      • Code style issues
        • Field may be 'final': チェック外す
  • Tools
    • Terminal
      • Shell Path: \Git\bin\bash.exeの絶対パスを設定する(linux形式でコマンド打てる方が都合が良いことが多いので)

Help > Edit Custom VM Options

コンソールなどで日本語を文字化けさせないために下記を追加する。

idea64.exe.vmoptions
-Dconsole.encoding=UTF-8
-Dfile.encoding=UTF-8

上記以外

Settingsなどメニューからの設定の仕方が分かっていないもの。

  • Generateするときのテンプレート

Generate > Getter > Generate Getter dialog から編集できる
参考: Custom code generation templates

ドメインクラス用のgetがつかないgetter生成テンプレート(もっといい書き方があるかも)

#if($field.modifierStatic)
static ##
#end
$field.type ##
#if($field.recordComponent)
  ${field.name}##
#else
#set($name = $field.name)
${name}##
#end
() {
  return $field.name;
}
3
1
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
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?