From: Simon Ruderich Date: Sun, 26 Apr 2009 10:34:21 +0000 (+0200) Subject: minibufexplorer: Add plugin, version 6.3.2. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=0948c6bf60e468bce00d46b2219ec7f2936ff508;p=config%2Fdotfiles.git minibufexplorer: Add plugin, version 6.3.2. Plugin to display an overview of existing buffers. --- diff --git a/plugin/minibufexpl.vim b/plugin/minibufexpl.vim new file mode 100644 index 0000000..4e78063 --- /dev/null +++ b/plugin/minibufexpl.vim @@ -0,0 +1,1838 @@ +" Mini Buffer Explorer +" +" HINT: Type zR if you don't know how to use folds +" +" Script Info and Documentation {{{ +"============================================================================= +" Copyright: Copyright (C) 2002 & 2003 Bindu Wavell +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" minibufexplorer.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. In no +" event will the copyright holder be liable for any damamges +" resulting from the use of this software. +" +" Name Of File: minibufexpl.vim +" Description: Mini Buffer Explorer Vim Plugin +" Maintainer: Bindu Wavell +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=159 +" Last Change: Sunday, June 21, 2004 +" Version: 6.3.2 +" Derived from Jeff Lanzarotta's bufexplorer.vim version 6.0.7 +" Jeff can be reached at (jefflanzarotta@yahoo.com) and the +" original plugin can be found at: +" http://lanzarotta.tripod.com/vim/plugin/6/bufexplorer.vim.zip +" +" Usage: Normally, this file should reside in the plugins +" directory and be automatically sourced. If not, you must +" manually source this file using ':source minibufexplorer.vim'. +" +" You may use the default keymappings of +" +" mbe - Opens MiniBufExplorer +" +" or you may want to add something like the following +" key mapping to your _vimrc/.vimrc file. +" +" map b :MiniBufExplorer +" +" However, in most cases you won't need any key-bindings at all. +" +" is usually backslash so type "\mbe" (quickly) to open +" the -MiniBufExplorer- window. +" +" Other keymappings include: mbc to close the Explorer +" window, mbu to force the Explorer to Update and +" mbt to toggle the Explorer window; it will open if +" closed or close if open. Each of these key bindings can be +" overridden (see the notes on mbe above.) +" +" You can map these additional commands as follows: +" +" map c :CMiniBufExplorer +" map u :UMiniBufExplorer +" map t :TMiniBufExplorer +" +" NOTE: you can change the key binding used in these mappings +" so that they fit with your configuration of vim. +" +" You can also call each of these features by typing the +" following in command mode: +" +" :MiniBufExplorer " Open and/or goto Explorer +" :CMiniBufExplorer " Close the Explorer if it's open +" :UMiniBufExplorer " Update Explorer without navigating +" :TMiniBufExplorer " Toggle the Explorer window open and +" closed. +" +" To control where the new split window goes relative to the +" current window, use the setting: +" +" let g:miniBufExplSplitBelow=0 " Put new window above +" " current or on the +" " left for vertical split +" let g:miniBufExplSplitBelow=1 " Put new window below +" " current or on the +" " right for vertical split +" +" The default for this is read from the &splitbelow VIM option. +" +" By default we are now (as of 6.0.2) forcing the -MiniBufExplorer- +" window to open up at the edge of the screen. You can turn this +" off by setting the following variable in your .vimrc: +" +" let g:miniBufExplSplitToEdge = 0 +" +" If you would like a vertical explorer you can assign the column +" width (in characters) you want for your explorer window with the +" following .vimrc variable (this was introduced in 6.3.0): +" +" let g:miniBufExplVSplit = 20 " column width in chars +" +" IN HORIZONTAL MODE: +" It is now (as of 6.1.1) possible to set a maximum height for +" the -MiniBufExplorer- window. You can set the max height by +" letting the following variable in your .vimrc: +" +" let g:miniBufExplMaxSize = +" +" setting this to 0 will mean the window gets as big as +" needed to fit all your buffers. +" +" NOTE: This was g:miniBufExplMaxHeight before 6.3.0; the old +" setting is backwards compatible if you don't use MaxSize. +" +" As of 6.2.2 it is possible to set a minimum height for the +" -MiniBufExplorer- window. You can set the min height by +" letting the following variable in your .vimrc: +" +" let g:miniBufExplMinSize = +" +" NOTE: This was g:miniBufExplMinHeight before 6.3.0; the old +" setting is backwards compatible if you don't use MinSize. +" +" IN VERTICAL MODE: (as of 6.3.0) +" By default the vertical explorer has a fixed width. If you put: +" +" let g:miniBufExplMaxSize = +" +" into your .vimrc then MBE will attempt to set the width of the +" MBE window to be as wide as your widest tab. The width will not +" exceed MaxSize even if you have wider tabs. +" +" Accepting the default value of 0 for this will give you a fixed +" width MBE window. +" +" You can specify a MinSize for the vertical explorer window by +" putting the following in your .vimrc: +" +" let g:miniBufExplMinSize = +" +" This will have no effect unless you also specivy MaxSize. +" +" By default we are now (as of 6.0.1) turning on the MoreThanOne +" option. This stops the -MiniBufExplorer- from opening +" automatically until more than one eligible buffer is available. +" You can turn this feature off by setting the following variable +" in your .vimrc: +" +" let g:miniBufExplorerMoreThanOne=1 +" +" (The following enhancement is as of 6.2.2) +" Setting this to 0 will cause the MBE window to be loaded even +" if no buffers are available. Setting it to 1 causes the MBE +" window to be loaded as soon as an eligible buffer is read. You +" can also set it to larger numbers. So if you set it to 4 for +" example the MBE window wouldn't auto-open until 4 eligibles +" buffers had been loaded. This is nice for folks that don't +" want an MBE window unless they are editing more than two or +" three buffers. +" +" To enable the optional mapping of Control + Vim Direction Keys +" [hjkl] to window movement commands, you can put the following into +" your .vimrc: +" +" let g:miniBufExplMapWindowNavVim = 1 +" +" To enable the optional mapping of Control + Arrow Keys to window +" movement commands, you can put the following into your .vimrc: +" +" let g:miniBufExplMapWindowNavArrows = 1 +" +" To enable the optional mapping of and to a +" function that will bring up the next or previous buffer in the +" current window, you can put the following into your .vimrc: +" +" let g:miniBufExplMapCTabSwitchBufs = 1 +" +" To enable the optional mapping of and to mappings +" that will move to the next and previous (respectively) window, you +" can put the following into your .vimrc: +" +" let g:miniBufExplMapCTabSwitchWindows = 1 +" +" +" NOTE: If you set the ...TabSwitchBufs AND ...TabSwitchWindows, +" ...TabSwitchBufs will be enabled and ...TabSwitchWindows +" will not. +" +" As of MBE 6.3.0, you can put the following into your .vimrc: +" +" let g:miniBufExplUseSingleClick = 1 +" +" If you would like to single click on tabs rather than double +" clicking on them to goto the selected buffer. +" +" NOTE: If you use the single click option in taglist.vim you may +" need to get an updated version that includes a patch I +" provided to allow both explorers to provide single click +" buffer selection. +" +" It is possible to customize the the highlighting for the tabs in +" the MBE by configuring the following highlighting groups: +" +" MBENormal - for buffers that have NOT CHANGED and +" are NOT VISIBLE. +" MBEChanged - for buffers that HAVE CHANGED and are +" NOT VISIBLE +" MBEVisibleNormal - buffers that have NOT CHANGED and are +" VISIBLE +" MBEVisibleChanged - buffers that have CHANGED and are VISIBLE +" +" You can either link to an existing highlighting group by +" adding a command like: +" +" hi link MBEVisibleChanged Error +" +" to your .vimrc or you can specify exact foreground and background +" colors using the following syntax: +" +" hi MBEChanged guibg=darkblue ctermbg=darkblue termbg=white +" +" NOTE: If you set a colorscheme in your .vimrc you should do it +" BEFORE updating the MBE highlighting groups. +" +" If you use other explorers like TagList you can (As of 6.2.8) put: +" +" let g:miniBufExplModSelTarget = 1 +" +" into your .vimrc in order to force MBE to try to place selected +" buffers into a window that does not have a nonmodifiable buffer. +" The upshot of this should be that if you go into MBE and select +" a buffer, the buffer should not show up in a window that is +" hosting an explorer. +" +" There is a VIM bug that can cause buffers to show up without +" their highlighting. The following setting will cause MBE to +" try and turn highlighting back on (introduced in 6.3.1): +" +" let g:miniBufExplForceSyntaxEnable = 1 +" +" MBE has had a basic debugging capability for quite some time. +" However, it has not been very friendly in the past. As of 6.0.8, +" you can put one of each of the following into your .vimrc: +" +" let g:miniBufExplorerDebugLevel = 0 " MBE serious errors output +" let g:miniBufExplorerDebugLevel = 4 " MBE all errors output +" let g:miniBufExplorerDebugLevel = 10 " MBE reports everything +" +" You can also set a DebugMode to cause output to be target as +" follows (default is mode 3): +" +" let g:miniBufExplorerDebugMode = 0 " Errors will show up in +" " a vim window +" let g:miniBufExplorerDebugMode = 1 " Uses VIM's echo function +" " to display on the screen +" let g:miniBufExplorerDebugMode = 2 " Writes to a file +" " MiniBufExplorer.DBG +" let g:miniBufExplorerDebugMode = 3 " Store output in global: +" " g:miniBufExplorerDebugOutput +" +" Or if you are able to start VIM, you might just perform these +" at a command prompt right before you do the operation that is +" failing. +" +" History: Moved to end of file +" +" Known Issues: When debugging is turned on and set to output to a window, there +" are some cases where the window is opened more than once, there +" are other cases where an old debug window can be lost. +" +" Several MBE commands can break the window history so [pnw] +" might not take you to the expected window. +" +" Todo: Add the ability to specify a regexp for eligible buffers +" allowing the ability to filter out certain buffers that +" you don't want to control from MBE +" +"============================================================================= +" }}} + +" Startup Check +" +" Has this plugin already been loaded? {{{ +" +if exists('loaded_minibufexplorer') + finish +endif +let loaded_minibufexplorer = 1 +" }}} + +" Mappings and Commands +" +" MBE Keyboard Mappings {{{ +" If we don't already have keyboard mappings for MBE then create them +" +if !hasmapto('MiniBufExplorer') + map mbe MiniBufExplorer +endif +if !hasmapto('CMiniBufExplorer') + map mbc CMiniBufExplorer +endif +if !hasmapto('UMiniBufExplorer') + map mbu UMiniBufExplorer +endif +if !hasmapto('TMiniBufExplorer') + map mbt TMiniBufExplorer +endif + +" }}} +" MBE