Skip to main content
28 votes
Accepted

Emacs point(cursor) movement lag

I have found an answer to my question through narrowing down the naughty bit and googling. I have managed to reduce the lag 10 TIMES!!!! I mean....It is insane on how much computing power next-line ...
Damian Chrzanowski's user avatar
19 votes

Find position in file by character number

Depending on what is that number, e.g., 47 (line, character-position, etc) you can do M-x goto-line 47 or M-x-goto-char 47.
Name's user avatar
  • 8,037
12 votes

What is the correct way skip to prev/next method/function definition?

Use C-M-a (beginning-of-defun) to move backward before each "defun" (top-level sexp). Use C-M-e (end-of-defun) to move forward after each "defun". To move across several by repeating, just hold down ...
Drew's user avatar
  • 79.1k
10 votes
Accepted

org: move point to beginning of an item

Consider to customize variable org-special-ctrl-a/e. Possibly that will ease your flow. From the documentation. Note in particular the "item" part. When t, ‘C-a’ will bring back the cursor to ...
Marco Wahl's user avatar
  • 2,916
9 votes
Accepted

Move cursor to beginning of visible text in current buffer

Ah, you're looking to move point to the top or bottom of the window. M-r calls move-to-window-line-top-bottom which cycles through the top/middle/bottom positions. You can also use a prefix argument,...
phils's user avatar
  • 53k
9 votes

How to jump to matching (double or single) quote of a quoted string?

M-C-f (or M-C-right) bound to forward-sexp should do that. I suggest you try all well-known motion commands with the prefix M-C- instead of C-. M-C-b (or M-C-left) gives backward-sexp M-C-u (or M-C-...
Tobias's user avatar
  • 33.7k
6 votes
Accepted

How to scroll to the beginning of the line in Emacs

The window has been scrolled left (scroll-left) for some reason. C-x < or C-<next> can get you into this state. C-x > or C-<prior> can get you out of this state. Note those commands ...
jue's user avatar
  • 4,686
6 votes
Accepted

How to move from one source block to another, in Org-mode?

Yes, there is, run M-x org-babel-next-src-block. The default keybindings for this function are C-c C-v C-n and C-c C-v n. See also the subsection Key bindings and Useful Functions in the orgmode ...
fjesser's user avatar
  • 76
5 votes
Accepted

Moving cursor to the middle of the line where it currently is

The following function moves the cursor to the middle of the current line: (defun my/move-to-middle () (interactive) (let* ((begin (line-beginning-position)) (end (line-end-position)) ...
Arnot's user avatar
  • 671
5 votes
Accepted

Move cursor left/right while entering isearch

You can run the command isearch-edit-string pressing M-e. See the documentation for details.
matteol's user avatar
  • 2,088
5 votes

Is there an emacs command to go to end of code line (before line comment and whitespaces start)

Here's a quick command, lightly tested, that does what you're looking for. (defun eol-dwim () "Go to the end of the line, ignoring comments and trailing whitespace." (interactive) (let ((bol (...
Dan's user avatar
  • 33.4k
5 votes

How to calculate a point N lines from another point in elisp?

This can be done using save-excursion, then moving the cursor. (defun point-calc-lines-offset (pt lines) (save-excursion (goto-char pt) (forward-line lines) (point))
ideasman42's user avatar
  • 9,157
5 votes

How do I capitalize the first words of sentences in some buffer text?

(I assume you meant text in a buffer, and not a string (as the original question said). M-e M-c (press and hold Meta while hitting e, then c. The M-e moves forward-sentence. The M-c does capitalize-...
Drew's user avatar
  • 79.1k
5 votes

goto-char support for hexadecimal input

I can't imagine this very basic thing such as input a Lisp expression inside a value input is not possible. It is because there is no need to do that. In Emacs, this behavior can be changed easily: (...
shynur's user avatar
  • 5,890
4 votes

next/prev-imenu-item function

(defun my-imenu-goto--closest-dir (direction) "Jump to the closest imenu item on the current buffer. If direction is 1, jump to next imenu item. If direction is -1, jump to previous imenu item. See ...
AhLeung's user avatar
  • 1,113
4 votes

New line in cursor-intangible area and line-beginning position

Applying field property to intangible area solves the problem. Adding of field t to the properties of INTANGIBLE makes move-beginning-of-line putting point between INTANGIBLE and fooooo, like ...
Shmozart's user avatar
4 votes

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

This is exactly what Imenu is for. You can define positions to jump to using a menu. The menu can be in the menu-bar or popup, or you can use completion against it as a popup (e.g. in buffer *...
Drew's user avatar
  • 79.1k
4 votes

Move cursor left/right while entering isearch

@matteol answered your question. Here is some further info about this. During Isearch, keys you press that are defined in isearch-mode-map act according to their bindings there. Keys that are not ...
Drew's user avatar
  • 79.1k
4 votes
Accepted

is there a keybinding to save curor position for returning after viewing other section of same buffer?

@Aaron answered well with the usual way to take care of this in Emacs: set a mark where you are now, then get back to it later using C-u C-SPC. Another way is to use a bookmark, in particular a ...
Drew's user avatar
  • 79.1k
4 votes
Accepted

Is there an emacs command to go to end of code line (before line comment and whitespaces start)

The package mwim offers this functionality. By setting (global-set-key (kbd "C-e") 'mwim-end) you get behavior similar to what you described. The package also offers the corresponding mwim-...
clemera's user avatar
  • 3,476
4 votes
Accepted

Is it possible to ignore paste operation during `C-x C-x` to jump back?

Each command that sets the mark pushes the previous mark onto a stack. More precisely, the previous position is added to the mark ring (the difference between a mark and a ring is that accessing the ...
Gilles 'SO- stop being evil''s user avatar
4 votes

Jump to the end of body of headline

I'm not aware of a function that does this (someone will correct me if there is), but you can write your own by getting the :contents-end property from an org element and going to that buffer location....
kozina-adjacent's user avatar
3 votes

Moving cursor to the middle of the line where it currently is

While this doesn't directly answer your question (I think Amot already covered that part just fine), I'll just point out that many Emacs users solve these kinds of problems by navigating with C-s, i.e....
Stefan's user avatar
  • 26.7k
3 votes
Accepted

Navigating lisp

Please check out Moving in the Parenthesis Structure, specifically: C-M-f, which runs the command forward-sexp C-M-b, which runs the command backward-sexp C-M-d, which runs the command down-list To ...
sds's user avatar
  • 6,214
3 votes
Accepted

How to make end-of-buffer move to the last line not beyond it?

The command end-of-buffer uses a variation on (goto-char (point-max)) to go to the last position in the buffer. If the buffer ends with a newline, end-of-buffer will leave you on the empty line at the ...
glucas's user avatar
  • 20.9k
3 votes
Accepted

Point motion strategy for Emacs 25 and older

The two systems work in fundamentally different ways, so you can't easily have a 100% solution that unifies the two, but your approach looks OK. The only thing I'd recommend is to do the emulation ...
Stefan's user avatar
  • 26.7k
3 votes
Accepted

Finding Like Variables or Functions

Different modes (e.g. languages) have different notions of variables and functions, so finding them can be mode-specific. A general answer, which lets you move forward among occurrences of the name ...
Drew's user avatar
  • 79.1k
3 votes

Emacs point(cursor) movement lag

I'm not absolutely sure what is the problem, but your profiler report seems to indicate that posn-at-point performs more redisplay than expected, which in turns causes recomputation of the mode-line, ...
Stefan's user avatar
  • 26.7k
3 votes

is there a keybinding to save curor position for returning after viewing other section of same buffer?

Whenever I make a large jump in a file, I press C-SPC C-SPC first. That sets the mark to the current value of point*, effectively remembering the current cursor position. Then, once I'm done ...
Aaron Harris's user avatar
  • 2,684
3 votes
Accepted

How to tell Occur to show the line in the top of the buffer

You can scroll the window in occur-mode-find-occurrence-hook such that point is at the top of the window: (defun my-occur-recenter () "Scroll point to the top of the window." (recenter 0)) (add-...
Tobias's user avatar
  • 33.7k

Only top scored, non community-wiki answers of a minimum length are eligible