O'Reilly logo

Learning the vi and Vim Editors, 7th Edition by Linda Lamb, Elbert Hannah, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Customizing Scrollbars, Menus, and Toolbars

gvim provides the usual GUI widgets, such as scrollbars, menus, and toolbars. Like most modern GUI applications, these widgets are customizable.

The gvim window, by default, shows several menus and a toolbar at the top, as illustrated by Figure 13-5.

Top of gvim window
Figure 13-5. Top of gvim window

Scrollbars

Scrollbars, which let you navigate up and down or right and left quickly through a file, are optional in gvim. You can display or hide them with the guioptions option, described at the end of this chapter in GUI Options and Command Synopsis.

Because Vim’s standard behavior is to show all text in the file (wrapping lines in the window if necessary), it’s interesting to note that the horizontal scrollbar serves no purpose in typically configured gvim sessions.

Turn the left and right scrollbars on and off by including or excluding r or l in the guioptions option. l makes sure the screen always has a left scrollbar, whereas r makes it always have a right scrollbar. The uppercase variants L and R tell gvim to show left or right scrollbars only when there is a vertically split window.

The horizontal scrollbar is controlled by including or excluding b in the guioptions option.

And yes, you can scroll the right and left scrollbars at the same time! More precisely, scrolling either one causes the other to move in the corresponding direction. It can be pretty convenient ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required