Skip to content

Instantly share code, notes, and snippets.

@AdrianRaFo
Last active February 6, 2023 21:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrianRaFo/0c33257a5f9fce824eaaa18ab29c0e7e to your computer and use it in GitHub Desktop.
Save AdrianRaFo/0c33257a5f9fce824eaaa18ab29c0e7e to your computer and use it in GitHub Desktop.
IntelliJ IDEA Setup

Before starting

If you are a new user please change these settings from the All settings option in the Customize menu before creating or opening any project.

If you are not a new user, the settings marked with Per project setting need to be applied for the current project if opened and on each existing project through the IntelliJ >> Preferences menu option but also on the File >> Manage IDE settings >> Settings for new Projects

Another way to apply this changes is to close all projects(File >> Close all projects or File >> Close project if only one openned) and accessing the settings from the All settings option in the Customize menu but you may need to reimport all your existing projects.

Plugins

Add

  • Ignore
  • Material theme
  • Atom material icon
  • Rainbow brackets
  • Settings Repository

Remove

  • Android
  • Smali support
  • Build tools section
  • Code coverage
  • Java fx
  • Groovy
  • Plugin devkit
  • Ui designer
  • Light theme
  • Lombok
  • Mercurial
  • Perforce
  • Subversion
  • Eclipse interoperability
  • Java Stream debugger
  • Qodana
  • Space

Appearance and behavior

Appearance

Mnemonics are pre configured shortcouts to open the toolbar menus. If you don't open the toolbar menu with the shortcout you can disable them and leave those shortcouts available for other actions (See Keymap section)

  • Mnemonics -> Disabled

File Colors (Per project setting*)

  • Non-Project Files -> Theme Excluded Color
  • Tests -> 143618 (recommended green may change depending on your chosen theme)

System settings

  • Save files when idle -> 5sec (Recommended)

Material Theme UI

Settings

  • Enable contrast mode

Tabs

  • Tab height -> 22 (Recommended)

Compact

  • Compact Statusbar -> Enabled
  • Compact Table cells -> Enabled
  • Compact Dropdown -> Enabled
  • Compact Menus -> Enabled

Project View

  • Custom Item Line height -> 22 (Recommended)
  • Custom tree indent -> 4 4 (Optional)

Components

  • Disable Uppercase buttons (Optional)

Editor

General

Code completion

  • Show the documentation pop-up in -> 500ms

Parameter info section -> Enable all

Console

  • Use soft wraps in console -> Enabled

Editor Tabs

Opening Policy section

  • Enable preview tab -> Enabled (Recommended)

Closing Policy section

  • Tab limit -> 15 (Recommended)

Smart keys

Scala

  • Remove braces automatically -> Enabled

Font

  • Font ligatures (Optional)
  • Increase font size (Recommended)

Color scheme

General (Recommended)

  • Go to the bottom of the example and click on:

Error

  • underwaved -> bold underscored

Warning

  • underwaved -> bold underscored

Weak warning

  • underwaved -> bold underscored

Unused symbol

  1. Copy to clipboard grey in use (like the deprecated symbol foreground)
  2. foreground -> Enabled
  3. Paste grey into foreground color
  4. effects -> Disabled

Unknown symbol

  1. Copy to clipboard red in use (like the deleted text foreground)
  2. foreground -> Enabled
  3. Paste red into foreground color
  4. effects -> Disabled

Runtime problem

  • underwaved -> bold underscored

Problem from server

  • underwaved -> bold underscored

typo

  • underwaved -> bold underscored

Language defaults (Recommended)

Click on the top list:

Bad characters

  • underwaved -> bold underscored

String >> Escape sequence >> Invalid

  • underwaved -> bold underscored

Color scheme font

  • Use color scheme font instead of the default -> Disabled

Console font

  • Use color scheme font instead of the default -> Disabled

Code Style

Scala

Formatter -> Intellij

Wrapping and braces

Method declaration parameters Do not wrap -> Chop down if long

  • Align when multiline -> Disabled
  • new line after ( -> Enabled
  • Place ) on new line -> Enabled

Method call arguments Do not wrap -> Chop down if long

  • new line after ( No new line -> New line for multiple arguments
  • Place ) on new line -> Enabled

Chained method calls Do not wrap -> Chop down if long

  • Wrap first call -> Enabled

Blank lines

  • Everything with 2 -> 1

Formatter -> Scalafmt

Imports

  • Class count to use import with _ 5 -> 3

Inlay hints

Code vision (Recommended)

  • Code author -> Disabled

Parameter names

Scala

  • Even for apply and update methods -> Enabled

Types

Scala

  • Everything -> Enabled
  • Call chain: Only where there are at least 3 -> 2

Live template

Click on the Scala section where you can see the built-in templates that Intellij gives to you.

For the new live templates we are going to create the Applicable contexts always are: Scala except Comment and XML

New live template

  • Abbreviation -> icats
  • Template text -> import cats.syntax.all._
  • Description -> import cats implicits

New live template

  • Abbreviation -> for
  • Template text ->
    for {
      _ <- $CURSOR$
    } yield ()
    
  • Description -> for comprehension

New live template

  • Abbreviation -> F
  • Template text -> F[_]: Async
  • Description -> F type parameter with Async implicit

New live template

  • Abbreviation -> utc
  • Template text -> ZoneOffset.UTC
  • Description -> utc zone

Version Control

Commit (Per project setting*)

  • Analyze code -> Disabled
  • Check todo -> Disabled

Confirmation

  • Restore workspace when switching branches -> Disabled

Github

  • Add account
  • Enable Clone git repositories using SSH

Guide to use Github with SSH

Languaje and frameworks

Scala

  • Show type info on mouse hover after -> 100 ms

Rainbow brackets

  • Do not rainbowify the first level -> Enabled
  • Do not rainbowify big files -> Disabled

Keymap (With suggested shortcouts)

  • Rename (Option+R)
  • Rename file (Option+Shift+R)
  • Reformat (Option+F)
  • Reformat file (Option+Shift+F)
  • Optimize Imports (Option+I)
  • Open blank diff (Option+Shift+D)
  • Select all occurrences (Ctrl+Shift+A)
  • Branches (Option+G)
  • Quick documentation (Leave default)
  • Parameter info (Leave default)
  • Find usages (Leave default)
  • Find in files (Ctrl+Shift+F)
  • Add or remove caret (Ctrl+Shift+Click)
  • Navigate >> back/forward (Leave default)
  • Show find action (Leave default)

Settings Repository

  1. Create a private repo on Github
  2. Copy browser URL (no the git one)
  3. File >> Manage ide settings >> Settings Repository
  4. Paste Url and then click on Overwrite remote
  5. (On Github) Account settings >> Developer settings >> Personal access token >> Generate new token
    • No expiration date
    • Repo permissions
  6. Copy generated token into Intellij Dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment