Reprinted from: http://linux.bloghome.cn/posts/114.html
1. Install to http://vim.sourceforge.net/scripts/script.php? Script_id = 1, 159
Download the latest minibufexpl. Vim script,
Copy the file to the plugin directory.
2. Configuration
Add the following to the configuration file. vimrc:
"
"Minibuf plugin
"
Let G: minibufexplmapwindownavvim = 1 "Ctrl-Let G: minibufexpltabwrap = 1 "make tabs show complete (no broken on two lines)
In this way, you can use minibuf, and set Ctrl-H/J/k/L to switch in various windows, which is very convenient.
TIPS:
1. minibuf occupies a window. You can use ctrl-K to switch to it, and then press <tab> to select Buffer cyclically,
Press <enter> to activate the buffer. Press d to delete the buffer.
2. There is a number before each buffer name, which is the buffer number. Therefore, you can enter B <buffer number> to quickly switch.
Self-declared, I am a lazy, so I set several shortcut keys:
<F1> switch to the previous buffer zone
<F2> switch to the next buffer zone
<F3> Save the buffer (: Update)
<F4> disable the buffer (: BD, or: bdelete, delete the buffer)
The script is as follows: Nnoremap < F1 > : Call mycyclebuffer ( 0 ) < Cr >
Nnoremap < Leader > 1 : Call mycyclebuffer ( 0 ) < Cr >
Inoremap < F1 > < ESC > : Call mycyclebuffer ( 0 ) < Cr >
Nnoremap < F2 > : Call mycyclebuffer ( 1 ) < Cr >
Nnoremap < Leader > 2 : Call mycyclebuffer ( 1 ) < Cr >
Inoremap < F2 > < ESC > : Call mycyclebuffer ( 1 ) < Cr >
" Cycle through Buffers
" From minibufexplorer, modified by djw
Function ! Mycyclebuffer (forward)
" Change buffer (keeping track of before and after buffers)
Let L: origbuf = Bufnr ( '' % '' )
If (A: Forward = 1 )
BN !
Else
BP !
Endif
Let L: curbuf = Bufnr ( '' % '' )
" Skip any non-modifiable buffers, but don't cycle forever
" This shoshould stop us from stopping in any of the [schedulers]
While Getbufvar (L: curbuf, '' & Modifiable '' ) = 0 && L: origbuf ! = L: curbuf
If (A: Forward = 1 )
BN !
Else
BP !
Endif
Let L: curbuf = Bufnr ( '' % '' )
Endwhile
Endfunction
" <F4> Delete Buffer
Nnoremap < F4 > : BD < Cr >
Nnoremap < Leader > 4 : BD < Cr >
Inoremap < F4 > < ESC > : BD < Cr >
" <F3> or Ctrl-s update Buffer
Nnoremap < C - S > : Update < Cr >
Inoremap < C - S > < C - O > : Update < Cr >
Vnoremap < C - S > < C - C > : Update < Cr >
Nnoremap < F3 > : Update < Cr >
Inoremap < F3 > < C - O > : Update < Cr >