Dani's IT Blog

…moving from Oracle to Software Development

Posts Tagged ‘wildmenu

use menus in Vim without having a GUI

leave a comment »

While applying changes to sqplus.vim I was looking for the option to execute code only if Vim is running in a GUI ( if has("gui_running") ) While searching for this information I changed my mind, because I found out that you can use the menu also when running Vim on command line.

You just have to add the following lines to you .vimrc

:source $VIMRUNTIME/menu.vim
:set wildmenu
:set cpo-=<
:set wcm=<C-Z>

To use the newly added feature write :emenu plus a SPACE in command mode and press TAB. A menu appears above the command bar. You can change between the menu points with TAB and choose one with ENTER. After this you are in the sub menu, again you can select with TAB and ENTER.

You can also write a part of a menu point and complete it with tab. Or you type :emenu <C-D> (<C-D> means Ctrl+D for those not used this notation) which shows you a list of all possible menu entries.

The cool thing about wildmenu is, it brings you command completion for more than just menus. For example you could use it to show a list of available help entries. To try this type :h spl <C-D> and you will see a list of available help documents about split, vsplit, isplit, display …

Written by danirey

October 27, 2009 at 10:05