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 votes
1 answer
86 views

Put the cursor in the center of the screen in emacs

How can I jump to the center of the screen with my cursor. I tried M-x because it was described as the solution, but that is of course already taken by the function search. Is there an easy way to do ...
David's user avatar
  • 295
0 votes
0 answers
50 views

How to vertically centre the cursor in the line height?

Is there a way to align the mid of the cursor with the baseline of the font? E. g., Here I have adjusted the cursor height to be approximately 1/2 the line height via, (setq-default cursor-type '(...
scribe's user avatar
  • 1,025
0 votes
0 answers
28 views

Get current theme's default cursor color after it's changed

How to get the current theme's default cursor color after it's modified by "set-cursor-color" of other functions that I defined? I thought I was able to get the default color value by ...
Akari's user avatar
  • 43
1 vote
1 answer
91 views

Make Emacs keep empty rectangle for cursor even when buffer is selected

When I deselect a buffer, an empty rectangle is shown in the cursor position. The following image shows the cursor in a buffer which is not the selected one. The following image shows the cursor in ...
rdrg109's user avatar
  • 408
1 vote
1 answer
79 views

How can I define a new `cursor-type` value (a new cursor shape)?

I would like to be able to create a new cursor shape, that is, a new possible value for option cursor-type -- for example an I shape. Is there a way to do that, similar to the fringe cursor bitmap?
Dave's user avatar
  • 11
0 votes
1 answer
156 views

Change cursor blinking status upon state change of evil-mode

I'm using evil-mode. My goal is to have a blinking cursor upon entering evil-insert-state, and to have a non-blinking cursor in evil-normal-state. I tried the following but it doesn't work: (add-...
NewToEmacs's user avatar
0 votes
1 answer
44 views

Recommended way to modify built-in (blink-cursor-timer-)function behavior

I have re-defined blink-cursor-timer-function for the cursor to change colour. How can I modify this without re-defining the build-in function? (defvar ramona-indicator-colour (list "#FFA500&...
Dilna's user avatar
  • 1
2 votes
1 answer
147 views

How to set crossline alike highlighting mode in emacs?

What i'm trying to do here is that, in my buffer I want to point the cursor position through highlighting the line horizontally and column vertically. Much like the CrosshairHighlighting mode. (https:...
Likhon BaRoy's user avatar
0 votes
0 answers
69 views

Get cursor to jump briefly to open paren when I type close paren

Emacs on my computer at work behaves in the following way: When I type a close paren, the cursor briefly jumps to the matching open paren. I like this behavior, but I can't get Emacs on my Mac at home ...
Rodney Price's user avatar
4 votes
1 answer
202 views

Is it possible to wrap a small package not listed on MELPA/ELPA via use-package? How to do it?

I like this Emacs package called Emacs Centered Point link. I must highlight that it is not listed on MELPA/ELPA. Until now, I have just appended the snippet to my init file with the following and it ...
Pedro Delfino's user avatar
3 votes
2 answers
932 views

Disappearing Cursor

This is a problem I have when using GUI Emacs. I don't have this problem with terminal Emacs. After starting it, I don't see any cursor. I've put this at the bottom of my .emacs file (setq-default ...
Jason Hunter's user avatar
2 votes
0 answers
94 views

cursor jumps, words jumbled (emacs in terminal via iTerm2 on macos)

I use GNU Emacs 27.2 on macos (Monterey) in an iTerm2 terminal window. iTerm2 settings are largely default (I have remapped esc to option as my metakey). When I open a file and start editing, things ...
Tom Harrison Jr's user avatar
0 votes
0 answers
38 views

Why does ^g reset my cursor color?

I'm using Emacs 27.2 on macOS 10.13.16 from the railwaycat build. I set my cursor color to a red color using (set-cursor-color "red") As soon as I type controlg, the cursor color reverts to ...
mhucka's user avatar
  • 163
2 votes
0 answers
398 views

Change the size of the cursor

How can I prevent the height of a vertical cursor to be changed if I increase the line spacing? This is my .emacs setup (setq-default cursor-type 'bar) (setq-default line-spacing 1.15)
Yorgos's user avatar
  • 255
0 votes
3 answers
366 views

How to memorise the cursor position and return to it?

Say I was working in a big file somewhere in the middle and all of the sudden I realise that I need to edit the top of the file. I do a M-< to go to the top and make my edits. Now I want to move ...
scribe's user avatar
  • 1,025
1 vote
1 answer
101 views

How to make two fixes to mouse click positioning work together?

There are subtle issues with mouse-click cursor positioning which I try to get fixed. The first patch makes sure that the cursor falls on the correct side of a character when clicked left of right ...
telephon's user avatar
1 vote
1 answer
349 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 ...
telephon's user avatar
0 votes
1 answer
85 views

Emacs cursor border hides the character

Cursor does not show the bottom section such as _ or bottom part of character g. This is the case in emacs -q -nw file.py and also the case in my init.el file. I am not sure how can I fix this issue. ...
alper's user avatar
  • 1,340
0 votes
1 answer
189 views

Binding option + arrow keys/backspace on Mac OS while still being able to enter special characters

I want to be able to bind ⌥← to move the cursor to the previous word, ⌥→ to the next word, ⌥↓ to scroll down a page etc. in Emacs on Mac OS, as in native text editing controls, but also still be able ...
Daphne Preston-Kendal's user avatar
0 votes
2 answers
206 views

Position the cursor at a specific point in a custom Emacs grep command

I have created this custom grep command in Emacs to search for contacts: '(grep-command "grep --color -nH --null grep -ie '^name' -A 1 ~/diary/*.org") I would like to be able to ...
Edman's user avatar
  • 1,197
1 vote
1 answer
278 views

How to make a thin red cursor

This is a newbie question. I'd like to have a red cursor with a width of 4. This code doesn't work: (setf cursor-type '(bar . 4)) (set-cursor-color "#FF0000") how can i correct this to ...
WickedJargon's user avatar
0 votes
0 answers
70 views

Cursor's color differs from what specified in the frame parameters

This question is related to this one: resize-temp-buffer doesn't work in my code when 2 windows are diplayed into the frame If I open emacs from scratch and I evaluate: (frame-parameter nil '...
Gabriele Nicolardi's user avatar
0 votes
1 answer
1k views

How to change cursor color in emacs 27?

Note that I'm using a theme (not sure if that changes things). I have (set-cursor-color "White") But my cursor is still yellow.
Chris Harrington's user avatar
2 votes
1 answer
491 views

Spacemacs move cursor using word wrap, not line breaks

I would like to be able to move the cursor around using the visual buffer, but I don't want to add line breaks to the source file. I'm not sure a better way to describe it, so I got some gif examples. ...
GammaGames's user avatar
0 votes
0 answers
169 views

Few settings doesn't work in -no-window mode

I newbee in Emacs, and trying to set up emacs. Well, I've written a init.el file and except few things always work properly. But in -nw mode cursor doesn't work (blink not working), tabs doesn't work (...
kot_mapku3's user avatar
2 votes
1 answer
319 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 ...
Kevin Wright's user avatar
0 votes
0 answers
109 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 ...
SFbay007's user avatar
  • 584
1 vote
1 answer
945 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 ...
SFbay007's user avatar
  • 584
0 votes
1 answer
261 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 ...
tamifo's user avatar
  • 1
0 votes
0 answers
249 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 ...
Saurabh's user avatar
  • 213
1 vote
0 answers
239 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 ...
xetra11's user avatar
  • 167
1 vote
2 answers
317 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 ...
Arch Stanton's user avatar
  • 1,625
0 votes
0 answers
35 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 ...
CD86's user avatar
  • 563
0 votes
0 answers
325 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 ...
Mishka's user avatar
  • 21
2 votes
0 answers
202 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 ...
mikemtnbikes's user avatar
1 vote
1 answer
160 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.
Chris Stryczynski's user avatar
0 votes
0 answers
94 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"], ...
Jiahao Cai's user avatar
1 vote
0 answers
55 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?...
AhLeung's user avatar
  • 1,083
1 vote
1 answer
171 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 ...
Priceatronic's user avatar
1 vote
1 answer
185 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 ...
Yuki Inoue's user avatar
3 votes
2 answers
902 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 ...
urely's user avatar
  • 63
1 vote
1 answer
307 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 ...
Arch Stanton's user avatar
  • 1,625
2 votes
1 answer
248 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 ...
John DeBord's user avatar
0 votes
0 answers
143 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 ...
John DeBord's user avatar
1 vote
2 answers
303 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 ...
forthrin's user avatar
  • 451
1 vote
5 answers
315 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 ...
Arch Stanton's user avatar
  • 1,625
1 vote
0 answers
168 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 ...
Dmitri's user avatar
  • 173
0 votes
1 answer
121 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 ...
dev1223's user avatar
  • 241
3 votes
1 answer
611 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 ...
Calaf's user avatar
  • 483
2 votes
2 answers
1k 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 ...
kjo's user avatar
  • 3,227