Gaurav Nigam
1 min readMay 15, 2021

Intellij tips/short cuts — 01

  1. To compare any two files or folders, select them in the Project tool window and press Ctrl+D.
  2. Use the Smart code completion Ctrl+Shift+Space after the new keyword to instantiate an object of the expected type.
  3. Invoking Type-matching code completion (Ctrl+Shift+Space) twice will search for chained expressions of the expected type.
  4. Search — shift twice
  5. Shift twice and type “/” in the search field — to search for a list of settings, their options, and plugins.
  6. Shift twice and type terminal — to open terminal
  7. Block selection / to select rectange piece of of code — Press Alt and drag mouse
  8. to view recenlty opened file — Ctrl + E
  9. Press Ctrl+D in the editor to duplicate the selected block, or the current line when no block is selected.

Live template - Use live template for frequent code construct

  • psvm /main— main method in java (i.e. public static void main )
  • prsf /psf— private static final/public static final
  • psfi/psfs — public static final int/string
  • sout/soutf — system out w/ or w/o formating
  • fori — Create interation loop
  • geti — inserts singleton method getInstance
  • I — Iterate Iterable or array
  • ifn — insert if null
  • inn- insert if not null
  • itco — iterate on collection
  • itli — iterate on List
  • RL/WL — surround by read/write Lock
  • st — string
  • thr — throw new