Showing posts with label scrolling. Show all posts
Showing posts with label scrolling. Show all posts

Wednesday, November 11, 2009

Window Scrolling

Hit ctrl-e to scroll the current window down. Hit ctrl-y to scroll the current window up. An advantage of using these commands is that the cursor stays in the current location. Try it!

Friday, September 18, 2009

Mouse Tips

This has been mentioned on the blog in the past, but readers email me about it often enough that it deserves a formal tip. You can use the mouse to resize windows in Vim if you set your mouse as follows.

:set mouse=a

This will even work over a remote ssh session if you also set your term appropriately.

:set term=[the appropriate setting]

Options for term settings are as follows:

in the GUI: "builtin_gui"
on Amiga: "amiga"
on BeOS: "beos-ansi"
on Mac: "mac-ansi"
on MiNT: "vt52"
on MS-DOS: "pcterm"
on OS/2: "os2ansi"
on Unix: "ansi"
on VMS: "ansi"
on Win 32: "win32"

If the mouse setting interferes with your operating system's copy and paste ability such as the select to copy feature under X windows, you can revert to the standard behavior by holding shift while selecting text.

Setting your mouse as described also prevents accidental terminal scrolling with the mouse wheel when editing a file remotely and causes Vim to scroll within the current buffer instead.

Thanks to mmmattos for emailing me and providing the motivation for this tip.

Friday, August 29, 2008

Scrolling Horizontally

If you would like to scroll horizontally with the cursor following the screen, you can use the following commands to scroll left and right.

zl - move the view [count] characters right
zh - move the view [count] characters left