My favourite tips&tricks for the Best, Kick-Arse java IDE "IntelliJ IDEA".

Sunday, December 19, 2004

Tip 4: Fresh CVS Checkout from within IDEA

Most ppl are not aware of the fact that fresh CVS checkout can be done within IDEA. ppl resort to wincvs or turtoise for fresh CVS checkout. ok, without further ado i'll come to the point.

File > Checkout From CVS...

click on this menu item, and then select a repository in the next screen.

the best part is we can checkout any and all directories, including sub-directories of modules, we can slect multiple directories too.

File menu also contains "Browse CVS Repository" where u can actually see the contents of any repository.

so happy CVS Checkouting and Browsing.

(i know "Checkouting" sounds lame ;-)


Tuesday, December 14, 2004

Tip 3: CTRL+N with Camel Humps

ok, we normally use CTRL+N to open existing java files, suppose i want to open a file called,
------------------------------
InternalFooBarFile.java
------------------------------

so i'll type CTRL+N, small textbox will popup and i'll start typing

---------------------
inter
-------------------


and a file list starting with letters "inter" will be displayed, suppopse i have 25 files starting with word "Intern.." then i have two options
1. scroll down the list and select appropriate file.
2. or keep completing file name till the list narrows down and then select required file name from the drop down list.

or else there is a better way, called the CamelHump way.

after pressing CTRL+N , type "IFB.." in caps and see the magic, the list narrows down to the appropriate file.
note: "IFB" is in caps, so we have to type the capital letters in the file name, and the list narrows down.

i'll post some screenshots too.

chow.


Tip 2: ALT+F1

heres another one of my favorite keyboard shortcut:

We all know that we can open java files with ctrl+N (or non java with ctrl+shift+N) once the file is open , how do we find its source directory (quickly). How do we locate its in project windiow , package window, or in commander window (nobody uses commander window, I’ll talk about it in later tips.) there is a keyboard shortcut most ppl are unaware, so I share it here, the magic keystroke is

ALT+F1

In editor window when a file is open , just press alt+F1 and voila a menu pops up, select an menuitem and we jump to it, we can uses this key combo in many windows.
Its one of my favorite key-combos.

Until next tip, (quick,lightning fast tip)……………..
Keep Rocking.

Tip 1: comparing two code fragments (or two files) quickly.

Step 1 : select fragment 1 and copy it to clipboard.

Step 2 : select fragment 2 and right click it and select “compare with clipboard”. (Dont forget to select second code fragment, only then right-click on it.)
And voila…….. u can compare two code frags, with IDEA’s default diff plug-in.

U can use same technique to compare two files ;-)

More tips coming sooon. Keep looking………

Jigar.


=================================
Comments: by anon
=================================
You can also compare two local files with Idea's diffault diff plugin. Open project window by Alt+1. Select 2 files which u want to compare and then right click on mouse. select compare selected files option.
regards,
anon

=================================
my reply.
=================================

That’s right ,

But the issue sometime is , that two files are open in editor window, and we don’t know exactly where they are in the (directory structure) project window, (this can happen if we open the files using ctrl+N). And now if one file is in mailbox module and other is in obox/domains…. Then to locate these file in project window is a painful task , and the we have to scroll all the way, the control click two file……….. and u know the chore.

So this tip is for two files which are already open in editor and u want to quickly compare them (full file or code fragments). this method also uses IDEAs default diff plugin.

Jigar.