2011年12月23日星期五

[solution] How to add menu and toolbar into gvim

==Add menu is easy. Add the following into your .vimrc on Linux or _vimrc on Windows
    amenu &Often.&Easy\ Mode :set im!<cr>
    amenu &Often.Line\ &Wrap :set wrap!<cr>
    amenu &Often.Line\ &Number :set nu!<cr>

This will create three menus Often->Easy Mode, Often->Line Wrap and Often->Line Number. The letter after & is for keyboard shortcuts

==Add Toolbar is two steps.

Step A: Creating 16x16 16 color bmp file
             1. Create a 16x16 icon in Visual Studio, and save to .ico file
             2. Rename .ico file into .bmp file and open in mspaint
             3. Save to 16 color .bmp file ( overwriting the original one ) -- must step
             4. Place the .bmp file in .vim/bitmaps on Linux or vimfiles\bitmaps\
Step B: Add the following into your .vimrc on Linux or _vimrc on Windows
    amenu ToolBar.easy :set im!<cr>
    amenu ToolBar.linewrap :set wrap!<cr>
    amenu ToolBar.linenum :set nu!<cr>

 Where easy, linewrap and linenum are the filename of .bmp file ( without extension )

没有评论: