Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to move cursor a line at a time?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to move cursor a line at a time?
Authored by: steresi on Aug 31, '07 02:00:33PM

I often have a long command on the command line and would like to move through it by "lines" (say, about 130 characters). If I have a command that spans 3 or 4 lines in Terminal, is there any way to move right to the middle of it, or move back 100 characters at a time?



[ Reply to This | # ]
How to move cursor a line at a time?
Authored by: boxcarl on Aug 31, '07 02:28:23PM
How to move cursor a line at a time?
Authored by: brettmjohnson on Sep 01, '07 01:34:49PM
... is there any way to move right to the middle of it, or move back 100 characters at a time?"

Bash uses readline as its command line editor. Nearly every readline command may be preceded with a numeric multiplier argument. For instance, M-4 M-f moves forward 4 words, and M-100 C-b moves backward 100 characters.

As mentioned previously, if you don't have a Meta key mapped, use Esc instead.

[ Reply to This | # ]

How to move cursor a line at a time?
Authored by: steresi on Sep 03, '07 10:47:41PM

Excellente!!!



[ Reply to This | # ]
How to move cursor a line at a time?
Authored by: bryanc on Sep 06, '07 04:14:42PM

If your commands are that long, you might also find it useful to edit the current command-line in your default text editor. Just press C-x C-e.

When you quit the editor the command is executed as normal.

(You can change the editor used by setting the $EDITOR environment variable, it uses emacs by default I think).

If you use vi-mode for the shell, the keybinding is esc-v. (or just v if your not in insert mode).



[ Reply to This | # ]