by
the 'toolbar' option. You can choose between an image, text or both.
*toolbar-icon*
The toolbar is defined as a special menu called ToolBar, which only has one
level. Vim interprets the items in this menu as follows:
- 1 If an "icon=" argument was specified, the file with this name is used.
The file can either be specified with the full path or with the base name.
In the last case it is searched for in the "bitmaps" directory in
'runtimepath', like in point 3. Examples: >
:amenu icon=/usr/local/pixmaps/foo_icon.xpm ToolBar.Foo :echo "Foo"<CR>
:amenu icon=FooIcon ToolBar.Foo :echo "Foo"<CR>
< Note that in the first case the extension is included, while in the second
case it is omitted.
If the file cannot be opened the next points are tried.
A space in the file name must be escaped with a backslash.
A menu priority must come _after_ the icon argument: >
:amenu icon=foo 1.42 ToolBar.Foo :echo "42!"<CR>
- 2 An item called 'BuiltIn##', where ## is a number, is taken as number ## of
the built-in bitmaps available in Vim. Currently there are 31 numbered
from 0 to 30 which cover most common editing operations |builtin-tools|. >
:amenu ToolBar.BuiltIn22 :call SearchNext("back")<CR>
- 3 An item with another name is first searched for in the directory
"bitmaps" in 'runtimepath'. If found, the bitmap file is used as the
toolbar button image. Note that the exact filename is OS-specific: For
example, under Win32 the command >
:amenu ToolBar.Hello :echo "hello"<CR>
< would find the file 'hello.bmp'. Under X11 it is 'Hello.xpm'.
For MS-Windows and the bitmap is scaled to fit the button. For
MS-Windows a size of 18 by 18 pixels works best.
For MS-Windows the bitmap should have 16 colors with the standard palette.
The light grey pixels will be changed to the Window frame color and the
dark grey pixels to the window shadow color. More colors might also work,
depending on your system.
- 4 If the bitmap is still not found, Vim checks for a match against its list
of built-in names. Each built-in button image has a name.
So the command >
:amenu ToolBar.Open :e
< will show the built-in "open a file" button image if no open.bmp exists.
All the built-in names can be seen used in menu.vim.
- 5 If all else fails, a blank, but functioning, button is displayed.
*builtin-tools*
>
nr Name Normal action
00 New open new window
01 Open browse for file to open in current window
02 Save write buffer to file
03 Undo undo last change
04 Redo redo last undone change
05 Cut delete selected text to clipboard
06 Copy copy selected text to clipboard
07 Paste paste text from clipboard
08 Print print current buffer
09 Help open a buffer on Vim's builtin help
10 Find start a search command
11 SaveAll write all modified buffers to file
12 SaveSesn write session file for current situation
13 NewSesn write new session file
14 LoadSesn load session file
15 RunScript browse for file to run as a Vim script
16 Replace prompt for substitute command
17 WinClose close current window
18 WinMax make current window use many lines
19 WinMin make current window use few lines
20 WinSplit split current window
21 Shell start a shell
22 FindPrev search again, backward
23 FindNext search again, forward
24 FindHelp prompt for word to search help for
25 Make