10. January 2019

IntelliJ Idea vertical text block selection

It’s easy to create vertical text block selection in IntelliJ Idea.

  • macOS: Option + Command + Left click and drag mouse
  • Windows 10 – Creators update: Click Mouse wheel and drag
  • Older Windows: Alt + Left click and drag mouse
  • Linux: Click Mouse wheel and drag
  • Without mouse: Open Edit menu and select Column Selection Mode (Alt+Shift+Insert), then use Shift + Arrows to select a block

You’ll select vertical text block:

9. January 2019

IntelliJ Idea zoom text by mouse wheel

Common feature in many application is possibility to zoom text content by Ctrl + Mouse Wheel.

IntelliJ Idea has this feature, but it’s disabled by default.

You can enable zoom in few steps. Open Settings (Ctrl+Alt+S), search for “zoom“, select Editor.

Check the option “Change font size (Zoom) with Ctrl+Mouse Wheel“. Click OK and enjoy the zoom feature :-)

18. May 2017

How to use PowerShell in IntelliJ Idea terminal instead of cmd

IntelliJ Idea has support for embedded terminal. That’s handy because you do not need to open extra window just for a terminal.

The default configuration of IntelliJ on Windows is installed with old-school cmd.exe. It’s quite easy to replace it by PowerShell.

Go to Settings (Ctrl+Alt+S). Search for word “terminal“. Select Tools – Terminal.

Change Shell path option from cmd.exe to

C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

Press OK and start new Terminal window.

I recommend to use Dracula theme which is a little bit more readable than the white theme.

23. June 2014

How to debug Gradle script

First of all: do not use daemon mode for debugging.

IntelliJ Idea is automatically spawning daemon when you start any Gradle task. You have to attach to remote process.

I wrote small “How to debug” based on info from forums.gradle.org.

You’ll need to set GRADLE_OPTS environment variable to:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005

Here is example in PowerShell:

01-command-line-options

$env:GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

Configure Remote debugging in Idea:

02-configure-remote

You do not need to change anything in default configuration.

Now return to command line with your project and invoke task. Gradle will automatically stop and it waits for debugger.

03-start-process

Attach debugger

04-attach-to-process

Here we go :-)

05-break-point

There is small limitation. You can stop code execution outside DSL e.g. in class method (line 3). You won’t be able to stop execution in Gradle DSL line 10.

You can download sample build script from Github.

6. January 2014

IntelliJ Idea – Cordova – Default Activity not found! – solution

Situation: import Cordova project with support of Android platform to Intellij Idea. You’re not able to start emulator, because of strange error:

Default Activity not found!

cordova-error-activity-not-found

One solution could be: go to File menu and choose Invalidate Caches /Restart.

This might not help.

The real problem is most likely in configuration of Android module. Open project configuration, select module and make sure that directory src is marked as Source.

cordova-error-add-sources

Confirm module configuration and error message should disappear.