Showing posts with label ide. Show all posts
Showing posts with label ide. Show all posts

30 March 2011

[Technote] Eclipse shortcut keys

To accelerate your programming speed on Eclipse, it's essential that you master the shortcut keys in Eclipse. Here I list a few shortcuts I found particularly useful:

Navigation shortcuts

CTRL+L - Jump to a line with line number x.
CTRL+Q - Go to the last edit location.
ALT+Left/Right - Same as CTRL+Q.
F3 - Go to the definition of a variable, method or class.
CTRL+O - Go to the declaration of a variable, method, or class.
CTRL+ALT+H - Show call hierarchy of a method.

File navigation shortcuts

CTRL+E - open a searchable list of all the open editors for you.
CTRL+SHIFT+T - Open a file by summon a file search box.

Editing shortcuts

CTRL+SHIFT+O - Doing all the imports automatically for you!
CTRL+I - Correcting indentation.
CTRL+/ - To comment out a line or lines (by selecting a group lines).
CTRL+D - To delete a line.
CTRL+SPACE (SHIFT+A in my IDE setting) - Autocomplete codes.
CTRL+1 - Suggest quick fixes.
ALT+SHIFT+R - Doing rename and refactoring for you.

Search shortcuts

CTRL+J - Incremental search.
CTRL+F - Single search.

Other shortcuts


CTRL+SHIFT+F - List all the shortcut keys and their mappings for you.

I will add more to this list once I find out other useful shortcuts.

25 October 2010

Vim code tab-completion support for python

Ever felt disappointed when writing codes in Vim but without code completion functionality just like what Eclipse IDE has? Well, Vim 7+ can do auto-completion by default!

In the insert mode (i-mode), when you press [ctrl]+p or [ctrl]+n, vim will try to complete with words that have already appeared in the current file. But that's it, that is the default.

To make vim even smarter, we have to teach him how to complete other words. The idea is using 'dictionaries'. Fortunately, some guys out there have already developed plugins (for code completion) for certain programming languages. Here I am going to show you vim plugin support for python.

First, download the plugin package (pydiction) from here:

http://www.vim.org/scripts/script.php?script_id=850

Second, unpack the package and basically put files inside ~/.vim directory.

Third, if you are downloading pydiction 1.0+, just follow the installation instructions in the README.txt inside the package, or read instructions from the link listed above. However if you are downloading packages below 1.0, then follow instructions here:

http://tinyurl.com/balbal

Now you can do tab-completion for python codes! This tool should accelerate your programming speed in Vim. Try it and stop complaining!