Tips & Tricks

30 Days with IntelliJ IDEA. Editor Basics

As you remember last week we announced the plans to publish articles from the 30-day guide on getting started with IntelliJ IDEA. The first article was about the user interface. Today we would like to share with you one more article about the editor basics in IntelliJ IDEA.

Structural selection. A definite must-know

Did you know that IntelliJ IDEA provides an alternative way to select code? Structural selection allows you to select expressions based on grammar. By pressing Ctrl + W (Cmd + W for Mac) you keep expanding your selection (starting from the caret). And vice versa, you can shrink it by pressing Shift + Ctrl + W (Shift + Cmd + W for Mac).

Column selection

There are many users used to the column selection mode. Not everyone knows that this feature is available in IntelliJ IDEA. Column selection with mouse is available when you hold Alt. If you decide to use column selection by default, you can enable it via Edit → Column Selection Mode.

The complete article can be found here.

Stay tuned for more articles soon, and develop with Pleasure!

Comments below can no longer be edited.

14 Responses to 30 Days with IntelliJ IDEA. Editor Basics

  1. Avatar

    Steffen says:

    May 20, 2013

    Structural Selection sounds and looks awesome!
    However, on my Mac Installation of IDEA, Cmd-W is mapped to “Close active editor”.
    Also I am not able to find something like “structural selection” or “expand selection” in the keymap.

    Any idea how I might achieve this functionality?


  2. Avatar

    Ramiro Araujo says:

    May 20, 2013

    @Steffen, in the keymap search for “Select Word at Caret” and “Unselect Word at Caret”

  3. Avatar

    hiessu says:

    May 20, 2013

    keymaps select intellij IDEA, search “select word at Caret”

  4. Avatar

    Mike says:

    May 20, 2013

    @Steffen the name of this in the keymap is “Select word at caret”. The article lists the shortcut on a Mac as shift-cmd-w.

  5. Avatar

    Mike says:

    May 20, 2013

    I am a long time IntelliJ user and I didn’t know about “Show method separators” or that you could get column selection by holding down the alt key. I knew you could turn on column selection but didn’t know about the one-time usage of it with alt. Nice!

  6. Avatar

    Mark says:

    May 20, 2013

    The OS X 10.5+ keymap has ‘Select word at caret’ set to Option+Arrow Up by default.

    On the subject of keymaps: why isn’t the 10.5+ keymap default on OS X? The first time I used IntelliJ IDEA on my Mac I got scared off by the keymap, which goes against anything a regular OS X user would expect. The 10.5+ keymap is a lot better, but still has some annoyances (particularly using hard to reach keys and using combinations that conflict with OS X internal shortcuts).

  7. Avatar

    Matt B says:

    May 20, 2013

    Steffen, you might have your keymap set to “Mac OS X 10.5+”, whereas the Cmd-W mapping is for the “Mac OS X” keymap – the naming is a bit confusing (as the latter seems to be what most documentation refers to by default, yet the name of the former seems like it would be the default going forward).

  8. Avatar

    przemeko says:

    May 21, 2013

    Navigate between opened tabs via Ctrl + Arrows. Shouldn’r be Alt +Arrows for default keymap ?

  9. Avatar

    Steffen says:

    May 21, 2013

    Thanks guys, yes may be my fault in that I have some kind of modified “Mac OSX 10.5+” Keymap here.

    Looking for ‘Select word at caret’ did the trick. Mapped it to Option-Arrow Up (Likewise ‘Unselect word at caret’ => Option+Arrow Down) – Nice!

  10. Avatar

    Andrey Cheptsov says:

    May 21, 2013

    @przemeko, you are right! sorry, fixed)

  11. Avatar

    Colin Kershaw says:

    May 21, 2013

    Tip: Column Selection is handy for typing/pasting into columns too – it’s useful for more than only selecting text.

  12. Avatar

    Steve Cecutti says:

    May 25, 2013

    These tutorials are great. Having been a recent eclipse user, I tried Intellij 1 month before my MyEclipse subscription expired. I purchased IntelliJ within 2 weeks since I felt it made that much sense. And these tutorial sessions show me how much more I still have yet to learn about IntelliJ. Keep them coming please!

  13. Avatar

    Freewind says:

    September 18, 2015

    “Column selection” is good, but if I enable it, the `shift+up` or `shift+down` is used to column selecting rather than the original behaviour(select the content between the start and end current position), which is not convenient so I have to disable it after using.

    Can we just give it another short-cut, or can we configure it? I want to keep it enabled by default

    • Avatar

      Freewind says:

      September 18, 2015

      I just found we set custom shortcut to “clone caret up/down” for it. Also have a new question: In the document, it says we can “Double-click Ctrl and press up or down arrow keys.”, what does “double-click ctrl” mean? How to do it?

Discover more