"============================================================================= " Copyright: Copyright (C) 2002 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 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. " " 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. " let g:miniBufExplSplitBelow=1 " Put new window below " " current. " " 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 " " 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=0 " " 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. " " 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 " " 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 " " 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. " " Known Issues: The 'set hidden' option is not compatible with MBE. " If the VIM developers provide a different mechanism for us to " detect the difference between an Explorer buffer and a regular " buffer we can remove this restriction. Otherwise, we are pretty " well stuck with this. " " 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. " " History: 6.0.8 o Apparently some VIM builds are having a hard time with " line continuation in scripts so the few that were here " have been removed. " o Generalized FindExplorer and FindCreateExplorer so " that they can be used for the debug window. Renaming " to FindWindow and FindCreateWindow. " o Updated debugging code so that debug output is put into " a buffer which can then be written to disk or emailed " to me when someone is having a major issue. Can also " write directly to a file (VERY SLOWLY) on UNIX or Win32 " (not 95 or 98 at the moment) or use VIM's echo function " to display the output to the screen. " o Several people have had issues when the hidden option " is turned on. So I have put in several checks to make " sure folks know this if they try to use MBE with this " option set. " 6.0.7 o Handling BufDelete autocmd so that the UI updates " properly when using :bd (rather than going through " the MBE UI.) " o The AutoUpdate code will now close the MBE window when " there is a single eligible buffer available. " This has the usefull side effect of stopping the MBE " window from blocking the VIM session open when you close " the last buffer. " o Added functions, commands and maps to close & update " the MBE window (mbc and mbu.) " o Made MBE open/close state be sticky if set through " StartExplorer(1) or StopExplorer(1), which are " called from the standard mappings. So if you close " the mbe window with \mbc it won't be automatically " opened again unless you do a \mbe (or restart VIM). " o Removed spaces between "tabs" (even more mini :) " o Simplified MBE tab processing " 6.0.6 o Fixed register overwrite bug found by Sébastien Pierre " 6.0.5 o Fixed an issue with window sizing when we run out of " buffers. " o Fixed some weird commenting bugs. " o Added more optional fancy window/buffer navigation: " o You can turn on the capability to use control and the " arrow keys to move between windows. " o You can turn on the ability to use and " to open the next and previous (respectively) " buffer in the current window. " o You can turn on the ability to use and " to switch windows (forward and backwards " respectively.) " 6.0.4 o Added optional fancy window navigation: " o Holding down control and pressing a vim direction " [hjkl] will switch windows in the indicated direction. " 6.0.3 o Changed buffer name to -MiniBufExplorer- to resolve " Issue in filename pattern matching on Windows. " 6.0.2 o 2 Changes requested by Suresh Govindachar: " o Added SplitToEdge option and set it on by default " o Added tab and shift-tab mappings in [MBE] window " 6.0.1 o Added MoreThanOne option and set it on by default " MiniBufExplorer will not automatically open until " more than one eligible buffers are opened. This " reduces cluter when you are only working on a " single file. " 6.0.0 o Initial Release on November 20, 2001 " " Todo: o Provide better support for user defined syntax highlighting " o 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 " "============================================================================= " " set hidden is bad (for MBE) so check for it and " don't bother loading MBE if it is. " " If you are getting this error and wondering what " to do about it, you probably have 'set hidden' in " your .vimrc (or maybe one of your other plugins " sets this.) If this is in your .vimrc, try " commenting it out. If you are experiencing a " plugin incompatibility, please let me know which " plugin you are having a problem with. " if &hidden call confirm("MiniBufExplorer will not be loaded because the 'hidden' option is turned on.", 'OK') finish endif " " Has this plugin already been loaded? " if exists('loaded_minibufexplorer') call DEBUG('MiniBufExplorer already loaded!', 5) finish endif let loaded_minibufexplorer = 1 let s:debugIndex = 0 " " If we don't already have a keyboard " mapping for mbe then create one. " if !hasmapto('MiniBufExplorer') map mbe MiniBufExplorer endif if !hasmapto('CMiniBufExplorer') map mbc CMiniBufExplorer endif if !hasmapto('UMiniBufExplorer') map mbu UMiniBufExplorer endif " " Setup