Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cursor]

is for the cursor display and cursor moving operations in Emacs. The cursor point features prominently in Emacs for editing, selecting, and navigating around Emacs buffers.

1
vote
0answers
14 views

How to keep cursor position after quitting undo-tree-visualize

After using undo-tree-visualize and going back to some previous state, I wanna return back to final state (i.e., no undo) with my cursor staying at the position at that previous state. Is it possible?...
1
vote
1answer
27 views

Update point using mouse

I have been trying to add a custom keyboard command that will find a functions definition using S-mouse1. The issue is that I need two mouse clicks for this to work. The first click is to move ...
0
votes
1answer
13 views

forward/backward/next/previous element against YAML?

The lisp program is structured language, and one can execute C-M-f(forward-sexp) to pick the next sibling element. Similarly, C-M-b, C-M-u, C-M-d are defined; they can be used to move the cursor to ...
1
vote
2answers
60 views

How can I make the cursor change to block in overwrite mode?

I got something like that: (global-set-key [insert] (lambda () (interactive) (overwrite-mode) (setq cursor-type 't))) But I don't know how to do it so that when you exit the insert mode (when you ...
0
votes
0answers
45 views

Cursor/Line highlighting in a inactive/non-selected window

While viewing an item within a multi-item result (eg., that of grep) in another non-selected window, the current cursor position in the inactive window is shown by a non-blinking hollow box; see the ...
0
votes
1answer
103 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 ...
2
votes
1answer
59 views

How do I keep the cursor from going to the beginning of the line when there's no text on said line?

I want the cursor to stay in the same column whilst moving up and down on tabbed lines. But instead the cursor goes to the beginning of the line if there's no text on that line. How do I get rid of ...
0
votes
0answers
41 views

Terminal cursor movement stutters when mouse cursor is hovered over terminal

I using emacs-nox with Ubuntu 16.04LTS. The problem I'm facing is that whenever my mouse cursor is hovering over the terminal window, I experience very stuttery cursor movement. As you can see in ...
1
vote
2answers
69 views

How do I return to where I was before i-search, goto line, etc

Let's say I'm on line Y, char X, and then do an i-search or do a goto line. Then I move around there a bit, but then I want to return to Y, X. How do I do this? Is there an automatic mechanism that ...
1
vote
5answers
184 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 ...
1
vote
0answers
44 views

Dynamically change cursor color to indicate input script

I'd like to use the cursor color to provide visual feedback on the alphabet I am currently in (I sometimes have to switch rapidly between, say, Latin and Cyrillic, and find myself typing in the wrong ...
0
votes
1answer
62 views

Strange regex behavior

I want to skip blank region under cursor, so I created this regex: \s+\w translated to emacs regex [:space:]+[:graph:] but it doesnt match what I want. It matches some random space somewhere! Whats ...
1
vote
1answer
80 views

How can I highlight cursor or line in unselected frames?

Prelude Let me start by mentioning the scenario where the problem arises. I see that 2-3 variables are always used together in a system. I need to add yet another one that will be used along with ...
0
votes
0answers
192 views

Cursor disappears when point is at a leading star and org-hide-leading-stars is non-nil

In non-graphic mode I set org-hide-leading-stars to t. Unfortunately, under these circumstances, whenever point is on a leading star, the cursor disappears altogether. IOW, not only the leading star ...
2
votes
1answer
53 views

Using ggtags tag lookup along with centered-cursor-mode

I am using centered-cursor-mode to center the cursor at 10 lines above center at all times. I am trying to have ggtags respects this setup after each tag lookup. When I have the cursor at any point ...
4
votes
2answers
352 views

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

Is there a way to define a function that, when called, would move the cursor to the middle (or close to the middle) of the current line, similarly to how we can move it to the beginning and end of the ...
0
votes
1answer
42 views

Tab completion in minibuffer moves cursor out of minibuffer

Problem: When pressing TAB in the minibuffer to get completions, the cursor is moved to the window of whatever file I am editing. Expected result: Pressing TAB in the minibuffer should keep the ...
0
votes
1answer
178 views

How to set `evil-insert-state-cursor` to a function?

In evil-mode, the cursor shape and colour for each state is controlled by the series of variables evil-*-state-cursor. The documentation for these variables states: May be a cursor type as per ...
0
votes
1answer
80 views

Custom behavior for cursor-in-non-selected-windows on first line

I like the hollow option because I know where the cursor is when I switch windows. I use ace-window to change windows. My problem is the ace character is difficult to read when the hollow cursor is on ...
0
votes
1answer
62 views

How to keep cursor position after calling ediff-current-file?

I would like to use ediff-current-file to jump to some of my previous changes/edits. However, when I type 'q' to quit ediff after calling ediff-current-file and navigation (using 'p'/'n'), the cursor ...
0
votes
1answer
111 views

How to jump out of any surrounds?

Not just parenthesis, but any surround. We are given the advantage of a pair being made and the cursor conveniently placed within. That's only 1/2 the procedure; what about jumping out? Previous (...
3
votes
1answer
86 views

Cursor colour based on input method

How can I let the cursor colour depend on the current input method?
2
votes
3answers
126 views

Storing previous cursor positions

I would like the ability to go back and forth through a series of stored recent cursor positions, say up to 100 of them. Specifically, a position should be recorded when I click somewhere, or when I ...
1
vote
1answer
249 views

Navigate cursor position history with line-based jumps

I use point-undo to jump between positions in the cursor history. However, point-undo uses every previous position of the cursor, and I often experience that what I actually want is to jump just to ...
0
votes
0answers
28 views

ssh to a remove host and use emacs in the ssh session, cursor always move to the beginning of the screen when save file

I have a VPS server and I always ssh to it and us emacs in the ssh session. I found that when I save a buffer the cursor always move to the beginning of the screen. How to disable this behavior? I don'...
1
vote
1answer
80 views

Set start cursor in code window instead of speedbar

I have sr-sppedbar always turned on, but whenever I start, I have to manually click the code window to switch the cursor from speedbar to the codes. How do I start emacs with cursor in the main window ...
1
vote
1answer
712 views

Unable to change cursor type in terminal

I'm trying to change the cursor type in Emacs. Here are the steps I'm following, C-h v cursor-type check the value of cursor type. It is set to t. start emacs with emacs -nw -Q and type (setq cursor-...
0
votes
0answers
137 views

Cursor is not visible

I recently ported my .emacs.d directory (github link) from my Macbook Pro running Mac OS to a Lenovo Thinkpad T460p running Xubuntu 16.04. This has introduced the problem that the text cursor is no ...
2
votes
2answers
170 views

Move to the beginning of a heading smartly in Org-mode

I just started with Org-mode today and noticed whenever I press C-a on a heading, the cursor is moved all the way to the beginning of the line instead of the first character in the heading. Like so :-...
2
votes
2answers
200 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?
3
votes
1answer
92 views

kill the current line and preserving cursor position

I'm using the slick-cut function (as answered here by itsjeyd) for killing the entire line with minimal keystrokes. It's defined like so :- (defun slick-cut (beg end) (interactive (if mark-...
0
votes
0answers
22 views

Call avy-go-to-char before a command if there's no mark active [duplicate]

There are some commands which I only call when I've got a region selected because I only want these commands to operate on the region. Like for example, say, mc-edit-beginning-of-lines. For example ...
7
votes
2answers
542 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 ...
3
votes
2answers
995 views

Mouse pointer between characters and the text cursor misplacement

Mouse cursor position interpretation in emacs drives me nuts. Why draw the mouse cursor in emacs window with vertical thin bar if you cannot effectively position it between characters? Selecting ...
1
vote
1answer
65 views

Keystroke for moving cursor to beginning/end of document

From many Emacs documentation sources, it's clear that when I have a document open, I should be able to press M-< and M-> to go to the start and end of that document respectively. Alternatively, I ...
0
votes
0answers
212 views

Change cursor-type in MinTTY

I'd like terminal Emacs to observe the current value of cursor-style when the current terminal emulator supports commands to change the cursor. For example: MinTTY is the default terminal emulator ...
6
votes
1answer
560 views

How to set the foreground color of the cursor face?

I tried to set the foreground color of the cursor face, but it does not seem to work. Setting the background color works fine, but setting the foreground color does not have any effect. I would like ...
0
votes
0answers
516 views

Can't remove cursor blinking in console mode

Emacs 24.3.1, OS: Linux Slackware 14.1. In my ~/.bash_profile file I have the following: # If on console, change cursor colour according to # /usr/src/linux/Documentation/VGA-softcursor.txt # Reset ...
0
votes
2answers
65 views

How to know that cursor is surrounded by specific text

Can we know, that we are in the following position: text1 ... <cursor> ... text2 But this doesn't count: text1 ... text2 ... <cursor> ... text2 text1 ... <cursor> ... text1 ... ...
4
votes
1answer
366 views

Undesirable Cursor Jump After Movement with M-left or M-right in Term-Mode

When I reposition the cursor in term-mode or ansi-term with M-left or M-right, it always returns to its original position (see animation below). Is this behavior standard? Is there a way to change it ...
1
vote
1answer
145 views

Change cursor-type in helm-header-line?

I have configured helm to hide the minibuffer and show the input in the header line following this instructions. The relevant code is this: (defun helm-hide-minibuffer-maybe () (when (with-helm-...
2
votes
0answers
86 views

Insert to the right of cursor

Q: What is the simplest way to insert text without moving the cursor? Is there a command, say insert-right-of-point, that does just that already? I did not find one and gave up after several C-h a. ...
0
votes
1answer
391 views

How do I set cursor colours per evil-state in the (non-GUI) text terminal?

In the terminal, (set-cursor-color "red") has no effect, so the only way I can distinguish insert from normal mode under evil-mode is through the <N> or <I> on the modeline. Is there a way ...
0
votes
0answers
23 views

Flickering cursor [duplicate]

Fairly often after doing some editing I will notice the cursor flickering. It blinks a little with an interval between blinks of around a couple of seconds -- but the intervals seem semi-random. It ...
0
votes
2answers
534 views

In shell, eshell and comint-modes, the cursor moves back one chacacter when I switch buffers

When I'm in a shell and I change buffers, if I switch back to the shell buffer, the cursor has moved back a character and I can't start typing new shell commands until I hit -> first. This happens ...
3
votes
0answers
791 views

Highlight current line and column

Is there a solution to highlight current line and column where the cursor is now? I tried this plugin, but then emacs motion are lagging like hell. I was able to highlight the line (global-hl-line-...
4
votes
1answer
161 views

How to disable the hollow box cursor in auto completion buffer?

When you hit Tab in M-x for auto completion, the buffer comes up with options as well as a hollow box cursor. Is that really required? I don't find it intuitive because I can't actually navigate in ...
3
votes
0answers
638 views

fast moving cursor?

What can I add to my .emacs to make the cursor move more quickly? Specifically, I'm looking for faster rates for (holding arrow-keys and C-arrow keys (ie skipping over whitespace with my current ...
5
votes
4answers
873 views

Emacs cursor color is different in daemon and non-daemon modes

There's some weird stuff I encounter when running Emacs under KDE. Here's how it looks when I run it normally, via the emacs command: If I run it as a daemon, here's what I see: And if I run ...
12
votes
1answer
290 views

Why doesn't M-v following C-v move cursor back to the original position?

M-v following C-v doesn't move the cursor back to the original position. Why is that? Can we make it happen?