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 [scrolling]

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

2
votes
1answer
45 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 ...
1
vote
1answer
31 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 ...
0
votes
0answers
13 views

Terminal Vim scrolls up once when I release the scroll wheel after having scrolling down

It is a weird behavior, and it's only happening on one of my laptop (they're both provisioned with the same script) which is the reason I'm having troubles identifying where does this come from. I ...
0
votes
1answer
53 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-...
0
votes
2answers
31 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: <...
1
vote
2answers
51 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 ...
2
votes
1answer
142 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 ...
0
votes
1answer
37 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 ...
1
vote
1answer
46 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 ...
1
vote
0answers
106 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 ...
1
vote
1answer
57 views

Keep current line in same position when toggling folds (zi)?

When toggling folds with zi, any folds expanding above the current line cause the current line to disorientingly jump to a different place on the screen. How can I keep the current line fixed in the ...
0
votes
1answer
77 views

Scrolling the terminal with vi shortcuts? [closed]

I have vi shortcuts set on my gnome-terminal and can't figure out how to scroll through the terminal's output after the change. Before I could use Shift+Page-up, but this isn't working in normal or ...
1
vote
1answer
130 views

Make ctrl-j and ctrl-k work like they do in less?

I would like to use ctrl-k and ctrl-j to not only move the cursor up or down (by lines), but also to scroll the portion of the document that is visible. Effectively, leave the cursor where it is and ...
0
votes
1answer
195 views

Cursorline/Columnline slowdown

I have recently recompiled vim, and ever since, when I have a big file, the scrolling gets slow. cursorline seems to be the problem; it doesn't matter if I use any of my plugins, if I have cursorline ...
0
votes
0answers
81 views

Why is syntax highlighting making scrolling so slow for me?

Recently I noticed scrolling syntax-highlighted files via j/k was getting absurdly slow for me, and I have no idea why. I'm using vim 8.0 (patch 1400) on OSX 10.12, as just installed by homebrew. It ...
1
vote
2answers
59 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 ...
1
vote
2answers
106 views

keep same column when navigating by pages?

<c-d> and <c-u> both, by default, drop you in the first non-whitespace column of the given row. This behavior is kind of distracting when quickly scanning through pages. Is there a way to ...
0
votes
1answer
60 views

norm ^E command works when I type it manually, but fails in an autoloaded vim file. Why?

(Vim 8.0, Windows 7) I wanted to make an autocmd for loading a certain file, that scrolls down five lines from the beginning of the file. It does other things too, so the autocmd itself (inside of an ...
1
vote
0answers
49 views

Avoid Scrolling When Switching Back to a Buffer

When switching back to a buffer (.e.g with Ctrl^ and :bn, etc.), Vim tries to scroll whatever line the cursor was on last to the center of the window. I find this behavior extremely disorienting, so I ...
2
votes
2answers
63 views

How do I map H and L to scroll by one screen if the cursor in already on the top line or bottom line

Basically map H and L based on the cursor positon. If I press H the cursor should go to top of the screen and if I press H again I want to scroll up by one page.
1
vote
1answer
68 views

How do you page through the jump list?

With the :jumps command, you can display the list of jump locations to aid navigation. That is you can use CTRL_O and CTRL_I to jump backwards and forwards respectively. However, my jump lists appear ...
2
votes
1answer
65 views

Showing lines above beginning of document

Editing at the top or bottom of the screen is uncomfortable, so why use zz all the time (also scrolloff). That works fine in the middle of the document, and in the end, and I can keep the cursor ...
6
votes
3answers
202 views

align/spread file content in vertically split windows

I have a single buffer open across multiple vertically split windows and all the windows have scrollbind set. However, before setting scrollbind, I had to scroll down in second window in order to make ...
0
votes
1answer
61 views

How to bring current line & cursor at 25% from top of screen?

zz moves current line & cursor at the middle of the screen. zt moves current line & cursor at the top of the screen. Is there a way to do the same as zz and zt, but for a quarter (25%) from ...
6
votes
2answers
124 views

Keeping context while scrolling

Suppose I have a very long file, for example: class X { // ... void foo() { // ... if (something) { a00(); a01(); a02(); // ... ...
1
vote
1answer
43 views

Can you scroll the window in interactive substitute mode?

I am using an interactive substitution that spans multiple lines. In order to determine whether each particular occurrence should be replaced, I need to see all lines that are included in the search ...
3
votes
1answer
141 views

Console vim(x): Can I map the scroll wheel to undo--redo?

It's sort-of a follow to a recent XKCD. I want to know whether it's possible to map the scroll wheel to undo and redo, possibly n undos/redos per scroll? I'm using mate-terminal in MATE 1.6.x, bash, ...
4
votes
1answer
252 views

Can I use the mouse scroll wheel to browse the auto-completion popup menu?

Is is possible to use <ScrollWheelUp> and <ScrollWheelDown> while the auto-complete popup is open? I tried using the map inoremap <expr> <ScrollWheelUp> pumvisible() ? "<Up&...
7
votes
1answer
579 views

Visual scrolling/visual <C-e> and <C-y> across wrapped lines?

This has been asked on stackoverflow before, but it seems it still has no solution. Perhaps that has changed with Vim 8.0. I'd like to be able to scroll (i.e. scroll-wheel, or <C-y>/<C-e> ...
3
votes
3answers
185 views

How to [[ to top of function and see function name on first line of screen

This is for C coding, but would apply to editing many languages. I often use ctags or lately cscope to jump around, and find I often need to quickly check or learn what function I am in. A great tool ...
5
votes
1answer
326 views

Can I scroll in vim with my touch screen?

I frequently use gvim on a windows 7 computer with a touch screen. If I flick up or down with the touch screen, it creates a selection (in S mode, not V mode). I'm not really a fan of this default ...
5
votes
2answers
109 views

To pageup and pagedown without reserved lines

When I scroll a whole page up by ctrl-f, and down by ctrl-b, vim reserves 2 lines, and repeats them both in the previous GUI window and the present one. But I expect it not to repeat lines, because ...
12
votes
4answers
2k views

Scroll a quarter (25%) of the screen up or down

I often find scrolling a full page too disorienting, half a page too much, but a quarter page is just right. I currently do it just by holding down the arrow keys. How do I scroll 25% of the page ...
2
votes
1answer
90 views

continue buffer in new window

Let's say that I have a file which contains numbers from 1 to 200. Each number is on a separate line. As I have a wide screen, then I view this file in a way that I vertically split the window(Ctrl + ...
1
vote
1answer
36 views

Customizing the functionality of Ctrl-D is it possible - so=50 only with ctrl+d and ctrl+u

I have to navigate through a large code base and it seems the thing that best suits me is the setting for scroll offset :set scrolloff=50 However if I have to click on the random spot on the screen ...
5
votes
1answer
257 views

How to make horizontal scrolling easier when the cursor is not ideally located?

For easy horizontal scrolling in long lines, I use these mappings that work well for me: map <m-[> 20zh map <m-]> 20zl Something that has always annoyed me is when the following use case ...
1
vote
1answer
97 views

How move current line to top of the window with `scrolloff` set

I want to scroll the current line to be the topmost line in the window, even with scroloff set. How do I do this? I want to use it with: com! TestColours :echo "Please wait..." | :so /usr/share/vim/...
3
votes
1answer
192 views

How to keep the screen position from “zt” after switching buffer

When I use zt to scroll the screen relative to the cursor and then switch buffers with, say, :bn followed by :bN, the screen jumps back to the position before executing zt. Using for example ctrl-d ...
1
vote
0answers
83 views

“scroll-smooth” remapping works only in second buffer

I tried to use the "scroll-smooth" tip given in :h tips (see :h scroll-smooth). The idea is to change <C-U> by a series of <C-Y>'s (and the same for <C-D> with <C-E>'s) : map ...
9
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
111 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 ...
0
votes
2answers
164 views

How to move the line under the cursor to the middle of the screen by scrolling (not automatic)? [duplicate]

For example if I have a line at the beginning of the screen and in the opened file there are other lines above it so the screen is not at the beginning of the file (it is scrolled down), if I go to ...
5
votes
1answer
565 views

Turn off synchronous scrolling not caused by either scrollbind or diff

I have a file that has decided to scroll synchronously when I open it in a second window and start scrolling. scrollbind and diff are set to off. (:set scrollbind? prints noscrollbind and :set diff? ...
3
votes
3answers
859 views

Scrolling down multiple lines with Ctrl+e

I know i can scroll down using ctrl+e and up using control ctrl+y. Any idea how I can scroll multiple lines with ctrl+e ? I am looking for a quick solution for scrolling down in vim ?
3
votes
0answers
45 views

Can I disable sidescrolling altogether? [duplicate]

If some characters are concealed in a line, so that the effectively the entire line is visible, and nowrap is set, moving to the end of the line can cause Vim to scroll if the actual line length is ...
5
votes
1answer
474 views

Open file and scroll to bottom command line param?

I'm new to vim. I want to open vim from command line and have it scroll to the bottom of a file automatically. The use case is opening logs. Typically I open vim "vim log" and then scroll down ...
2
votes
1answer
197 views

Scroll without changing the cursor position

Frequently when using vim I will hit a case where I am looking at a function that is half off the bottom of the screen, and I would like to see the whole thing. ctrl-D will generally solve the problem ...
11
votes
1answer
1k views

Why are my windows scrolling together?

I have two windows open on the same buffer and I want to edit two parts of the same file at the same time. I can't because the windows are scrolling together. I have noscrollbind set so I am ...
1
vote
1answer
134 views

How to let the cursor push the screen instead of the the screen drag the cursor when scrolling with the mouse?

How to let the cursor push the screen instead of the the screen drag the cursor when scrolling with the mouse? I switched to iterm 2 on osx, but in the regular osx terminal when i scroll the ...
9
votes
2answers
232 views

Scrolling issues when the `wrap` option is set

I find myself dealing with this issue every time the wrap option is active (in my particular case whenever I'm working with markdown files). What happens is that, while scrolling up and down the ...