Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move to the first word in the line in Emacs?

Tags:

emacs

In Vim, ^ can move the cursor to the first word (non white space) of the line, for example

    The quick brown fox jumps over the lazy dog

here ^ in Vim will move to T of The, but in Emacs, how to move cursor to the first word (non white space) of the line instead of using a series of M-b/f and C-a/e/b/f? Is there any existing command to make it?

Thanks

like image 965
ylzhang Avatar asked Mar 27 '12 07:03

ylzhang


People also ask

How do you go to the beginning of a line in Emacs?

In Emacs there are two essential commands when you have to go the beginning of a line - move-beginning-of-line (bound to C-a ) and back-to-indentation (bound to M-m ). The first takes you to the first column of a line and the latter takes you the first non-whitespace character on a line.

How do I move up a line in Emacs?

You can also move point using the arrow keys present on most keyboards: RIGHT, LEFT, DOWN, and UP; however, many Emacs users find that it is slower to use the arrow keys than the control keys, because you need to move your hand to the area of the keyboard where those keys are located.

How do I move around in Emacs?

The keybindings for movement by word in Emacs is almost the same as that of movement by character, but instead of the prefix C- it is M- . To move forward one word use M-f ; and to move backward one word use M-b . Movement by word will make up the bulk of your intra-line movement.

How do I get to the top of a page in Emacs?

Typing C-l twice in a row ( C-l C-l ) scrolls the window so that point is on the topmost screen line. Typing a third C-l scrolls the window so that point is on the bottom-most screen line. Each successive C-l cycles through these three positions.


1 Answers

In Emacs the same thing is achieved by M-m (back-to-indentation).

like image 64
Bozhidar Batsov Avatar answered Oct 21 '22 05:10

Bozhidar Batsov