Questions tagged [scrolling]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
92 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 ...
5
votes
2answers
144 views

Keeping context while scrolling

Suppose I have a very long file, for example: class X { // ... void foo() { // ... if (something) { a00(); a01(); a02(); // ... ...
2
votes
1answer
81 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
272 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, ...
3
votes
1answer
627 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&...
8
votes
1answer
1k 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
513 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
679 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
137 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 ...
17
votes
4answers
7k 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
123 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
46 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 ...
7
votes
3answers
664 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 ...
2
votes
1answer
359 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
479 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
123 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 ...
17
votes
2answers
7k 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 ...
1
vote
1answer
250 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
381 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 ...
11
votes
1answer
2k 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? ...
1
vote
3answers
3k 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
90 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 ...
8
votes
1answer
2k 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
365 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 ...
14
votes
1answer
3k 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
293 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 ...
3
votes
1answer
388 views

Stray characters when scrolling in gvim

When scrolling with the mouse wheel, characters will often duplicate themselves on subsequent lines. For instance, if I'm scrolling down, I can sometimes see an open brace on its line and on the ...
11
votes
2answers
610 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 ...
2
votes
2answers
730 views

Vim scroll window like in less pager (with single key)?

I really like how the less pager uses w to scroll up and z to scroll down since they are single keys, in vim I have to use CTRL+d/CTRL+f to get the same effect. Having to hold ctrl is a bit of a ...
5
votes
1answer
310 views

How can I advance a page without losing my column position?

I like using Ctrl-f and Ctrl-b to "page-up" and "page-down", but I was wondering if there was a way to do that without losing my current position in a row? For example, I like to work with tab-...
38
votes
3answers
2k views

How to disable horizontal scrolling?

I have some concealed characters in the buffer and horizontal scrolling kills the alignment big time. Is there any way how to disable it? I could not find any relevant options. Edit: Demo added. You ...
3
votes
2answers
1k views

Vim keep last line at bottom of buffer

I need to configure Vim in such a way that it has a normal scrolloff of 3 or 5. But in such a way that it keeps the last line at the bottom of the screen. I don't want that as I scroll, the last lines ...
5
votes
2answers
815 views

How to prevent Vim from scrolling buffers when I open split

When I open a new split Vim is scrolling both buffers up despite having enough space. Here is an asciicast This behaviour comes out-of-the box in vim -u NONE. It is really annoying. My guess it ...
1
vote
1answer
129 views

Is there a way to have sidescrolloff behave differently depending if I am end of a line?

I work in two broadly different ways in vim (that are relevant to this question): I am writing text or markdown-formatted content, writing paragraphs of text. In this case I am generally writing new ...
24
votes
1answer
4k views

How can I get both splits to scroll left or right at the same time?

I want to open up two different parts of a document in horizontal splits (using :sp) and scroll both of them left and right together. For vertical scrolling, you would use scrollbind. However, I'm not ...
10
votes
3answers
3k views

How can I use my trackpad for horizontal scrolling?

I just noticed that my trackpad scroll works in Vim, inertia and all. I'd like to change this to work horizontally - so I can scroll up and down to make the cursor move left-and-right instead of ...
22
votes
3answers
11k views

Scroll the screen, not the cursor, when using scrollwheel

I'm using Vim in a terminal, so scrolling with the scroll wheel uses the \e[A and \e[B syntax (where \e symbolizes \x1b, or escape). However, Vim interprets this by moving the cursor up or down a ...
26
votes
4answers
11k views

How do I center the current line in the screen?

Is there a way to center the line I'm editing in the screen? This is sometimes needed to see a bit more context above and below the current line.

1
2