Question

I'm using vim 6.3.81 on a xterm through putty. When I use set mouse=a , I can scroll through the file , but not select text. When mouse is disabled using set mouse=, I can select text with mouse (automatically copied to a buffer) , but if the text block is over one page long , I can't scroll up/down (and have to select text one screen at a time) !!

Is there any way to have the best of both - while selecting text with mouse , if i reach the end of page , it automatically scrolls up/down depending on whether i've reached top/bottom of page and allows me to select text from the next page as well ?

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

Was it helpful?

Solution

When you have set mouse=a , You can select by <Shift> + LeftMouse to do a selection, <Shift> + RightMouse to paste your code as usual.

Hope this helps !!

OTHER TIPS

Have you thought about selecting using the mouse and then the keyboard? Just

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

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

Short answer: no, sorry.

Long answer: Vim in a terminal doesn't interact with the windows clipboard, so selecting with mouse=a won't help, as the selected text won't be accessible. Without mouse=a, where PuTTY is controlling the mouse, vim's data isn't in PuTTY's scrollback buffer, so PuTTY can't get at it.

The solution is (as suggested by Benj) to use gvim, either in an X server or using a native install of vim.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top