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

Questions tagged [scrolling]

For questions about scrolling, and configuring the behavior of vim-scrolls

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

How to window leftcol without switching to the window

winsaveview() returns multiple details about the window including the leftcol which is the amount of horizontal scroll. However you need to switch to the window to get that. getwininfo() returns ...
user avatar
  • 254
0 votes
0 answers
22 views

scroll line to specific screen line

I am search for the opposite of winline(). winline() returns the screen line in the window of the current cursor position. I want to be able to set it. Therefore scroll the windows content so that the ...
user avatar
  • 545
2 votes
0 answers
31 views

Can Vim scroll by "window lines" rather than "buffer lines"? [duplicate]

When scrolling in a document with long, wrapped lines, the document will jump up and down by multiple lines when the cursor reaches the top or bottom of the window. Vim always shows the beginning of a ...
user avatar
  • 21
0 votes
1 answer
37 views

How to make a mapping to scroll splits together for only one line at a time?

I know about :scrollbind, but I only want to move the splits together one line at a time. I think what I have tried explains what I am trying to do, although it doesn't work: " Scroll splits ...
user avatar
  • 105
2 votes
0 answers
21 views

How to factor fold status with scrollbind

I'd like two scroll bound windows to factor in fold status when scrolling the other window. For example if a fold is closed, the other window would be scrolled by only 1 line rather than the size of ...
user avatar
0 votes
2 answers
56 views

How can I display a minimap with search results?

I have a big sheet of data that I constantly input more into. It gets to a point that is hard to use, especially when I do a search of a certain topic. I am having tough time managing the data of the ...
user avatar
0 votes
1 answer
31 views

Applying command to window under cursor

By using the following code map <c-ScrollWheelUp> :resize +3^M map <c-ScrollWheelDown> :resize -3^M map <1-c-ScrollWheelUp> :resize +3^M map <1-c-ScrollWheelDown> :resize -3^M ...
user avatar
0 votes
1 answer
26 views

How do I prevent sudden line jump when scrolling through file with linebreaks?

I'm using vim to read through a script. I want to prevent sudden, jarring transitions from when scrolling down after reaching the bottom of the screen. I want to vim to scroll just one linebreak at a ...
user avatar
  • 1,237
1 vote
0 answers
22 views

How to see offscreen undo changes?

Imagine a text file with some words on the first line, one-thousand blank lines, and some text on the last line. this is a first line of text. <1000 blank lines> Last line of text. From the ...
user avatar
1 vote
0 answers
202 views

What Neovim GUIs have GUI scrollbars as described in vim under :h gui-scrollbars?

TL;DR I am looking for a Neovim GUI with GUI scrollbars as described in vim under :h gui-scrollbars (accessed on 2021-08-21). What GUI Vim scrollbars are like 2. Scrollbars *gui-...
user avatar
  • 3,960
2 votes
1 answer
399 views

Scroll Lock in vim

How can I make scroll lock work in vim (windowed and terminal versions)? When scroll lock is activated, using the arrow keys on the keyboard should scroll the window instead of moving the pointer. ...
user avatar
  • 125
1 vote
1 answer
350 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
20 views

How can I edit a file and show a diff in a vertical split pane [duplicate]

I have a program file prog.pl and a backup prog.pl-20210615. At first they are identically. But then I want edit prog.pl and see the differences to the backupfile prog.pl prog.pl-20210615 text to ...
user avatar
  • 145
0 votes
1 answer
28 views

Scrolling prints a bunch of A or B's in insert mode

A bunch of A or B's gets printed on the screen when I accidentally scroll with the touchpad in insert mode. What can I do to prevent such an annoying behavior ?
user avatar
  • 165
1 vote
1 answer
41 views

Synchronize the scroll offset of a vertical split

Set up Left (L) and right (R) are two vertically split windows displaying the same file. No other windows exist in the tab. The uppermost displayed line in L is x (Lx) and the uppermost line in R is ...
user avatar
  • 2,143
1 vote
1 answer
62 views

How to have l and h at the boundary of the window shift only one column, when wrap is off?

How can I have h and l move the viewport only by one column when they go beyond the left and right borders when nowrap is active?
user avatar
  • 1,572
0 votes
0 answers
130 views

Vim glitch screen while scrolling using <C-d>

I am using vim on wsl (ubuntu2004). It works just fine if it is slow scrolling however if I scroll it fasted using jump scrolling <C-d> or <C-u> it makes the screen have some rendering ...
user avatar
2 votes
1 answer
756 views

Bottom Padding In Vim?

My (n)vim window looks like this: Line 91 is the end of the document, and it's flush with the document name at the bottom (essentially the bottom of the screen). How do I "move" that line ...
user avatar
  • 157
3 votes
4 answers
1k views

How to scroll in another window without switching to it?

There is a keybinding in Emacs that lets you scroll in another window that you're not currently working on (C-M-v to scroll-other-window-down and C-M-V to scroll-other-window-up). For example, in a ...
user avatar
0 votes
0 answers
57 views

Less latency when scrolling with ctrl-e and ctrl-y

Is there a way to scroll faster using Ctrl-e and Ctrl-y? When I hold down Ctrl+e for example, it scrolls one line of text but then pauses for about half a second before scrolling the rest of the text. ...
user avatar
  • 359
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
0 answers
348 views

Flicker during scroll in single window?

If I run vim without tmux in urxvt v9.22 or xterm 330, it flicks after a full screen scroll. $ seq 1000 >test $ vim --clean test execute G or /13$ and nnnnnnn, you should see it flickers. If you ...
user avatar
  • 5,868
4 votes
2 answers
884 views

Why isn't this implemented by default in vim? (line by line Scroll) [closed]

Very often, my preferred way of navigating a file in vim is by "scrolling" line by line. By scrolling, I mean shifting the lines up/down while keeping the cursor on the same line and ...
user avatar
2 votes
2 answers
154 views

View lines above and below current cursor

Is there a way to get 10 lines above and beneath the current cursor? Similar to set scrolloff=10 but I only want to do it ONCE, not change the setting... Clarification: I want at least 10 lines. If ...
user avatar
  • 123
2 votes
0 answers
29 views

Can I trigger a command when the status bar shows up or hides?

I'm using set laststatus=1 so the status bar is only visible when needed, e.g. to display file names when multiple splits are open. However, when the status bar shows up, the existing buffer seems to ...
user avatar
  • 349
0 votes
0 answers
192 views

Vim not rendering text when moving up

I can move down until the last line of a file with no issues. However, when move up the text that was out of screen bounds does not render (as shown by the figure) until i press Ctrl + L to force ...
user avatar
0 votes
0 answers
21 views

display visual lastline instead of whole line with 'wrap' on [duplicate]

With set wrap, is there any way to not show the whole logical line when scrolling after the last line or before the first with gj and gk, but only the visual line? The goal is to prevent jerky ...
user avatar
  • 2,370
1 vote
0 answers
38 views

No automatic scrolling when opening splits

When using plugins, splits are often created to show something, e.g. a quickfixlist or the taglist. If the split is opened (especially for horizontal splits), the original window is automatically ...
user avatar
  • 133
2 votes
0 answers
45 views

Remove 'jumps' when moving to last and first line in Vim [duplicate]

I have the display option set to lastline so that the last line is shown even if all it doesn't fit on the window. When moving down visual lines with gj to the last line that is only partially visible,...
user avatar
0 votes
0 answers
223 views

How to map commands to key release events

When I press and hold j or k, they are repeated by the OS interface (I presume). Vim seems to scroll on each character produced by the keyboard. This makes the scroll pause shortly right after holding ...
user avatar
  • 161
0 votes
1 answer
667 views

Scrolling with trackpad not working Macvim

I have just installed MacVim on my new Macbook. But I have a problem: on Linux I was able to scroll through my code—vertically moving my cursor—by using my trackpad. But on Macvim this doesn't work ...
user avatar
  • 273
1 vote
2 answers
112 views

Move cursor and screen together

I am implementing a smooth scrolling function for <C-u> and <C-d>, which just sleeps for a few milliseconds and then moves the screen up (<C-y>) or down (<C-e>) one line: ...
user avatar
  • 161
1 vote
2 answers
1k views

How to follow the output of a command in a terminal window

I recently decided to give a try at neovim and one thing is bothering me: I use a terminal window to run my code watcher i.e. a never ending command which outputs new lines each time I write a buffer....
user avatar
  • 45.9k
1 vote
0 answers
112 views

Is there a keybinding that allows to scroll through the status line?

I was wondering if it was possible to scroll (left or right) along the status line so that the content (which could not be displayed due to the size of the window) could be seen. Perhaps there is a ...
user avatar
  • 225
1 vote
0 answers
48 views

Keep `scroll` equal to current window height

Is there a way to update scroll every time window height changes? I know, that I can achieve the same behavior calling winheight(0) on each ctrld press as suggested here, but I'm curious if there is ...
user avatar
  • 111
0 votes
3 answers
624 views

don't use scrolloff=5 for mouse clicks

I use (neo)vim with mouse=a and scrolloff=5. Clicking on one of the top or bottom five lines with the mouse causes the screen to jump (so that the new cursor position is more centered), which ...
user avatar
  • 157
3 votes
1 answer
868 views

Show / hide horizontal scrollbar depending on "wrap" option

I'm trying to show / hide horizontal scrollbar conditionally, depending on wrap option: with wrap - show horizontal scrollbar with nowrap - hide Here is what I tried, but for some reason it doesn't ...
user avatar
  • 77
0 votes
0 answers
117 views

What is the [0/0] that pops up in corner of tmux vim if I try to scroll up?

When I'm in vim on tmux with terminal and I scroll up, the cursor will jump to where my mouse is and show a [0/0] on the right corner of my window. When that happens, I can't type or move the cursor ...
user avatar
1 vote
1 answer
782 views

How do I make vim display virtual space at the bottom when opening a file?

I really like not having my cursor at the bottom part of the screen. Using :set scrolloff=20 does help when scrolling down a file, but it doesn't work when I reach the bottom (unless I zz). Another ...
user avatar
0 votes
0 answers
47 views

Using horizontal scroll commands without setting `nowrap`

I tend to use a lot of vertical splits in my vim (version 8.1, via Arch Linux official repos) usage (on top of tabs, horizontal splits, tmux, etc.), and it gets frustrating when many of my lines wrap ...
user avatar
  • 151
1 vote
1 answer
396 views

gVim: How to prevent horizonal scrollbar from resetting when scrolling vertically?

I am quite new to Vim and am trying to configure gVim with some of the behaviour that I like from notepad++. I disabled text wrapping with :set nowrap, then added the horizontal scrollbar with :set ...
user avatar
  • 113
2 votes
1 answer
70 views

Keeping the window filled with the document

I would like to make Vim behave a little more like the less(1) pager: if I scroll to the bottom of the document (e.g. using Ctrl-F), I want the last line of the file to be displayed at the bottom of ...
user avatar
  • 2,433
2 votes
1 answer
331 views

zt for horizontal scrolling

I love the keybindings zt zb and zz. They redraw the current window such that your cursor stays at the same place in the document, but it moves on your screen. The cursor will now be at the top, the ...
user avatar
  • 512
1 vote
1 answer
3k views

How to disable default mouse wheel behavior in iTerm?

I have: nnoremap <ScrollWheelUp> k nnoremap <S-ScrollWheelUp> k nnoremap <C-ScrollWheelUp> k nnoremap <ScrollWheelDown> j nnoremap <S-ScrollWheelDown> j nnoremap <C-...
user avatar
  • 379
0 votes
2 answers
233 views

What key presses/escape codes does vim expect for <ScrollWheelLeft> and <ScrollWheelRight>?

I'm working with a terminal emulator, and want to send the right key presses/escape sequences to vim, so it inteprets them as the left/right scroll wheel buttons. 64/65 works for up/down: <...
user avatar
3 votes
2 answers
1k views

Scroll view up or down while in insert mode

I really like Ctrl-E and Ctrl-Y in normal mode, which expose additional lines at the bottom or top of the screen (respectively) without moving the cursor. I'd like to do the same thing in insert mode ...
user avatar
  • 4,005
6 votes
1 answer
2k views

Scrollback in Vim 8 Terminal

Been really loving the asynchronous terminal in Vim 8. Sometimes I have a large amount of output in the terminal, and when I enter normal mode in the terminal and use gg to go to the top, I see that ...
user avatar
0 votes
1 answer
494 views

Scroll wheel inserts seemingly-random characters in cygwin vim, depending on where on the screen the mouse cursor is

I have the following options set to non-default values, as reported by :redir @+ | :set | @redir end: --- Options --- autochdir cscopetag foldcolumn=7 hlsearch lazyredraw relativenumber sidescroll=1 ...
user avatar
  • 3
1 vote
1 answer
123 views

remote scrollbind with an offset (to increase the viewing area, over two screens)

Could I just duplicate what scrollbind does, and use tmux to send-keys to the other vim? I have vim on an android device (in termux), and want the effect of spreading vim over another device's ...
user avatar
2 votes
0 answers
703 views

vim does not redraw the screen properly when scrolling the page up or down line-by-line

I am connected to a Windows SSH server from a Linux client, on Windows I end up in a Powershell. For small,quick edits I use the official vim windows console binary. It seems to work without ...
user avatar