Yair's Tweaks & Tricks

Mainly software

Leave a comment

Intellij – Add actions in VCS Operations popup

A while back I wrote about some cool intellij shortcuts.

One thing I was missing was how to add more actions. I was missing three that I often use:

  • pull
  • fetch
  • rebase

Finally I cracked it. Here’s how to add more actions:

Open Settings –> Appearance & Behavior:

Now click on “Menues and Toolbars” and exapnd “VCS Operations Popup” (it’s the last option for me):

Now click on one of the existing actions that is not a folder. “Show History” for example and then click on the `+` next to the search bar in the upper portion of this window:

Choose Add Action. You can now search for actions like “fetch”, “pull”, “rebase” etc.

Add as many actions as you like.

You can then re-order these as you wish.

This is my view now:

Now when you type: ctrl+` you get these options in the VCS Operations popup.

principles of high performance programs

I’ve found this article extremely interesting. Although some of the tips here are not so relevant to Java – it’s still a good read for Java developers.

One point I personally want to emphasize is the ContextSwitch cost. Read more about it in the article.


Intellij Tips

As I am using Intellij for my daily software development work, I thought I’d share some useful tips.

Tip #1 – SCM Shortcut

quick access to SCM (Source Control commands) – Alt + `


Tip #2 – Branch management

If you want to hold multiple modules in the same project that have the same maven artifact id – you don’t have to open a new project.

Make sure the branch modules have a unique fie system folder name. I.e. module ‘foo’ is in ‘foo’ folder in trunk, but in branch the folder name is ‘foo-branch’. In this case you can import the branch module and have it side by side with the trunk module.

Note: you may want to update the ‘name’ in the pom.xml so you can easily distinguish between trunk and branch modules in the ‘Maven Project’ tab.


Tip #3 – module grouping

In case you want to group some modules together (very useful when managing trunk and branch together) you can right click on a module and choose ‘Move module to group’.


Tip#4 – Setting Module Dir as default working directory

Go to ‘edit configurations’ and under defaults define ‘$MODULE_DIR$’ as the working directory:

intellij default configurations

Naturally repeat this for Junit and and any other run type you wish.


Tip#5 – Dependencies Tree

Although dependencies graph exist only in the commercial edition you don’t really need them. You can see the full tree in the ‘Maven Project’ tab. If you want to understand how the maven resolution was done and why (maybe) you see the “wrong” version – you should install the “Maven Helper” plugin (just search for it the plugin repositories within Intellij) that will add another tab when you open your pom.xml file and you will see which version was omitted because of conflict (similar to the maven plugin supported in Eclipse).
Thanks to Izek Greenfield for this tip.


Tip #6 – Expand Tree Node

Know those times you need to expand all but only under the context you are currently focused (i.e. in ‘Maven Project’ expand all dependencies)?

Well, Ctrl + ‘+’ expands the whole tree and not only the specific node. BUT – use the numpad ‘*’ and there you have it. 🙂