From e04bc3c7bbf740d335d157facb546d25bd845b2f Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 5 Oct 2011 14:03:00 +0100 Subject: [PATCH] Latest bufexplorer plugin. Recent versions of vim were printing annoying warnings about the ActivateBuffer() function. --- .vim/doc/bufexplorer.txt | 111 ++++- .vim/plugin/bufexplorer.vim | 1091 +++++++++++++++++++++++++++---------------- 2 files changed, 783 insertions(+), 419 deletions(-) diff --git a/.vim/doc/bufexplorer.txt b/.vim/doc/bufexplorer.txt index 9af0682..06e9223 100644 --- a/.vim/doc/bufexplorer.txt +++ b/.vim/doc/bufexplorer.txt @@ -1,12 +1,13 @@ -*bufexplorer.txt* Buffer Explorer Last Change: 19 Nov 2008 +*bufexplorer.txt* Buffer Explorer Last Change: 22 Oct 2010 Buffer Explorer *buffer-explorer* *bufexplorer* - Version 7.2.2 + Version 7.2.8 Plugin for easily exploring (or browsing) Vim |:buffers|. -|bufexplorer-usage| Usage |bufexplorer-installation| Installation +|bufexplorer-usage| Usage +|bufexplorer-windowlayout| Window Layout |bufexplorer-customization| Customization |bufexplorer-changelog| Change Log |bufexplorer-todo| Todo @@ -27,7 +28,7 @@ To install: - Start Vim or goto an existing instance of Vim. - Execute the following command: > - :helptag /doc < This will generate all the help tags for any file located in the doc directory. @@ -36,11 +37,11 @@ To install: USAGE *bufexplorer-usage* To start exploring in the current window, use: > - \be OR :BufExplorer + \be or :BufExplorer To start exploring in a newly split horizontal window, use: > - \bs or :HSBufExplorer + \bs or :BufExplorerHorizontalSplit To start exploring in a newly split vertical window, use: > - \bv or :VSBufExplorer + \bv or :BufExplorerVerticalSplit If you would like to use something other than '\', you may simply change the leader (see |mapleader|). @@ -51,24 +52,27 @@ Note: If the current buffer is modified when bufexplorer started, the current Commands to use once exploring: + Toggle help information. Opens the buffer that is under the cursor into the current window. - Toggle help information. Opens the buffer that is under the cursor into the current window. Opens the buffer that is under the cursor in another tab. - d |:wipeout| the buffer under the cursor from the list. - When a buffers is wiped, it will not be shown when unlisted - buffer are displayed. - D |:delete| the buffer under the cursor from the list. - The buffer's 'buflisted' is cleared. This allows for the buffer - to be displayed again using the 'show unlisted' command. + d |:delete|the buffer under the cursor from the list. The + buffer's 'buflisted' is cleared. This allows for the buffer to + be displayed again using the 'show unlisted' command. + R Toggles relative path/absolute path. + T Toggles to show only buffers for this tab or not. + D |:wipeout|the buffer under the cursor from the list. When a + buffers is wiped, it will not be shown when unlisted buffer are + displayed. f Toggles whether you are taken to the active window when selecting a buffer or not. + o Opens the buffer that is under the cursor into the current + window. p Toggles the showing of a split filename/pathname. q Quit exploring. r Reverses the order the buffers are listed in. - R Toggles relative path/absolute path. s Selects the order the buffers are listed in. Either by buffer number, file name, file extension, most recently used (MRU), or full path. @@ -83,8 +87,29 @@ you can then either open it, close it(delete), resort the list, reverse the sort, quit exploring and so on... =============================================================================== +WINDOW LAYOUT *bufexplorer-windowlayout* + +------------------------------------------------------------------------------- +" Press for Help +" Sorted by mru | Locate buffer | Absolute Split path +"= + 01 %a bufexplorer.txt C:\Vim\vimfiles\doc line 87 + 02 # bufexplorer.vim c:\Vim\vimfiles\plugin line 1 +------------------------------------------------------------------------------- + | | | | | + | | | | +-- Current Line #. + | | | +-- Relative/Full Path + | | +-- Buffer Name. + | +-- Buffer Attributes. See|:buffers|for more information. + +-- Buffer Number. See|:buffers|for more information. + +=============================================================================== CUSTOMIZATION *bufexplorer-customization* + *g:bufExplorerChgWin* +If set, bufexplorer will bring up the selected buffer in the window specified +by g:bufExplorerChgWin. + *g:bufExplorerDefaultHelp* To control whether the default help is displayed or not, use: > let g:bufExplorerDefaultHelp=0 " Do not show default help. @@ -104,6 +129,10 @@ use: > let g:bufExplorerFindActive=1 " Go to active window. The default is to be taken to the active window. + *g:bufExplorerFuncRef* +When a buffer is selected, the functions specified either singly or as a list +will be called. + *g:bufExplorerReverseSort* To control whether to sort the buffer in reverse order or not, use: > let g:bufExplorerReverseSort=0 " Do not sort in reverse order. @@ -124,6 +153,12 @@ directory, use: > let g:bufExplorerShowRelativePath=1 " Show relative paths. The default is to show absolute paths. + *g:bufExplorerShowTabBuffer* +To control weither or not to show buffers on for the specific tab or not, use: > + let g:bufExplorerShowTabBuffer=0 " No. + let g:bufExplorerShowTabBuffer=1 " Yes. +The default is not to show. + *g:bufExplorerShowUnlisted* To control whether to show unlisted buffer or not, use: > let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers. @@ -164,11 +199,48 @@ The default is to use the global &splitright. =============================================================================== CHANGE LOG *bufexplorer-changelog* -7.2.2 - Fix: +7.2.8 - Enhancements: + * Thanks to Charles Campbell for integrating bufexplorer with GDBMGR. + http://mysite.verizon.net/astronaut/vim/index.html#GDBMGR +7.2.7 - Fix: + * My 1st attempt to fix the "cache" issue where buffers information + has changed but the cache/display does not reflect those changes. + More work still needs to be done. +7.2.6 - Fix: + * Thanks to Michael Henry for pointing out that I totally forgot to + update the inline help to reflect the previous change to the 'd' + and 'D' keys. Opps! +7.2.5 - Fix: + * Philip Morant suggested switching the command (bwipe) associated + with the 'd' key with the command (bdelete) associated with the 'D' + key. This made sense since the 'd' key is more likely to be used + compared to the 'D' key. +7.2.4 - Fix: + * I did not implement the patch provided by Godefroid Chapelle + correctly. I missed one line which happened to be the most + important one :) +7.2.3 - Enhancements: + * Thanks to David Fishburn for helping me out with a much needed + code overhaul as well as some awesome performance enhancements. + He also reworked the handling of tabs. + * Thanks to Vladimir Dobriakov for making the suggestions on + enhancing the documentation to include a better explaination of + what is contained in the main bufexplorer window. + * Thanks to Yuriy Ershov for added code that when the bufexplorer + window is opened, the cursor is now positioned at the line with the + active buffer (useful in non-MRU sort modes). + * Yuriy also added the abiltiy to cycle through the sort fields in + reverse order. + Fixes: + * Thanks to Michael Henry for supplying a patch that allows + bufexplorer to be opened even when there is one buffer or less. + * Thanks to Godefroid Chapelle for supplying a patch that fixed + MRU sort order after loading a session. +7.2.2 - Fixes: * Thanks to David L. Dight for spotting and fixing an issue when using ctrl^. bufexplorer would incorrectly handle the previous buffer so that when ctrl^ was pressed the incorrect file was opened. -7.2.1 - Fix: +7.2.1 - Fixes: * Thanks to Dimitar for spotting and fixing a feature that was inadvertently left out of the previous version. The feature was when bufexplorer was used together with WinManager, you could use @@ -419,14 +491,13 @@ CHANGE LOG *bufexplorer-changelog* *compliant*, adding default keymappings of be and bs as well as fixing the 'w:sortDirLabel not being defined' bug. 6.0.3 - Added sorting capabilities. Sort taken from explorer.vim. -6.0.2 - Can't remember. +6.0.2 - Can't remember. (2001-07-25) 6.0.1 - Initial release. =============================================================================== TODO *bufexplorer-todo* -- The issuing of a ':bd' command does not always remove the buffer number from - the MRU list. +- Nothing as of now, buf if you have any suggestions, drop me an email. =============================================================================== CREDITS *bufexplorer-credits* diff --git a/.vim/plugin/bufexplorer.vim b/.vim/plugin/bufexplorer.vim index fc361da..0e8904a 100644 --- a/.vim/plugin/bufexplorer.vim +++ b/.vim/plugin/bufexplorer.vim @@ -1,5 +1,5 @@ -"============================================================================= -" Copyright: Copyright (C) 2001-2008 Jeff Lanzarotta +"============================================================================== +" Copyright: Copyright (C) 2001-2010 Jeff Lanzarotta " 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, @@ -10,26 +10,26 @@ " Name Of File: bufexplorer.vim " Description: Buffer Explorer Vim Plugin " Maintainer: Jeff Lanzarotta (delux256-vim at yahoo dot com) -" Last Changed: Wednesday, 19 Nov 2008 +" Last Changed: Friday, 22 October 2010 " Version: See g:bufexplorer_version for version number. " Usage: This file should reside in the plugin directory and be " automatically sourced. " " You may use the default keymappings of " -" be - Opens BufExplorer -" bs - Opens horizontally split window BufExplorer -" bv - Opens vertically split window BufExplorer +" be - Opens BE. +" bs - Opens horizontally window BE. +" bv - Opens vertically window BE. " " Or you can use " -" ":BufExplorer" - Opens BufExplorer -" ":HSBufExplorer" - Opens horizontally window BufExplorer -" ":VSBufExplorer" - Opens vertically split window BufExplorer +" ":BufExplorer" - Opens BE. +" ":BufExplorerHorizontalSplit" - Opens horizontally window BE. +" ":BufExplorerVerticalSplit" - Opens vertically window BE. " " For more help see supplied documentation. " History: See supplied documentation. -"============================================================================= +"============================================================================== " Exit quickly if already running or when 'compatible' is set. {{{1 if exists("g:bufexplorer_version") || &cp @@ -38,7 +38,7 @@ endif "1}}} " Version number -let g:bufexplorer_version = "7.2.2" +let g:bufexplorer_version = "7.2.8" " Check for Vim version 700 or greater {{{1 if v:version < 700 @@ -47,17 +47,29 @@ if v:version < 700 endif " Public Interface {{{1 -nmap be :BufExplorer -nmap bs :HSBufExplorer -nmap bv :VSBufExplorer +if maparg("be") =~ 'BufExplorer' + nunmap be +endif + +if maparg("bs") =~ 'BufExplorerHorizontalSplit' + nunmap bs +endif + +if maparg("bv") =~ 'BufExplorerVerticalSplit' + nunmap bv +endif + +nmap