[Pharo-project] Keyboard Shortcuts in Pharo?
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
[snip]
Yeah, I agree on all ;-)
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.
That's a cool idea. I will add it to the refactoring tools.
- 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 problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine.
How are experienced Smalltalkers feeling about this?
Safara was an attempt to implement a replacement for the current text editor, where nothing was hardcoded but everything could be configured by the tool (highlighting, completing, shortcuts, ...). Unfortunately this project never made it into a useable state. Writing a text editor is difficult. Lukas -- Lukas Renggli http://www.lukas-renggli.ch
The problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine.
Is it not possible to throw away some of the shortcuts defined? I'd rather have a limited set of shortcuts which are used often, than defining a lot which are almost never used. I noticed for instance in the list that there is a shortcut Ctrl+T which inserts ifTrue:[] ; to my humble opinion, that is way to specific; and I'm not sure anybody is using this one. I'd rather use Ctrl-T then to open a new Type (class) or something. Another one is Alt - t pressed no the world view to 'find a transcript'. Is it not better then to find a way to quickly navigate between windows in general, so for instance, hit a shortcut anywhere, you get a list of all windows, and by just typing t for Transcript, and hit Enter, you are already in the transcript window. Kind Regards, Bart
I agree, the current key bindings could be improved... We would need somebody that thinks this through and makes a proposal, find a consensus, and implement it. Cheers, Adrian On Dec 11, 2009, at 09:05 , Bart Gauquie wrote:
The problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine.
Is it not possible to throw away some of the shortcuts defined? I'd rather have a limited set of shortcuts which are used often, than defining a lot which are almost never used. I noticed for instance in the list that there is a shortcut Ctrl+T which inserts ifTrue:[] ; to my humble opinion, that is way to specific; and I'm not sure anybody is using this one. I'd rather use Ctrl-T then to open a new Type (class) or something.
Another one is Alt - t pressed no the world view to 'find a transcript'. Is it not better then to find a way to quickly navigate between windows in general, so for instance, hit a shortcut anywhere, you get a list of all windows, and by just typing t for Transcript, and hit Enter, you are already in the transcript window.
Kind Regards,
Bart _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Dec 11, 2009, at 9:05 AM, Bart Gauquie wrote:
The problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine.
Is it not possible to throw away some of the shortcuts defined? I'd rather have a limited set of shortcuts which are used often, than defining a lot which are almost never used. I noticed for instance in the list that there is a shortcut Ctrl+T which inserts ifTrue:[] ; to my humble opinion, that is way to specific; and I'm not sure anybody is using this one. I'd rather use Ctrl-T then to open a new Type (class) or something.
Another one is Alt - t pressed no the world view to 'find a transcript'. Is it not better then to find a way to quickly navigate between windows in general, so for instance, hit a shortcut anywhere, you get a list of all windows, and by just typing t for Transcript, and hit Enter, you are already in the transcript window.
We should really have an overview and see what we can do.
Kind Regards,
Bart
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Em 11/12/2009 08:02, Stéphane Ducasse < stephane.ducasse@inria.fr > escreveu:
Dec 11, 2009, at 9:05 AM, Bart Gauquie wrote:
The problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine. Is it not possible to throw away some of the shortcuts defined? I'd rather have a limited set of shortcuts which are used often, than defining a lot which are almost never used. I noticed for instance in the list that there is a shortcut Ctrl+T which inserts ifTrue:[] ; to my humble opinion, that is way to specific; and I'm not sure anybody is using this one. I'd rather use Ctrl-T then to open a new Type (class) or something.
Ctrl+Shift+T and Ctrl+Shift+F are nice shorcuts that I vote for staying ;-). Also I would vote for a similar to VW's Ctrl+g for inserting the := sign now that we deprecated for good the undescore.
Another one is Alt - t pressed no the world view to 'find a transcript'. Is it not better then to find a way to quickly navigate between windows in general, so for instance, hit a shortcut anywhere, you get a list of all windows, and by just typing t for Transcript, and hit Enter, you are already in the transcript window.
This is weird, because in some of my images I'm positive that a certain key combination makes a kind of 'round robbin' of open windows. . .
should really have an overview and see what we can do.
Positively.
All, Looking at all the responses, it looks to me we should do the following things: - Check at the list ( http://lists.gforge.inria.fr/pipermail/pharo-project/2009-December/017196.ht...) of shortcuts Mariano Martinez Peck already provided. Put it on the wiki as a WorkInProgress. See which ones are still valid, see which ones can be removed, ... - Create a wiki document which outlines the changes we want to make to the window changing, code selecting, refactoring behaviour I suggested. I take the liberty to humbly suggest my initial list of behaviour as a starting point for this? - Point out who is doing what ... I'm not sure how new enhancements are discussed on this list. My suggestion is to create a wiki document which serves as a working document, and so always displays the latest up to date info. Discussions about it are done on the mailing list and decisions 'committed' to this doc. I'll be happy to create this pages, but don't seem to have the rights to create a new page on the wiki. 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
On Dec 13, 2009, at 4:58 AM, Bart Gauquie wrote:
All,
Looking at all the responses, it looks to me we should do the following things: ⢠Check at the list (http://lists.gforge.inria.fr/pipermail/pharo-project/2009-December/017196.ht...) of shortcuts Mariano Martinez Peck already provided. Put it on the wiki as a WorkInProgress. See which ones are still valid, see which ones can be removed, ... ⢠Create a wiki document which outlines the changes we want to make to the window changing, code selecting, refactoring behaviour I suggested. I take the liberty to humbly suggest my initial list of behaviour as a starting point for this? ⢠Point out who is doing what ... I'm not sure how new enhancements are discussed on this list. My suggestion is to create a wiki document which serves as a working document, and so always displays the latest up to date info. Discussions about it are done on the mailing list and decisions 'committed' to this doc.
Yes something like that. Now I was suggesting to invest into a way to change keybinding because not all the texteditor should have all the shortcuts.
I'll be happy to create this pages, but don't seem to have the rights to create a new page on the wiki.
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Hi Bart, This sounds like a good plan! I added you as a project committer, which should give you write access to the wiki. Cheers, Adrian On Dec 13, 2009, at 04:58 , Bart Gauquie wrote:
All,
Looking at all the responses, it looks to me we should do the following things:
- Check at the list ( http://lists.gforge.inria.fr/pipermail/pharo-project/2009-December/017196.ht...) of shortcuts Mariano Martinez Peck already provided. Put it on the wiki as a WorkInProgress. See which ones are still valid, see which ones can be removed, ... - Create a wiki document which outlines the changes we want to make to the window changing, code selecting, refactoring behaviour I suggested. I take the liberty to humbly suggest my initial list of behaviour as a starting point for this? - Point out who is doing what ...
I'm not sure how new enhancements are discussed on this list. My suggestion is to create a wiki document which serves as a working document, and so always displays the latest up to date info. Discussions about it are done on the mailing list and decisions 'committed' to this doc. I'll be happy to create this pages, but don't seem to have the rights to create a new page on the wiki.
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Hi Adrian, Thanks for adding me. I will try to write something during the week. Kind Regards, Bart On Sun, Dec 13, 2009 at 12:39 PM, Adrian Lienhard <adi@netstyle.ch> wrote:
Hi Bart,
This sounds like a good plan!
I added you as a project committer, which should give you write access to the wiki.
Cheers, Adrian
On Dec 13, 2009, at 04:58 , Bart Gauquie wrote:
All,
Looking at all the responses, it looks to me we should do the following things:
- Check at the list (
http://lists.gforge.inria.fr/pipermail/pharo-project/2009-December/017196.ht... )
of shortcuts Mariano Martinez Peck already provided. Put it on the wiki as a WorkInProgress. See which ones are still valid, see which ones can be removed, ... - Create a wiki document which outlines the changes we want to make to the window changing, code selecting, refactoring behaviour I suggested. I take the liberty to humbly suggest my initial list of behaviour as a starting point for this? - Point out who is doing what ...
I'm not sure how new enhancements are discussed on this list. My suggestion is to create a wiki document which serves as a working document, and so always displays the latest up to date info. Discussions about it are done on the mailing list and decisions 'committed' to this doc. I'll be happy to create this pages, but don't seem to have the rights to create a new page on the wiki.
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- 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
2009/12/13 Bart Gauquie <bart.gauquie@gmail.com>
All,
Looking at all the responses, it looks to me we should do the following things:
- Check at the list ( http://lists.gforge.inria.fr/pipermail/pharo-project/2009-December/017196.ht...) of shortcuts Mariano Martinez Peck already provided. Put it on the wiki as a WorkInProgress. See which ones are still valid, see which ones can be removed, ... - Create a wiki document which outlines the changes we want to make to the window changing, code selecting, refactoring behaviour I suggested. I take the liberty to humbly suggest my initial list of behaviour as a starting point for this? - Point out who is doing what ...
I'm not sure how new enhancements are discussed on this list. My suggestion is to create a wiki document which serves as a working document, and so always displays the latest up to date info. Discussions about it are done on the mailing list and decisions 'committed' to this doc.
Yes, this could be a good little first step.
I'll be happy to create this pages, but don't seem to have the rights to create a new page on the wiki.
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I forgot to say that there are still some pending problems like the one I reported here: http://code.google.com/p/pharo/issues/detail?id=1064 Cheers, Mariano On Sun, Dec 13, 2009 at 1:26 PM, Mariano Martinez Peck < marianopeck@gmail.com> wrote:
2009/12/13 Bart Gauquie <bart.gauquie@gmail.com>
All,
Looking at all the responses, it looks to me we should do the following things:
- Check at the list ( http://lists.gforge.inria.fr/pipermail/pharo-project/2009-December/017196.ht...) of shortcuts Mariano Martinez Peck already provided. Put it on the wiki as a WorkInProgress. See which ones are still valid, see which ones can be removed, ... - Create a wiki document which outlines the changes we want to make to the window changing, code selecting, refactoring behaviour I suggested. I take the liberty to humbly suggest my initial list of behaviour as a starting point for this? - Point out who is doing what ...
I'm not sure how new enhancements are discussed on this list. My suggestion is to create a wiki document which serves as a working document, and so always displays the latest up to date info. Discussions about it are done on the mailing list and decisions 'committed' to this doc.
Yes, this could be a good little first step.
I'll be happy to create this pages, but don't seem to have the rights to create a new page on the wiki.
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Em 13/12/2009 11:11, Mariano Martinez Peck <marianopeck@gmail.com> escreveu: Thinking aloud, I wonder if isn't better to have the 'feature' of duplicateAllControlAndAltKeys its sibbling duplicateSomeControlAndAltKeys removed and have only the Alt prefix for the Pharo related operations? -- Cesar Rabak
On Dec 11, 2009, at 8:44 AM, Lukas Renggli wrote:
[snip]
Yeah, I agree on all ;-)
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.
That's a cool idea. I will add it to the refactoring tools.
- 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 problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine.
We should really clean that.
How are experienced Smalltalkers feeling about this?
Safara was an attempt to implement a replacement for the current text editor, where nothing was hardcoded but everything could be configured by the tool (highlighting, completing, shortcuts, ...). Unfortunately this project never made it into a useable state. Writing a text editor is difficult.
We should have a look at the trunk/Squeak integration of TextEditor from CUIS because this would be good to integrate it.
Lukas
-- Lukas Renggli http://www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Em 11/12/2009 05:44, Lukas Renggli < renggli@gmail.com > escreveu:
[snip] Yeah, I agree on all ;-)
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. That's a cool idea. I will add it to the refactoring tools. +1
- 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 problem is that Pharo already binds all possible keyboard shortcuts to something, which leaves no space for other tools like the refactoring engine.
I think we could have some leeway if we give up to the present double mapping of some short cuts that accept the Alt and Cmd prefixes to do the same thing (at least in Windows is worse than that because sometimes this double mapping works sometimes does not.
How are experienced Smalltalkers feeling about this? Safara was an attempt to implement a replacement for the current text editor, where nothing was hardcoded but everything could be configured by the tool (highlighting, completing, shortcuts, ...). Unfortunately this project never made it into a useable state. Writing a text editor is difficult.
Besides, I _think_ putting a completely reconfigurable environment in Pharo's toolset will create the anxiety of the "paradox of choice" without bringing too much added value. We already have lot of 'fun' having do spread remarks all over the documentation about the appeareance of the tools and still have a half baked solution for the naming of mouse buttons, imagine the added complexity of having to all the time have to put remarks on keyboard shorcuts!!
On Fri, Dec 11, 2009 at 2:44 AM, Lukas Renggli <renggli@gmail.com> wrote:
Safara was an attempt to implement a replacement for the current text editor, where nothing was hardcoded but everything could be configured by the tool (highlighting, completing, shortcuts, ...). Unfortunately this project never made it into a useable state. Writing a text editor is difficult.
I hadn't heard of Safara, but SVI ( http://map.squeak.org/package/ab5ae6be-b705-40a2-8d63-a992442086ec) is (in my opinion) a very successful attempt at modernizing the editor. It comes with vim- and Emacs-like keybindings, which include shortcuts for selecting and navigating through blocks, paren groups, messages and the like--exactly what we're talking about here. It doesn't run on Pharo or trunk Squeak, but it worked just fine in heavy use for me on Squeak ~3.6 through 3.9. I don't have the time to make it run on Pharo right now, but I doubt someone with sufficient motivation would have *that* much of a problem getting it running comfortably. If I recall correctly, the main effort was going to be updating the OmniBrowser integration. --Benjamin
I hadn't heard of Safara, but SVI (http://map.squeak.org/package/ab5ae6be-b705-40a2-8d63-a992442086ec) is (in my opinion) a very successful attempt at modernizing the editor.
It is a hack on top of the Pluggable Morphic editor, that is a hack on top of the Morphic editor, that is a hack on top of the MVC editor, that is a hack on top of the original Smalltalk-80 editor. No joke. Lukas -- Lukas Renggli http://www.lukas-renggli.ch
Lukas Renggli wrote:
SVI
It is a hack on top of the Pluggable Morphic editor, that is a hack on top of the Morphic editor, that is a hack on top of the MVC editor, that is a hack on top of the original Smalltalk-80 editor. No joke.
Hey, I'm doing research on custom key bindings in Pharo. One of the key things (for me) is vim bindings. What makes SVI a hack, and if I was going to start from scratch, what approach would you recommend? Thanks. Sean -- View this message in context: http://forum.world.st/Keyboard-Shortcuts-in-Pharo-tp1298784p2216087.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
On May 14, 2010, at 6:12 AM, Sean P. DeNigris wrote:
Lukas Renggli wrote:
SVI
It is a hack on top of the Pluggable Morphic editor, that is a hack on top of the Morphic editor, that is a hack on top of the MVC editor, that is a hack on top of the original Smalltalk-80 editor. No joke.
I can imagine that easily.
Hey, I'm doing research on custom key bindings in Pharo. One of the key things (for me) is vim bindings. What makes SVI a hack, and if I was going to start from scratch, what approach would you recommend?
have a look at the way this is currently done in paragraph editor and do the inverse :) Now the binding should just be a spec that bind a keystroke to an object receiving a message so we should be able to reuse them. Stef
I've got all three running in Squeak 4.1 trunk. Loading in Pharo will be more complicated due to missing dependencies - maybe not worth it. It might be better to catalogue how they work and come up with something simple and flexible from scratch? There is a solution brewing in my head that generalizes key bindings to a condition and action. So, instead of being restricted to 'when shift and c are pressed' you could say 'when shift and c are pressed and a Workspace is the active morph' The only thing that seems like it will be complicated is vi bindings (don't know enough to say about emacs). For instance, I can't see how normal mode could be implemented without changing some existing classes (for example, the cursor must change). Sean -- View this message in context: http://forum.world.st/Keyboard-Shortcuts-in-Pharo-tp1298784p2217472.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
I've got all three running in Squeak 4.1 trunk. Loading in Pharo will be more complicated due to missing dependencies - maybe not worth it. It might be better to catalogue how they work and come up with something simple and flexible from scratch?
There is a solution brewing in my head that generalizes key bindings to a condition and action. So, instead of being restricted to 'when shift and c are pressed' you could say 'when shift and c are pressed and a Workspace is the active morph'
If I remember (was 8 years ago) the mapping table is shared globally by all paragraphEditor and what you want is that potentially each morph can have its own table. So I would not attach context to a binding. But more the table been attached to a morph would be active. But I do not have a definitive answer. Now a trick used by the VW parser to have sharing and instance specific table is the following The trick to get something cool is to have both a class var and an instance var that represent a table: the method only access the table via inst var, at class initialize the classVar is initialized then at instance creation the inst var points to the class var. => sharing of the class Var but now on a specific instance you can copy the table and set up to a give object and it will be used by the object. while others will share the global table. Workspace class could simply have its own specific table for all instances Roel Wuyts designed the magic shortcut in VW it worked quite well so I think that it would be worth to have a look at them. They got integrated in the VW release. Stef
The only thing that seems like it will be complicated is vi bindings (don't know enough to say about emacs). For instance, I can't see how normal mode could be implemented without changing some existing classes (for example, the cursor must change).
Sean -- View this message in context: http://forum.world.st/Keyboard-Shortcuts-in-Pharo-tp1298784p2217472.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Well, some days ago I downloaded the KeyBindings from monticello in a Pharo 1.1 dev image. It downloaded well allowing the _ as assignment. But it didn't work :/. Maybe I just missed something. Thinking about adding nice and configurable shortcuts to Morphic and after reading some mails in this thread, I had some thoughts (I'm just thinking aloud): 1) Maybe a class variable in Morph to share the global shortcuts and an instance class variable to have specific shortcuts could do it. 2) Buuut, maybe there is a shortcut that is shared in a context bigger than a morph and smaller than "all the morphs". And maybe that context is the model of the morph. In that case I think it would be right to delegate the resolution of the shortcut to the model. 3) I've never used emacs :). Does it have "chords" of shortcuts? I call a chord pressing ((ctrl+A) + (ctrl +e)) to make one and only one action. This should make us mantain the state of the pressed keys... I don´t think this will be a performance issue, but we must have it in mind. 4) How should compound Morphs resolve a shortcut? Should the shortcut flow to the parent morph or not? If so, when should it stop flowing :D? I'm thinking in the System Browser, when the focus is on a paragraph editor but you want to do something with the selected class. Mmm, this is related to 2) :). 5) We should have a well ordered plan to introduce this kind of change. We have to analize and remove every replaceable #keyStroke:. And there should be a simple way to deploy the shortcuts for non-core packages :) What do you think? What I am missing? I want to introduce shortcuts at any cost, je (even if lose sleep hours :) ). Cheers, Guille On Sat, May 15, 2010 at 4:50 AM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
I've got all three running in Squeak 4.1 trunk. Loading in Pharo will be more complicated due to missing dependencies - maybe not worth it. It
might
be better to catalogue how they work and come up with something simple and flexible from scratch?
There is a solution brewing in my head that generalizes key bindings to a condition and action. So, instead of being restricted to 'when shift and c are pressed' you could say 'when shift and c are pressed and a Workspace is the active morph'
If I remember (was 8 years ago) the mapping table is shared globally by all paragraphEditor and what you want is that potentially each morph can have its own table. So I would not attach context to a binding. But more the table been attached to a morph would be active. But I do not have a definitive answer.
Now a trick used by the VW parser to have sharing and instance specific table is the following The trick to get something cool is to have both a class var and an instance var that represent a table: the method only access the table via inst var, at class initialize the classVar is initialized then at instance creation the inst var points to the class var.
=> sharing of the class Var but now on a specific instance you can copy the table and set up to a give object and it will be used by the object. while others will share the global table.
Workspace class could simply have its own specific table for all instances Roel Wuyts designed the magic shortcut in VW it worked quite well so I think that it would be worth to have a look at them. They got integrated in the VW release.
Stef
The only thing that seems like it will be complicated is vi bindings
(don't
know enough to say about emacs). For instance, I can't see how normal mode could be implemented without changing some existing classes (for example, the cursor must change).
Sean -- View this message in context: http://forum.world.st/Keyboard-Shortcuts-in-Pharo-tp1298784p2217472.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
thanks for the pointer. Note also that we should get the textEditor done in CUIS and integrated in squeak. Stef On Dec 13, 2009, at 6:35 PM, Benjamin Pollack wrote:
On Fri, Dec 11, 2009 at 2:44 AM, Lukas Renggli <renggli@gmail.com> wrote: Safara was an attempt to implement a replacement for the current text editor, where nothing was hardcoded but everything could be configured by the tool (highlighting, completing, shortcuts, ...). Unfortunately this project never made it into a useable state. Writing a text editor is difficult.
I hadn't heard of Safara, but SVI (http://map.squeak.org/package/ab5ae6be-b705-40a2-8d63-a992442086ec) is (in my opinion) a very successful attempt at modernizing the editor. It comes with vim- and Emacs-like keybindings, which include shortcuts for selecting and navigating through blocks, paren groups, messages and the like--exactly what we're talking about here. It doesn't run on Pharo or trunk Squeak, but it worked just fine in heavy use for me on Squeak ~3.6 through 3.9. I don't have the time to make it run on Pharo right now, but I doubt someone with sufficient motivation would have that much of a problem getting it running comfortably. If I recall correctly, the main effort was going to be updating the OmniBrowser integration.
--Benjamin _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Sun, Dec 13, 2009 at 9:15 PM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
thanks for the pointer. Note also that we should get the textEditor done in CUIS and integrated in squeak.
yes, that's http://code.google.com/p/pharo/issues/detail?id=1225
Stef
On Dec 13, 2009, at 6:35 PM, Benjamin Pollack wrote:
On Fri, Dec 11, 2009 at 2:44 AM, Lukas Renggli <renggli@gmail.com> wrote: Safara was an attempt to implement a replacement for the current text editor, where nothing was hardcoded but everything could be configured by the tool (highlighting, completing, shortcuts, ...). Unfortunately this project never made it into a useable state. Writing a text editor is difficult.
I hadn't heard of Safara, but SVI ( http://map.squeak.org/package/ab5ae6be-b705-40a2-8d63-a992442086ec) is (in my opinion) a very successful attempt at modernizing the editor. It comes with vim- and Emacs-like keybindings, which include shortcuts for selecting and navigating through blocks, paren groups, messages and the like--exactly what we're talking about here. It doesn't run on Pharo or trunk Squeak, but it worked just fine in heavy use for me on Squeak ~3.6 through 3.9. I don't have the time to make it run on Pharo right now, but I doubt someone with sufficient motivation would have that much of a problem getting it running comfortably. If I recall correctly, the main effort was going to be updating the OmniBrowser integration.
--Benjamin _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Bart on my radar I would like migrate one of the keybinding package of old squeak Keymapper or Keybinding. I would like to have emacs like short cuts..... (yeah ctrl-e ctrl-a.... If you want to have a look and see
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.
Me too :)
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.
I want that :)
- 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.
This is nice.
- 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?
We want that! I hate to be forced to use mouse. We should reinvent code editing.
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Fri, Dec 11, 2009 at 11:00 AM, Stéphane Ducasse < stephane.ducasse@inria.fr> wrote:
Bart
on my radar I would like migrate one of the keybinding package of old squeak Keymapper or Keybinding. I would like to have emacs like short cuts..... (yeah ctrl-e ctrl-a....
+1 :) Laurent
participants (10)
-
Adrian Lienhard -
Bart Gauquie -
Benjamin Pollack -
csrabak@bol.com.br -
Guillermo Polito -
laurent laffont -
Lukas Renggli -
Mariano Martinez Peck -
Sean P. DeNigris -
Stéphane Ducasse