1

I've noticed my navigation of my own command-line is rather clunky, e.g. for a command like:

 % someCommand.pl --foo 123 --bar 456 --foobar 789 

My cursor begins on the "9" and I want to move it to just after the "3". I currently do a rather dumb combination of jumping to the beginning of words, then the end of the word.

I'd rather just to a "jump-to-this-specific-character" command. Does emacs have this command? Is there a shorter key sequence to get me where I want?

The problem with doing a ctrl-s incremental search is:

  • I have to explicitly hit "esc" to get out of the search mode
  • If I overshoot the search, I end up searching older commands in my command-line history, which I don't want. I simply want to quickly jump around in the current command.

Am I over-thinking this?

0

1 Answer 1

1

The elisp code fragment

(setq saved-point (point))
(begining-of-line)
(and (searchforward string (line-end-position) t)
     (goto-char saved-point))

will look for the first occurence of string on the current line, and leave the cursor at the current point if there isn't such an occurence.

How do you want to incorporate such code into practice? You could bind a key to be a prefix that waits for the next key, and looks for the string containing just that character.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .