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.

Filter by
Sorted by
Tagged with
1
vote
1answer
10 views

Cannot change cursor type on Windows 10

I've used emacs on Windows 10 for a year. Recently, my "box" cursor in emacs has become a thin vertical line. I have tried setting the variable "cursor-type", but this no longer seems to have any ...
0
votes
0answers
35 views

How to center cursor/point at top lines in buffer

I use centered-cursor-mode but it does not center for any lines 1 - lh/2 of a buffer, where lh is the line-height of the window. Is there a way to still have the cursor centered at these lines near ...
0
votes
0answers
19 views

mac-mwheel-scroll screws centered-positon-mode when using mouse pad on a macbook laptop

I am able to scroll using navigation buttons and external mouse on a Mac with this code that keeps the cursor at a specific line at all times. I am using this code since it is much faster than ...
1
vote
1answer
101 views

How to scroll using mouse while keeping cursor on same line/position?

I am using this minor mode to scroll and keep cursor on same line, mwheel-scroll however screws up the smooth scroll since it moves the cursor to a different line, scrolling return the cursor back to ...
0
votes
0answers
14 views

Trying to fix cursor position on screen screwed up mwheel on mac

I use this simple solution to always have the cursor at around 1/3rd of the top of the page. It has been working great and much faster than centered-cursor-mode. However, I noticed scrolling with ...
0
votes
1answer
67 views

cursor color depending on insert or overwrite mode

how can I change the cursor color depending on insert or overwrite mode? I looked at this page https://www.emacswiki.org/emacs/ChangingCursorDynamically and put as recommended 3 lines in the Emacs ...
0
votes
0answers
25 views

How to insert a new space before cursor?

I have links in Org mode that are at the beginning of the line and I struggle to add space before them in the insert mode. It would be great if there was a way to insert a space before the current ...
0
votes
0answers
40 views

Mark Cursor Vertically on Multiple Lines

I can enter rectangle mark mode with C-x SPC, and then do C-p or C-n to set mark to the line above or below. How do I vertically mark multiple lines in one go without having to do C-p or C-n multiple ...
1
vote
0answers
40 views

How to navigate SPC commands with Vim cursor?

I am very used to Vim keys BUT I love to use Emacs. That's why Spacemacs in Evil mode is perfect for me. There is one thing I still cannot figure out how to do. I don't know how to use h,j,k,l for ...
0
votes
2answers
105 views

Save place in files but don't move the cursor to the saved position automatically

I'd like to have a command that moves the cursor to the last position it was in when I left the buffer (either by killing it or by killing Emacs). I know I can use saveplace.el to save the position ...
0
votes
0answers
27 views

Emacs not active when switching from different workspace

this repulses me to my core. Every so often when I switch to my emacs from a different workspace (awesome wm) the cursor appears just as an outlined box and is not active until I switch back and forth ...
0
votes
0answers
59 views

org-mode: How to change cursor type for variable-pitch mode?

I have the following block of lisp codes in my .emacs config to enable variable-pitch mode for Org-mode. It is working fine however the cursor has changed from the default block to a thin line. Could ...
2
votes
0answers
57 views

Why is cursor moving after a save?

When working with the same buffer in multiple windows within one frame, it seems like the location of the cursor in, say, window A gets inadvertently set as a marker such that right after the buffer ...
1
vote
1answer
66 views

How do I move the cursor in helm?

How do I move the 'cursor' to the left/right in helm when typing a filepath? Currently my left arrow seems to be mapped to a backspace / clear word. I'm using Spacemacs in evil mode.
0
votes
0answers
41 views

Weird cursor position of emacs 26.1 on macOS 10.12.6

I am new to emacs and I met a weird emacs problem, which I don't even know is a feature or what :) Behavior: The emacs is in the text-mode and turned off all the plugins, and I want to type ["ls"], ...
1
vote
0answers
25 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
62 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
48 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 ...
2
votes
2answers
292 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 ...
1
vote
1answer
149 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
109 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
75 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
87 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
223 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
86 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
79 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 ...
3
votes
1answer
187 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 ...
1
vote
0answers
446 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
113 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
563 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
60 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
323 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
127 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
89 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
241 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
108 views

Cursor colour based on input method

How can I let the cursor colour depend on the current input method?
3
votes
6answers
267 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 ...
2
votes
1answer
322 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
35 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
114 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
2answers
1k 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-...
2
votes
2answers
354 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
253 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
2answers
152 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-...
8
votes
2answers
888 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
2k 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
77 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
299 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 ...
8
votes
3answers
828 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
752 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 ...