Skip to content

Instantly share code, notes, and snippets.

@islomar
Last active January 10, 2024 13:22
Show Gist options
  • Save islomar/0e21d8fce8e630a8446e to your computer and use it in GitHub Desktop.
Save islomar/0e21d8fce8e630a8446e to your computer and use it in GitHub Desktop.
IntelliJ

My JetBrains notes

General

Interesting plugins

Interesting shortcuts (Ubuntu 16.04 + Keymap "default")

  • Alt + Enter: general command, it fixes things which might be improved
  • Alt + 1: toggle the "Project View"
  • Alt + Insert:
  • On project view: create new file
  • On a class: Generate X (constructor, getters, equals, etc.)
  • Live templates: [ psvm, sout, soutv, soutp, souf, serr fori, iter, itco, itar ] + Tab
  • Shift + Enter: creates and jump to a new line below the current line
  • Ctl + Shift + A >> Find Action
  • Ctl + Shift + Up/Down: move statements up and down
  • Alt + Left / Alt + Right: navigate to the last/next place
  • Ctl + W: Syntax aware selection = Select successful incresingly code blocks
  • On a text, it selects it. If you keep pressing it, it selects the context around.
  • F2: navigate to the next highlighted error
  • Ctrl + X: deletes the line
  • Ctrl + D: duplicates the line (in Eclipse it deletes it).
  • Ctrl + Shift + V: paste history
  • Ctrl + Shift + T: jump to its corresponding test (or creates it)
  • Column selection (it was disabled by default: Edit -> Column Selection Mode): first, select the lines, then press Alt+Shift+Insert, then write, finally Esc.
  • Ctrl + Shift + Space: SmartType completion (e.g. after a "new", it knows what you might want).
  • Ctrl + o: override/implement methods
  • F6: move
  • Ctrl + Shift + F10: run
  • Ctrl + P: parameter info, inside a method it tells you the different parameters that it allows
  • Ctl + Alt + Shift + T >> Refactor
  • Ctrl + Alt + M: extract method
  • Ctrl + Alt + V: having something selected, it creates a variable
  • Ctrl + F6: change signature
  • Shift + F6: rename
  • Alt + F12: toggle Terminal
  • Ctrl + E: recent files

Ad-hoc shortcuts

Some are done, for example, because it collides with Linux shortcuts.

  • Ctrl+Shift+F: format code (originally Ctrl+Alt+L)
  • Ctl + Alt + T >> Surrownd with

General hints

  • Print the "Help -> Keymap reference" PDF (fold it and put it on your desk)
  • Configure "Autoscroll to/from source" (in the gear button)
  • In order to indent the Spock Given-When-Then: Codestyle >> Groovy >> Label indent: 4
  • Help -> Productivity Guide: here you can see the shortcuts used and the total time saved thanks to it
  • Find and replace:
    • find: CREATE SCHEMA (.*)
    • replace: CREATE SCHEMA $1\nUSE $1
  • Toggle auto-test: it doesn't seem to work...
  • Settings >> "Change font size (zoom) with Ctrl+Mouse wheel"
  • Use Camel prefix in code completion
  • Configure Inspections ad-hoc:
  • "field may be final"
  • Use of "Local History"
  • Migrating to Java 8: https://www.jetbrains.com/help/idea/migrating-to-java-8.html
  • Spock indentation: Settings -> Editor -> Code Style -> Groovy -> Tabs and Indents

Troubleshooting

Pending

  • How to increase font size for a presentation? (besides Presentation mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment