Questions tagged [motion]

is for moving the cursor around the buffer. Emacs provides key-bindings for alternative ways of moving the cursor interactively: by syntactical elements such as characters and words; by forward and backward searches; by arbitrary lines; by units such as sentences, paragraphs, and s-expressions; and by other methods unique to certain modes.

Filter by
Sorted by
Tagged with
2
votes
2answers
315 views

How to use a menu to jump between sections of a document?

I would like to define my own rules for what a section of a document is, then use this so I can popup a list of sections I can auto-complete or use arrow keys to jump between them. Take a simple ...
4
votes
1answer
690 views

Is there a hook I can use to run my function when point moves?

I'd like to add some navigation context to the modeline. I can figure out where I am just fine and give the name of my function, but I don't know how to run this every time point moves. post-command-...
17
votes
5answers
3k views

Stop at beginning of a word on `forward-word`

I often use multiple invocations of forward-word followed by a single backward-word to move point to the beginning of a word on a line. I guess I never got used to the way forward-word differs from ...
8
votes
2answers
1k views

How to persistently move the cursor in a buffer other than the current one?

NB: The post How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`? presumably asks the same question as this one, but the answers given to it do not readily ...
6
votes
3answers
489 views

In shift selection, retain the mark if it's already active

Under shift-select-mode, cursor keys behave like many other text editing environments: Shift+motion starts selecting (sets and activates the mark, in Emacs terms), and motion without Shift stops ...
2
votes
4answers
643 views

A elisp function to jump between matched pair

Here is the function spec: (defun jump-to-matched (open-char closed-char) ) say the content of current buffer is "a([b]c()d)". If I move the cursor over the first "(" and run (jump-to-matched "(" ")...
1
vote
5answers
257 views

Skip vertical whitespace/non-whitespace blocks (sort of vertical M-f / M-b)

Say the point is on the 0 here: as0sasasa asasasasa as1sasasa asa as3sasasa asasasasa as2sasasa I'd like to have a command – like a vertical forward-word – that when run repeatedly would jump ...
9
votes
1answer
4k views

Find position in file by character number

When an error occur in compiling a program in Ghostscript, the error message gives a "Current file position is ..." with a number. I use emacs to edit the program file, so I would like to be able ...
3
votes
1answer
746 views

How to jump up or down to first non-whitespace character in same column

I use evil-mode with Emacs and would like to accomplish this via evil-mode, but would be fine with doing it in an Emacs centric way too. The subject line explains it well, but here is a post in which ...
2
votes
2answers
284 views

Move the cursor backwards to the end of the 1st word on it's between 2 words

If the cursor is placed on a whitespace and there're multiple whitespaces between 2 words, how can I move the cursor backwards to the end of the 1st word?
1
vote
1answer
35 views

How to use mouse click to the right or to the left of the text to move cursor to this line?

On a mouseclick to one side of the text, it can be convenient to make the cursor jump to: the beginning of the line (when clicking left of the text) the end of the line (when clicking right of the ...
1
vote
1answer
194 views

Jump to non-whitespace characters along a column

I'd like to have a command that moves down to the first line of the next string of nonwhitespace characters along the current column, and the analogous commands that move upward, and to the last line ...