dagda1
dagda1

Reputation: 28890

emacs navigation to beginning or end of code block

in emacs, how can I navigate to the beginning or end of some text like this:

test_rejects_requests_when_given_token_is_invalid

In vim I would do capital E if in command mode but I am not sure how to do this in emacs.

Upvotes: 2

Views: 1588

Answers (4)

draxil
draxil

Reputation: 64

Also in this particular scenario, M-f forward word, M-b back a word. Depending on your local definition of a word!

Upvotes: 0

Jack
Jack

Reputation: 21183

M-m for back-to-indentation takes you to the first text part of the line. This is useful since most of the time code is indented and you don't want to go to the actual beginning of the line (like C-a). As songyuanyao said, C-e takes you to the end of the line.

Upvotes: 3

ntalbs
ntalbs

Reputation: 29458

Try C-M-left and C-M-right, each of which is backward-sexp and forward-sexp, respectively. If you don't want to use arrow keys, then C-M-b and C-M-f also works.

Upvotes: 3

songyuanyao
songyuanyao

Reputation: 172994

Press ctrl-a for move-beginning-of-line, and ctrl-e for move-end-of-line.

Upvotes: 2

Related Questions