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]

The tag has no usage guidance.

0
votes
1answer
46 views

Cursor jumps 1 or 2 columns to the right after line up / down ( j / k )

Somehow my cursor jumps to the right in some filetypes (html, vue, json, maybe others...) when I switch lines with j or k My .vimrc is kinda messy atm...but I've seen worse... :) " Basics {{{ syntax ...
4
votes
1answer
23 views

track deletion and insertion of lines

The marks in vim knows the deletion and insertion of lines before it and their positions will keep updated. Is there a way to achieve these pragmatically? I am running an async task which is ...
0
votes
1answer
40 views

How to determine character offset of cursor in buffer?

I am trying to use wordcount().cursor_chars to determine the character offset of the cursor in the buffer – but I am getting off-by-one errors. The docs for wordcount() say that cursor_chars is the "...
1
vote
1answer
32 views

getpos(“.”) in visual mode equals getpos(“v”)

I uses neovim 0.3.1 only. I define the following function and map to do a test for getpos in visual mode: function! show_position() echo getpos("'<") getpos("'>") getpos(".") getpos("v") ...
1
vote
0answers
59 views

Why gf is not working with variable?

If there is no variable in path, gf can open the file. Added sfname+={,} to .vimrc to support ${VARIABLE}. :!echo ${VAR}/test/file can correctly print full path with ${VAR} expanded. But if run 'gf' ...
2
votes
0answers
114 views

disable cursor blinking in terminal-vim

I thought this would be a 10 second google search, but no. I found a bazillion sources how to disable cursor blinking in GVim. But I would like to disable it in terminal vim. My terminal cursor is set ...
2
votes
1answer
61 views

Reclaim cursor shape in operator pending mode neovim while using vim-surround

I'm somewhat ashamed to admit, the main reason I chose neovim over vim was it's native feature of changing cursor shape in different modes. For example, it uses vertical-bar in insert mode, block-...
9
votes
1answer
408 views

Is there a prepend insert mode?

I was trying to write a string with all chars from z to a and I thought this would be much easier if I could write backwards. The idea would be like an INSERT mode in which the cursor doesn't step ...
0
votes
0answers
23 views

How to show the highlight color instead of cursor' white color when highlight color and cursor overlapped?

Highlight all matched characters with red color. hi! ChineseMark ctermbg=red guibg=red match ChineseMark /[\u3000\uff01-\uff5e]/ Add the two lines in my .vimrc. Here is the test.txt file.   ...
0
votes
0answers
32 views

Vim 7.4 on terminator - cursor intel not working

I want to see an I-beam like cursor when I come in insert mode, otherwise block style. I tried every iteration from http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes but none worked so ...
1
vote
1answer
135 views

neovim doesn't change cursor in st terminal

I have recently started using st. But nvim doesn't change cursor shape like that in gnome-terminal or xfce4-terminal in this terminal. What's more confusing is that it works fine in tmux inside st! I ...
1
vote
1answer
104 views

Delayed esc from insert mode caused by cursor-shape terminal sequence

I set a couple terminal options so that Vim changes the cursor shape to a vertical bar when I enter Insert mode, an underbar for Replace mode, and a block when I return to Normal mode: let &t_SI="...
1
vote
0answers
94 views

Normal highlight group changes cursor color in vim in xterm

I set the following highlight: :hi Normal ctermfg=250 ctermbg=235 The text is a nice light gray on dark gray, as intended. But the cursor has become dark blue. I'd love to have it just be the ...
0
votes
1answer
190 views

How disable cursor shape modes in neovim?

Hello, so I just posted an issue in neovim's officiall github repo about a problem I am going to tell you about in a couple seconds and after finding a solution they told me the instructions were ...
1
vote
2answers
67 views

How to change f{char} to search left if no char was found searching right?

Regarding this command: f{char} To [count]'th occurrence of {char} to the right. The cursor is placed on {char} |inclusive|. {char} ...
1
vote
2answers
64 views

gvim Linux - GUI scroll without cursor shift

When we write code, we usually jump between different parts of the code (using the scrolling or the search functions). In this situations, on Linux, *vim shifts the cursor to the visible area. For ...
0
votes
1answer
397 views

No_cursor_blinking doesn't work

I have read this article & I added se gcr+=a:blinkon0 in my vimrc to stop blinking cursor in my Vim, also I sourced my vimrc again but the matter is it doesn't work & cursor is still blinking ...
1
vote
2answers
281 views

Move cursor to new line character

When in visual mode you can select the new line character. E.g.: The quick brown fox jumps over the lazy dog.⏎ In visual mode you can select both the period and the (invisible) carriage return, or ...
0
votes
1answer
176 views

Tweaking cursor gvim

I'd like to change the view of my current cursor as this pic: So how to have _ in cursor and how to change color of cursor? Thanks in advanced.
2
votes
1answer
264 views

Possibility to set cursor shape manually in Neovim

New versions of neovim handle cursor shapes perfectly. But for a special use case I need to change cursor shape manually for a while. Is it possible in Neovim > .2?
1
vote
1answer
82 views

Text changes when moving cursor over

I was modifying an email template and I noticed that when moving the cursor over a piece of code it changed. Here is a screenshot from before: and after: Vim version is 7.4 on Ubuntu 16.04. Any ...
2
votes
2answers
1k views

How to disable moving the cursor with the mouse

I've been using Vim for decades (and Vi before it since around 1984.) I use it now on Linux. Somewhere along the line one behavior crept in that I'd like to disable: when I click in a window to move ...
5
votes
1answer
558 views

How can I get the character at the cursor position in a multibyte aware manner?

Consider the following line: € € This file is encoded in UTF-8 and between the two Euro marks is a Tab character (the Stack Exchange software expands this to spaces). The byte value is: e2 82 ac ...
6
votes
0answers
137 views

Disable bold character under cursor

This might be a newbie question but I can't seem to find an answer anywhere. I've created a custom colorscheme, but I don't know how to stop the character behind the cursor from becoming bold. This ...
1
vote
1answer
49 views

How to correctly interpret the cursor's position?

I'm having trouble understanding the cursor in the context of Vim commands, e.g. insertion, deletion, movement, etc: When the cursor is hovering over a character and I want to delete until the end of ...
4
votes
0answers
372 views

Why does `set t_ve=' hide cursor in terminal

Vim's documentation lists t_vi as "cursor invisible" and t_ve as "cursor visible", but provides no hints on usage. Naively, I would have guessed that Vim would send the t_vi sequence when you somehow ...
0
votes
2answers
183 views

Current line position when switching buffers

When switching buffers with :e# or <ctrl>-^, I commonly see the line with the cursor (the current line) move to the middle of the window (maybe related to the scroll_cursor_halfway function ...
1
vote
0answers
101 views

How to restore cursor shape when exiting/stopping vim?

I have this in my .vimrc let &t_SI = "\<Esc>[5 q" let &t_SR = "\<Esc>[3 q" let &t_EI = "\<Esc>[2 q" The problem is that I keep the block cursor shape when I exit vim. ...
2
votes
1answer
3k views

I can't switch to | cursor in insert mode

I want to change cursors to a | character in insert mode, and then back to a block in normal mode. I am using urxvt as my terminal, and neovim. To switch cursors in my terminal, I run the following ...
3
votes
1answer
79 views

How to center a cursor on the screen, even at the start of the file

I like always knowing where my cursor is. I do this by having it in the center line of the screen. However if I am working at the top of the file the cursor stops centering because there is no more ...
4
votes
3answers
285 views

How can you indent your current file without losing your cursor position?

I was reading that the way to indent in vim is a gg=G sequence. This however loses my cursor position. How can I indent my file without losing my cursor position?
1
vote
4answers
96 views

Motion remap to select function doesn't work with v

I want to add a motion: :onoremap <silent> f( :<C-U>normal! f)vF(b<CR> If I have this line, where the asterisk is my current position: int a = fo*o(4, 5, 99); I want to type vf( ...
10
votes
2answers
2k views

How do I make Vim always display several lines after EOF?

In Vim, I don't like how when you reach end of file it puts the last line at the bottom of the screen. Is there anyway to make the last line be something like 10 lines above the bottom of the screen ...
0
votes
1answer
117 views

How to scroll without forcing the cursor on screen (by letting the cursor off screen)?

I want to be able to do this because I am used from other editors to use the cursor as a visual bookmark, so that after scrolling by letting the cursor off screen I can come back to its place later. I ...
8
votes
1answer
1k views

Vim normal and insert mode cursor not changing in GNU screen

I use vim in a few different contexts; typically, I like to put this in my .vimrc: let &t_ti.="\<Esc>[1 q" let &t_SI.="\<Esc>[5 q" let &t_EI.="\<Esc>[1 q" let &t_te.=...
3
votes
2answers
263 views

How to restore cursor position after search and replace in autocmd

I'd like to delete all spaces on empty lines before saving files. I've figured out how to do that. autocmd BufWritePre * silent! %s/\v^\s+$//e But this moves my cursor the line where the spaces have ...
0
votes
1answer
462 views

Gvim cursor jumps all over the place

I have a problem with my cursor in gVim, this happens in both Normal and insert(Whenever I type fast) modes. When I move my cursor it seems that the cursor goes to a random position for a very short ...
9
votes
1answer
495 views

Change the cursor shape in operator pending mode

My cursor in Gvim: My cursor in Gvim after pressing d: Is there any way I can change the cursor in terminal Vim when in operator pending mode? It doesn't have to look exactly like the screenshots. ...
5
votes
2answers
996 views

CursorLine colors

I configured my CursorLine to be lightyellow. I have a couple of issues here: First, lightyellow is marked as an error when it is a valid color. How can I avoid this? Second, when the cursor line is ...
12
votes
1answer
301 views

What is causing my cursor to look so strange? [closed]

Whenever I hit the end or beginning of a line, I get this very odd character where my cursor was. Any idea what may be causing this? I believe I have my fonts and theme correctly installed. I'm using ...
0
votes
1answer
312 views

On Ubuntu and in tmux, vim does not react to Ctrl+Home and Ctrl+End

Outside of tmux they work well. These key combinations should move the cursor to the beginning of the document and, respectively, to the end of the document. How do I make them work? Thank you very ...
3
votes
1answer
97 views

cursor behavior when exiting <insert> mode

I understand that when in insert mode the cursor is described as between characters, and when in normal mode the cursor is supposed to be on a valid character. I have been having a lot of trouble with ...
10
votes
3answers
4k views

Multiple cursors at desired location

I'm using vim-multiple-cursors plugin. I would like to put cursors exactly where I want. For example ([x] are the cursor positions): Lorem ipsum dolor sit amet[1], consectetur adipiscing elit, sed ...
3
votes
1answer
2k views

Change cursor shape in different terminals

At home I use iTerm2 on MacOS X, and at work, I have a laptop with CygWin. I have another PC where I use gnome-terminal or terminator, and sometimes I use tmux. I'm looking to configure the cursor ...