Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asufana/53d3f403f43619e821a254a49eedd1b2 to your computer and use it in GitHub Desktop.
Save asufana/53d3f403f43619e821a254a49eedd1b2 to your computer and use it in GitHub Desktop.
EclipseユーザのIntelliJ設定おぼえがき

EclipseユーザのIntelliJ設定おぼえがき

初期設定

  • Keymap:Eclipse(Mac)
  • 警告を除外:Preferences > Editor > Inspections
  • Redundant local variables:retrun前の説明変数などの警告をオフ
  • Lambda can be repalced with method reference:メソッド参照の警告をオフ

Live template

  • 不要なものを外す
  • sout は sysout に変更する

インポート設定

参考:http://d.hatena.ne.jp/masanobuimai/20130218/1361668361

Editor > Code Style > Java

  • Imports
  • Class count to use import with '*':99
  • Names count to use static import with '*':99
  • Packages to use Import with '*' に static org.junit.Assert を追加

Editor > General > Auto Import

  • Java > Optimize imports on the fly:チェック
  • Java > Add unambiguous imports on the fly:チェック

ショートカット

重複している状態で保存すればよい(重複しているものを削除するか問い合わされる)

一般
  • Quickメニュー:Command + 1 をアサインする(Other > Show Intention Actions)
  • 変数設定:Command + 2, L をアサインする(Main menu > Refactor > Extract > Variable)
  • リネーム:Command + Optoin + R 、および F2 をアサインする(Main menu > Refactor > Rename)
  • メソッド一覧:Command + O をアサインする(Main menu > Navigate > File Structure)
  • 定義先にジャンプ:F3 をアサインする(Main menu > Navigate > Declaration)
  • 参照先にジャンプ:Command + Shift + G をアサインする(Main menu > Edit > Find > Find Usages)
  • クラスを探す:Command + Shift + T をアサインする(Main menu > Navigate > Class...)
テスト
  • テストクラスへ移動(なければテストクラス生成):Command + 9 をアサインする(Main menu > Navigate > Test)
  • テストの実行:Command + 0 をアサインする(Other > Run context configuration)
  • デバッグ実行:Command + Shift + 0 をアサインする(Other > Debug context configuration)
  • 前テストの再実行:Command + F11 をアサインする(Main menu > Run > Run)
デバッグ
  • 次ステップ:F6
  • 次ブレイク:F8
  • 次カーソルまで:Command + R
その他
  • コード整形:Command + Shift + F をアサインする(Main menu > Code > Reformat Code)

フォーマッタ

  • Eclipseフォーマッタを読み込み可能
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment