ccw-ide / ccw

Counterclockwise is an Eclipse plugin helping developers write Clojure code
https://github.com/laurentpetit/ccw/wiki/GoogleCodeHome
Eclipse Public License 1.0
220 stars 50 forks source link

Cannot use 'splice' keyboard shortcut on win/linux #863

Open alza-bitz opened 8 years ago

alza-bitz commented 8 years ago

How to use 'splice' shortcut on win/linux?

Ctrl + S saves the file.. http://doc.ccw-ide.org/keyboard-shortcuts.html

gilch commented 8 years ago

It doesn't have a keyboard shortcut for splice included in Windows, but the command is there. In the top menu, go to Window->Preferences, Type in "Keys" at the dialog to find the key bindings then under Keys, type in "Splice" to find the splice command. Select it, then add your preferred keyboard shortcut under Binding:, but watch out for conflicts with other shortcuts. (You could even change the conflicting shortcut.)

alza-bitz commented 8 years ago

Ok thanks - I decided to bind 'splice' to ctrl + alt + s (since ctrl + s) is already taken..

Any reason that (ctrl + alt + s) couldn't be made the default for Windows?

laurentpetit commented 8 years ago

@alzadude no reason not to change it for Windows, good idea

laurentpetit commented 8 years ago

@alzadude @gilch It's a low-hanging fruit issue. Do you feel like you could provide a Pull Request for it? It should include the changes in plugin.xml, as well as documentation https://github.com/laurentpetit/ccw/blob/master/doc/keyboard-shortcuts.adoc

gilch commented 8 years ago

I wonder what's the least surprising key combination for this. Are the default CCW bindings based on a plugin for some other tool? Emacs? Vim? We should probably do the same.

laurentpetit commented 8 years ago

@gilch not really. S is for Slurp. I think if ctrl + alt + s works for windows, it could be interesting to do the switch. Then for cohesion, Barf should also be made available via ctrl + alt. Don't know if this will break a command on windows (mac user here).

gilch commented 8 years ago

Are you suggesting we change slurp to Ctrl+Alt+S? Then what should splice be bound to?

I often find that I need to barf or slurp multiple elements at once. The current Windows configuration for slurp is slow because it requires a leader key chord, either Ctrl+0 or Ctrl+), then the command key, either s or left. Similarly for barf and the backwards versions. It would be much nicer to use if it didn't need a leader chord.

I believe Emacs Paredit uses Ctrl+) for forward slurp and Ctrl+} for forward barf. (And symmetrically C-( and C-{ for backwards slurp/barf.) Unfortunately, Eclipse already has Ctrl+{ bound to "Toggle Split Editor (Vertical)" on Windows, so that's a conflict.

If we use Ctrl+Alt+S as forward slurp as (I think) you suggest (and barf as Ctrl+Alt+B for cohesion), then what about backwards slurp and barf? I could suggest Ctrl+Alt+Shift+S and Ctrl+Alt+Shift+B for backwards slurp and barf, respectively. These don't seem to be taken, and it follows the usual convention of a shift doing the opposite of a keyboard command.

alza-bitz commented 8 years ago

I should have probably been a bit clearer in my original comment,

1) I am only discussing the shortcut for 'splice' - this is because it's the only shortcut that doesn't have a binding for Win/Linux (according to the documentation) 2) I am on Linux, not Windows (not that it probably makes a difference in this case, but I guess the lack of a default shortcut will affect users of both equally)

If you want, I can make a PR just for the Ctrl+Alt+S 'splice' binding on Win/Linux (but I can only test on Linux, I don't have a Windows setup I can easily test on)

Let me know :)