Vim Tips Wiki
Advertisement

Previous TipNext Tip

Tip: #1045 - Great wildmode/wildmenu and console mouse

Created: November 9, 2005 19:49 Complexity: basic Author: Matt Zyzik Version: 5.7 Karma: 227/72 Imported from: Tip#1045

set wildmenu

set wildmode=list:longest,full


Put those two in your .vimrc, and you'll enjoy the greatest wildmode that isn't fully documented in the vim help.

"set wildmenu" first enables a menu at the bottom of the vim/gvim window.

The meaning of "list:longest,full" is so that when you do completion in the command line via tab, these events will happen:

1. (on the first tab) a list of completions will be shown and the command will be completed to the longest common command.

2. (on second tab) the wildmenu will show up with all the completions that were listed before.


To test it out, type ":spe" and then hit tab once to see 1 and hit tab again to see 2.


set mouse=a


Put that line in your .vimrc to enable full mouse support in the console.

This way you won't have to wait for gvim's excessively long startup (1.5 secs) and just run vim in an xterm, having full mouse/scrollwheel support.



With both the above features, vim in the console is practically just as good as gvim. (":emenu" command could be used to access the gvim menus)

Comments

Is there a way to make C-N/C-P act as with the option 'longest,full' ?

lpenz , November 10, 2005 5:41


I don't know if there is a way to do that; however, I know that in the Vim 7 alpha, they now have menus that popup (in console vim and gvim) when you do ctrl+n and ctrl+p

matt zyzik , November 10, 2005 6:56


In vim 7.0 alpha there is nice popups when you hit Ctrl-n for completing current word, both in gvim and console vim! I'm already using this feature - it's handy. Another completions is also supported by popups. Omni - completion is on the way ... :)


Anonymous , November 10, 2005 7:27


that mouse=a thing is really very handy :)

thanks calmar

mac--AT--calmar.ws , November 20, 2005 22:31


i've used "set mouse=a" before, but sometimes it behaves oddly in my xterm.

for example, sometimes, i have started an xterm shell, executed vim on a file and been able to scrollwheel down, but the scroll wheel up takes me to the xterm buffer. if i quit, and then execute in that same xterm a "gnu screen" session, and execute vim in that, mouse support sometimes does not work at all. i checked that the mouse=a was set in the screen and i have been able to use mouse support in the screen some of the time.

know of any shell configurations necessary?

Anonymous , November 23, 2005 5:22


mess around with "set ttymouse" in vim it might fix something

Matt Zyzik , November 23, 2005 7:52


Advertisement