Vim Tips Wiki
Register
(Adjust previous/next navigation)
(Standard category names + minor manual clean.)
 
Line 4: Line 4:
 
|previous=842
 
|previous=842
 
|next=844
 
|next=844
|created=January 5, 2005
+
|created=2005
 
|complexity=basic
 
|complexity=basic
 
|author=charles
 
|author=charles

Latest revision as of 04:12, 16 May 2012

Tip 843 Printable Monobook Previous Next

created 2005 · complexity basic · author charles · version 6.0


After some time using mini buffer explorer script#159, here is the way for moving between buffers using the mouse (thus gvim only) and minibufexpl I feel comfortable with.

1. Download the minibufexpl script and put it in the plugin directory (~/.vim/plugin or %HOME%\vimfiles\plugin in windows). Thus we have a pseudo tabbar in GVim window.

2. Map the right click to <Esc> by adding these lines to vimrc

imap <RightMouse> <Esc>
nmap <RightMouse> <Esc>

3. Then when we want to switch buffer in insert mode (or normal mode), instead having to press the <Esc> key, then move the mouse and click the buffer name, we instead just need to right click and click the buffer name using the mouse. Quite easier I think.

Drawback, you lose your right click menu.

Comments[]

That's a great idea, but try this:

imap <RightMouse> <Esc>
nmap <RightMouse> i<LeftMouse>

As before, right mouse gets you out of insert mode, so you can quickly use the mini buffer explorer. In normal mode, right mouse will put you in insert mode wherever you click.

Now, to edit a different file, <RightClick> to exit insert mode, double <LeftClick> on the new filename, navigate to where you want to edit and <RightClick> to begin insert mode.