Scroll up / down when choosing a multi-page block of text in Vim through putty

I am using vim 6.3.81 on xterm through putty. When I use set mouse=a, I can scroll the file, but not select the text. When the mouse is disabled with set mouse=, I can select the text with the mouse (automatically copied to the clipboard), but if the text block exceeds one page, I cannot scroll up / down (and you need to select the text on one screen at a time)!

Is there a way to get the best of both? When selecting text with the mouse, if I reach the end of the page, it will automatically scroll up / down depending on whether I have reached the top / bottom of the page and allows me to select the text from the next page ?

I know vim is powerful / flexible to do what I want - I just don't know how to do it !! Can anyone help?

+3
source share
3 answers

If you have set mouse=a, you can choose <Shift> + LeftMouseto select <Shift> + RightMouse, to insert your code, as usual.

Hope this helps!

+2
source

Have you thought about choosing with the mouse and then the keyboard? Simply

  • Place the cursor with the mouse.
  • Press "v" in command mode.
  • Press Up / Down (or j / k) to move up / down

If you scroll the end of the terminal, it will automatically scroll down, keeping the selection selected.

+1
source

: , .

Long answer: Vim in the terminal does not interact with the window buffer, so selecting with mouse = a will not help, since the selected text will not be available. Without mouse = a, where PuTTY controls the mouse, vim data is not in the PuTTY scroll buffer, so PuTTY cannot get it.

Solution (as suggested by Benj) for using gvim, either on the X server, or using a native vim installation .

+1
source

Source: https://habr.com/ru/post/1725029/


All Articles