Dear all,

On my job I'm using Java; and Eclipse as an IDE. I'm discovering Pharo since
a year now. I find it in almost every way superior. But not on the following
way. I use keyboard shortcuts heavily in Eclipse. I use them to quickly
select parts of code, extract methods, rename methods, fields, classes,
switch browsing windows, delete a line of code, copy and move lines of code.
I tend to miss these shortcuts in Pharo. There are actually a lot of
shortcuts (http://news.squeak.org/2007/01/26/looking-for-a-shortcut/ -
Andreas comment). But I still find that I have to leave the keyboard way to
often and use the mouse to navigate to another window / or part of the
browser I'm working in. Let me explain that a bit further. I will try to
give some examples of behaviour I'm missing in Pharo.
- If I'm editing a class and working in the source view. I'm done, I want to
run the tests again I just ran. I have to take the mouse, navigate to the
class and hit Alt-t. Or use the test runner. In Eclipse there is a global
shortcut Alt-F11 which just runs the test (or even better: the suite of
tests) which ran previously. It moreover runs it in the background and if
everything is still ok, does not bother you again. It only pops up if
something broke. This behaviour is very handy if you're refactoring. You can
then with every small change run all relevant tests in matter seconds and
continue.
- If I'm editing in the source pane. I'm done editing, and I want to
navigate for instance to another method. I have to take the mouse to
navigate to the methods, scroll and click on the new method. Again had to
take the mouse. In Eclipse, there is a Ctrl-O shortcut which brings up a
list of all methods in this class. At the top there is an input field in
which I can start typing; while typing the list is restricted. I can then
using the arrow keys navigate to the method and hit Enter, and I'm in the
method.
- For switching between browser windows Eclipse also does have a handy
mechanism. Eclipse keeps in memory a list of files you're editing ordered by
latests usage. I can then quickly navigate through the list by hitting
Ctrl-F6. Just hitting Ctrl-F6 navigates to the previous window visited.
Hitting it again gets back. If you however hit Ctrl - F6, keep the Ctrl
pressed in, and hit F6 again, you navigate the the second last window
edited. I use this behaviour constantly to navigate back and forth between
the test you're writing and the implementation.
- Eclipse also has very keyboard shortcut integration to select/delete parts
of the code. Ctrl D deletes the current line. Alt arrow up / down moves the
current line (or selection) up or down (while keeping the clipboard
selection). Alt-Shift-arrow up/down copies the current line (or selection)
up or down (while keeping the clipboard selection). Alt Shift Left arrow /
right arrow does a nifty code selection: if the code compiles properly, it
will with every next hit on left arrow select a larger block of code. So if
my cursor is on a message send, it will first select the message send, next
the receiver and the message send, next: if this was a nested, select the
part out of that, and so forth. This is very handy if you for instance want
to do a extract method refactoring on some part of the code. Just quickly
select it using this Alt-Shift selection and extract it.
- Which brings me to the refactoring shortcuts, which I'm missing the most.
* The most important one is rename. In Eclipse if I select a field, a
temporary var,  a message, a class, anything that can be renamed; I can
always hit Alt-Shift-R to rename it. I don't have to go into a menu,
refactor class, or refactor method, or refactor source with the mouse to
select rename. Just click on it, hit the shortcut, type the new name and hit
Enter.
* The next one is Extract Method. After quickly selecting I just hit
Alt-Shift-M, give a name (Eclipse guesses a name) and I extract.
* Another very useful one is Extract Local Variable using Alt Shift L.

I'm very well aware of the fact that in Smalltalk you typically only need
half of the lines of code to achieve the same, but still I'm missing this
kind of behaviour to quickly navigate, adapt code, run tests, ...
All the tools are there in Pharo, but I just feel that they need a little
better keyboard integration.

How are experienced Smalltalkers feeling about this?

Are there any solutions available already that I haven't found ? If not, I'm
more than happy to implement some of these, but my knowledge of Morphic is
still rather limited. Can anyone provide me with some pointers how to
achieve that?

Kind Regards,

Bart

-- 
imagination is more important than knowledge - Albert Einstein
Logic will get you from A to B. Imagination will take you everywhere -
Albert Einstein
Learn from yesterday, live for today, hope for tomorrow. The important thing
is not to stop questioning. - Albert Einstein
The true sign of intelligence is not knowledge but imagination. - Albert
Einstein
Gravitation is not responsible for people falling in love. - Albert Einstein
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to