yonglehou / ergoemacs

Automatically exported from code.google.com/p/ergoemacs
0 stars 0 forks source link

Forward/backward-sexp, kill-sexp, and c-beginning-of-defun/c-end-of-defun #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think that there are some functions that need new shortcuts (anyway I 
don't know where we could put then). I don't measure the frequency of 
these commands (not at least so much time to give you a number), but I 
remember to use then a lot (in C/C++ programming mainly):

Ctrl+Alt+a = c-beginning-of-defun
Ctrl+Alt+e = c-end-of-defun
Ctrl+Alt+f = forward-sexp
Ctrl+Alt+b = backward-sexp
Ctrl+Alt+k = kill-sexp      (I had never use backward-kill-sexp)

I think that these are the most useful commands to move inside C/C++ 
source code. But maybe we need a better analysis (command-frecuency per 
mode, with C++ programmers, etc.).

Original issue reported on code.google.com by davidcapello on 4 Sep 2009 at 3:33

GoogleCodeExporter commented 9 years ago
I agree.

i don't code C. Closest is Java, but even that i don't code much. Mostly i code 
in 
high level langs, e.g, perl, python, javascript, php, elisp.

i've been using the following for perhaps 2 years:

;; for lisp mode
(global-set-key (kbd "M-<up>") 'backward-up-list)
(global-set-key (kbd "M-<down>") 'down-list)
(global-set-key (kbd "M-<left>") 'backward-sexp)
(global-set-key (kbd "M-<right>") 'forward-sexp)
(global-set-key (kbd "M-S-<left>") 'backward-list)
(global-set-key (kbd "M-S-<right>") 'forward-list)

the last two i haven't used much.

Mostly i use them in elisp, but also frequently for navigatng any nested pairs.

i use them only personally. I thought about including them in ergoemacs... but 
not 
certain about it.

by emacs default, Ctrl+Alt+arrow also work for these, and seems logical, but 
just 
cumbersome to use.

perhaps Alt+Ctrl+ (ijkl) could be used... or some Alt+Shift. We could also put 
g and 
r for beginning/end of defun.

I don't know. I think these are getting into more personal usage and 
preferences, not 
as general.

perhaps we can wait on this? Am thinking, get our software out with other more 
critical issues first. When there starts to me more people using, ideas on 
enhancing 
this may emerge more readily.

btw, do you want to try to log your command usage? there's a command frequency 
package. At this point, i don't think the stat will effect the basics of 
ergonomics 
layout... but i needed more data. I actually don't have that much solid 
statistics. 
The stat i have is mostly me, and 2 other emacs user.

Original comment by xah...@gmail.com on 5 Sep 2009 at 1:12

GoogleCodeExporter commented 9 years ago
> [...]  I don't know. I think these are getting into more personal
> usage and preferences, not as general.

Yes, I'm agree.

> perhaps we can wait on this? Am thinking, get our software out with
> other more critical issues first. When there starts to me more
> people using, ideas on enhancing this may emerge more readily.

Yeah, that's right.  Also, the more probable thing that could happen
is to get common writers/programmers using Emacs as the most basic
editors (with standard shortcuts / without pressing Alt key at all).

> btw, do you want to try to log your command usage? there's a command 
frequency 
> package. At this point, i don't think the stat will effect the basics of 
ergonomics 
> layout... but i needed more data. I actually don't have that much solid 
statistics. 
> The stat i have is mostly me, and 2 other emacs user.

Sure, to be sincere, I had been using it from the beginning (when
I read about it in ergoemacs keybindings docs). I use it at job and
home, so I have various .emacs.frecuencies. I'll be send you
these files in the near future.

To conclude, I marked this issue with low priority for now, if you
want we can close it, but I think that it could be a recurrent subject
for newcomers (mainly from GNU Emacs programmers).

Original comment by davidcapello on 6 Sep 2009 at 5:41

GoogleCodeExporter commented 9 years ago
Super for using the command-frequency.el. Thanks a lot. Yeah, leave this issue 
open 
sounds good.

PS i made a typo in previous comment. I wrote: “perhaps Alt+Ctrl+ (ijkl) 
could be 
used... or some Alt+Shift. We could also put g and r for beginning/end of 
defun.”.

That g and r should be u and o. (any case any one comes reading this later and 
got very 
confused) ☺ 

Original comment by xah...@gmail.com on 6 Sep 2009 at 6:12

GoogleCodeExporter commented 9 years ago
> That g and r should be u and o.
I have noted that (qwerty and dvorak mixed in the same paragraph :)

Original comment by davidcapello on 6 Sep 2009 at 6:51