Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [cursor]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
3 answers
12 views

How to remember and recall cursor position?

Imaging I'm editing some code, and I found a few words that I would like to paste at the current cursor position elsewhere in the file. I will go to them, yank them, but then how do I return back to ...
user avatar
0 votes
1 answer
23 views

vim - why is the cursor different in different terminals

I have vim 8.2 installed on my Debian machine and when I open it in a gnome-terminal it has a solid non-blinking box as a cursor. But when I open a "pure" terminal with ctrl+alt+F3 and open ...
user avatar
0 votes
1 answer
36 views

How can I get netrw to not move the cursor when I return to it

When I open a directory in netrw by opening vim like vim ., it will show me a list of files in the current directory. If I find a file then press t it will open that file in a new tab, when I'm done, ...
user avatar
  • 193
0 votes
0 answers
24 views

(Code review) Copying file path relative to cwd with the line number appended

I am replicating what PHPStorm and VSCode do by allowing me to copy the file path and line number (plus column) to clipboard. I have written a function in lua to do this, but, I wanted to ask about ...
user avatar
0 votes
1 answer
32 views

Cursor not changing to beam in insert mode when using Kitty terminal

Well the common problem again. I could fix my problem for Konsole by adding " Fix cursor for Konsole let &t_SI = "\<Esc>]50;CursorShape=1\x7" let &t_EI = "\<Esc>...
user avatar
  • 123
1 vote
1 answer
66 views

set cursor to block

I am trying to set the cursor as a block/box that surrounds the current character as opposed to a line cursor: This is my default that I got pressing :set guicursor=<Tab> :set guicursor=n-v-c:...
user avatar
  • 153
1 vote
0 answers
25 views

Strange character littering the buffer on the cursor line

When I edit a file in vim on my laptop running OL8 (a RedHat variant) inside a gnome terminal, there is a strange character on the left margin of the cursor line. The character is "sticky", ...
user avatar
1 vote
0 answers
30 views

Wrong column highlight on lines containing references or links

I've recently taken up nvim and came accross a weird issue. I've turned on cursor position highlighting for both lines and columns (set cursorline and set cursorcolumn), and usually it works as ...
user avatar
  • 111
0 votes
1 answer
25 views

How to know current setting for guicursor shape on Gvim?

I know how to change cursor's shape when using Gvim: set guicursor=**options_here** The problem is, it seems like guicursor cannot be echoed as far as I know, even though setting it as above works: ...
user avatar
0 votes
1 answer
40 views

How to change foreground color of character underneath cursor?

I've tried setting the highlight rules below but it does not work. Whatever color I choose, the color of the character stays the same. I'm using xfce4-terminal on Linux and Terminal.app on Mac OSX. ...
user avatar
  • 103
0 votes
0 answers
36 views

Change the cursor appearance in :terminal that uses cmd.exe?

How can I change the style of the cursor in :terminal under Win32 gvim? Using a clean config my cursor in Terminal mode (typing to shell) looks too much like my cursor in Terminal-Normal mode. gvim --...
user avatar
  • 485
0 votes
1 answer
40 views

How to insert on a newline, pushing everything after the cursor down with it

Say my cursor is []: (A very intelligent turtle[)] I'd like to issue something like o that would put me in insert mode here: (A very intelligent turtle [)] I'm using spacemacs.
user avatar
0 votes
1 answer
83 views

How to replace selected text T with some function(T), using a keyboard shortcut?

I want to annotate words /sentences for a "named entity recognition" purpose; inside a text file, I want to annotating words or sentences with this format [pattern](label): [a word where the ...
user avatar
-1 votes
1 answer
50 views

Problem setting cursor colors in vimrc: suppress the `-ne` that is written to my xterm on exit

Following the vim manual and also some threads on this site, I can set the color of my cursor to orange in insert mode and red otherwise, with the following lines in my .vimrc file. " use an ...
user avatar
  • 625
0 votes
2 answers
56 views

How to move `n` number char <left> in vim command line?

My init.vim code autocmd FileType cpp nnoremap <F4> :RunWithFile ~/Downloads/ > output.txt && cat output.txt I want my cursor position to be exact 31 times <left> in command ...
user avatar
  • 111
2 votes
1 answer
112 views

Restoring cursor to position before delete after Undo

This question is asked multiple places but none have an answer that works for me. I've tried: '' `` g; g, ; , Ctrl+o In a file add: 123456789 Move your cursor over 7 in normal mode, type d4h, press u....
user avatar
  • 133
1 vote
1 answer
351 views

How to disable scrollbind and cursorbind after using vimdiff?

I have this issue where I need to both compare files, which I do using vimdiff, but also work on individual files with vertically split screens (vs). However, after I call vimdiff on a file, opening ...
user avatar
  • 113
0 votes
0 answers
55 views

Cursor disappearing

I'm using pywal and the wal colourscheme and since enabling it my cursor seems to have disappeared, meaning it has the same colour as my background (that's what I guess) and I only see it blinking ...
user avatar
  • 101
0 votes
0 answers
123 views

Changing the block cursor color

I have been trying to play around with a few color scheme configurations for the cursor, however nothing I type in the command panel seems to change it. Is the hilight syntax supposed to be completely ...
user avatar
0 votes
1 answer
51 views

Why does the cursor end up on the wrong line when <Esc><Esc> is mapped to something?

In vim --clean, I insert these lines: One Two Three Four Five Six Then I do: :set mouse=a :nnoremap <Esc><Esc> <Nop> (From my observations, the mapping could be to anything. :...
user avatar
  • 801
0 votes
2 answers
58 views

cursor position past EOL

Given the following setup edit a long line short move the cursor to line 1, column 9 (> 6 anyway) move down and up again I see that when moving to the short line, the column becomes at most 6 (...
user avatar
  • 325
4 votes
1 answer
439 views

How to move cursor to previous line automatically?

On nano&emacs&any other text editor, when the cursor is at the 1st character of a line (not the 1st line), press the left key and it will automatically jump to the last character of previous ...
user avatar
0 votes
1 answer
26 views

how to make the scrollwheel work in the window created by `vert term`?

OS version: uname -a Linux mydebian 4.19.0-14-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64 GNU/Linux vim verson: vim --version VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15) ...
user avatar
  • 820
2 votes
2 answers
1k views

How do I make the cursor blink?

set guicursor=n:blinkwait5-blinkon5-blinkoff5 has no effect. Why is that? mp4
user avatar
1 vote
1 answer
825 views

Can Vim remember cursor position as well as lines displayed?

I would like Vim to remember both the cursor position and the lines displayed, for example, in the screenshot line 26 to line 46 are shown, and cursor is at line 44. If I exit as it is now, is it ...
user avatar
  • 199
1 vote
1 answer
94 views

place cursor after bracket }

I am a bit new to Vim. I would like to know how to place my cursor after the bracket } If I use l or$, it places my cursor on the bracket. When I go into insert mode by typing i, I am inserting text ...
user avatar
  • 187
0 votes
0 answers
74 views

How can I prevent the cursor from blinking in Elvis in Xterm?

The cursor of vi (elvis) keep blinking under on a Raspberry Pi with the Rasbian distribution. It occurs with Xterm, not the xfce-terminal. On the computer or via ssh session. With the same setup (....
user avatar
1 vote
2 answers
140 views

Jump to (or get position of) any kind of parent brace

I am within a vimscript, and I want jump (or get the position of) the beginning of the current parent brace, how can I make this happen? Imagine the following example (the cursor is represented by |): ...
user avatar
0 votes
2 answers
55 views

How can I make a mapping to toggle cursorbind?

I know that adding a ! to the end of an option works for some commands, but it doesn't work for cursorbind. How can I toggle between cursorbind and nocursorbind with a keybinding?
user avatar
0 votes
0 answers
33 views

after compilation in Vim : cursor in gg

I'm french... sorry for my english I try to compile files (.tex, .md ... using vim). I open terminal and make the compilation ; just before the compilation i save the file and put a marker in the ...
user avatar
3 votes
1 answer
2k views

How do I change vim cursor color

I use vim version 8.0.707. My cursor blinks but make the character disappear half the time. I'd like it to behave as usual: display the negative color. How can I do that please? Thanks in advance :)
user avatar
3 votes
1 answer
1k views

How come the Vim cursor leaves one character at the end of the line?

It sounds like a bit of a silly question, but I couldn't find any answers. I've noticed that in the command mode, the Vim cursor doesn't go until the complete end of the line and stops at the last ...
user avatar
  • 215
1 vote
0 answers
31 views

How can I keep my cursor normal after exiting a terminal buffer?

Right now, whenever I open a terminal with :term, my cursor changes from a half-height/orange cursor to a full-height/gray cursor (depending on the emulator). When I navigate back to another window, ...
user avatar
  • 13
5 votes
1 answer
2k views

how can we put the cursor at mouse pointer

I can use the mouse to highlight, copy and paste text in VIM. So clearly VIM is aware of the mouse. As such it must be possible to get it to put the cursor where the mouse pointer is. Does anybody ...
user avatar
3 votes
1 answer
564 views

How to keep cursor vertically aligned to center even at the end of buffer?

I would like to keep my cursor centered vertically as I type away in insert mode even when I reach the end of the buffer I am editing (at which point I would like the virtual lines starting with ~ to ...
user avatar
  • 55
2 votes
1 answer
149 views

How can I make zz not center cursor when approaching end of file?

When I press zz at the end of file, the line is displayed at the center of screen by having many empty lines having empty lines beyond end of file is great, but this is too much. Is there a way to ...
user avatar
  • 199
1 vote
1 answer
3k views

changing cursor to block in insert mode on Neovim

I am a new neovim user. I am currently on MacOS, and using iTerm as my terminal emulator. I am using Neovim 0.4.3. I would like to configure my neovim in such a way that the cursor in insert mode is ...
user avatar
  • 119
2 votes
2 answers
482 views

How to use the same set of cursor shapes for bash vi mode and vim?

I want to use block cursor for normal mode, bar cursor for insert mode in both vim and bash vi mode, a minimal setting can look like this: vimrc -------- let &t_SI = "\e[5 q" let &t_EI = "\e[...
user avatar
  • 5,868
3 votes
2 answers
175 views

Keep cursor from moving when using operators

I'm trying to implement a custom operator following :h :map-operator. The operator works just fine but has the side effect of moving the cursor position! For example the code defining the <F4> ...
user avatar
2 votes
1 answer
66 views

Put cursor at arbitrary line and column

Normal, insert, and visual modes restrict cursor movements to locations occupied by some characters. They don't allow moving to the right from the end of line and down beyond end of file. For example:...
user avatar
4 votes
1 answer
1k views

How to change vim cursor shape in text console?

I can change cursor shape in text console (TERM=linux or linux-16color) by this escape sequence, : echo -e '\e[?6;c' But I can't do it inside vim, below code should change cursor shape in insert ...
user avatar
  • 5,868
1 vote
1 answer
25 views

How to test whether the cursor is at the end of a line in a mapping?

I would like to test in an operator-pending mapping whether the cursor is on the last position of the line. I currently have this, but it does not work: onoremap <expr> i$ col('.') == col('$') ?...
user avatar
3 votes
1 answer
1k views

Neovim does not restore terminal cursor on exit

The cursor of my gnome-terminal is an underline _. I am using Neovim and I want the cursor in Command Mode to be: block | set guicursor=n:block-Cursor When I exit from Neovim I want the cursor back ...
user avatar
  • 195
1 vote
1 answer
96 views

Is there any way to position the cursor in a :substitute replace pattern?

I have the following line: return err And would like to replace that to: return fmt.Errorf(": %w", \1) Which is done easily with something like: :s/return \v(\k+)/return fmt.Errorf(": %w", \1)/ ...
user avatar
2 votes
1 answer
51 views

Why does iabbrev end at second character, even after using 0 at the end of command chain?

This behaviour seems a bit strange (^ is the cursor): inoreabbrev @@t <esc>0 what@@t what ^ But: inoreabbrev @@t <esc>0h what@@t what ^ Why using 0 is not enough to put the cursor ...
user avatar
2 votes
1 answer
561 views

How can I highlight the current cursor position (not just the line)?

When I search a text file for a word from within vim, it will highlight all matches for the word by changing their background color -- to olive green on my terminal; your color may vary. I am looking ...
user avatar
1 vote
2 answers
271 views

Locate cursor on the screen

I have a big monitor and sometimes it can be difficult to locate the small blinking underscore that is the cursor. Is there a way to temporarily make the cursor more prominent and visible? Note, I ...
user avatar
  • 1,825
2 votes
1 answer
522 views

Change cursor position in another window

Is there a function like setpos that lets change the cursor position in a different window (split), given the window number? Or, even better, is there a command to execute a command in specific ...
user avatar
0 votes
1 answer
76 views

VimScript - Save specific positions consistently even after buffer changes

I want to save multiple positions in vimscript, and make sure that they stay at the right place, even after the buffer changes Here are the solutions I found so far, and why I want something else: ...
user avatar
  • 1,081
2 votes
1 answer
51 views

What is the purpose of the short cursor in command mode?

If I'm in command mode with default vim and I press the right angle key, the cursor switches from the normal block to a short version. What is the function of this? (Sometimes it seems related to ...
user avatar
  • 23