Breadcrumbs - Provides named placeholders for Vile.
:perl use Breadcrumbs :dropcrumb <label> :findcrumb <label> :eatcrumb <label> :loadcrumbs <file> :unloadcrumbs <file> :showcrumbs :breadcrumbs-help
The Breadcrumbs package provides a named placeholder capability for the Vile editor. (I'm shying away from the word "bookmarks" to avoid WWW-related confusion.) The effect is similar to using tags when programming, except you get to apply any label you wish to a spot in a file. Later you can return to a location in a file by providing the appropriate label.
Crumbs are stored in a database file, and thus are preserved between editor sessions. If you try to jump to a spot in a file that isn't loaded yet, the editor loads the needed file automagically.
Crumb labels are case sensitive.
The default crumbfile location is ~/.vilecrumbs. You can customize the location by using the %breadcrumbs variable, e.g.:
setv %breadcrumbs /tmp/mycrumbs
You can begin using a new crumbfile anytime during an editing session by changing the value of %breadcrumbs. The change takes effect immediately.
The effect of the Breadcrumbs' commands are atomic with respect to the disk copy of the crumbfile. There is no notion of "saving" or "committing" changes. If you delete a crumb, it's gone. Backups are recommended.
[Note: Breadcrumbs may already be installed for you as part of your Vile installation.]
Install Breadcrumbs.pm somewhere in perl's @INC path. Depending on your Vile installation, /usr/local/share/vile/perl might be a good place.
As currently written, Breadcrumbs requires that your system (and your Perl) supports the Berkeley DB. If you don't have DB, you'll need to either get it (and maybe rebuild your Vile with a version of Perl that supports it), or muck about with the Breadcrumbs code so you can use DBM or whatever.
Load the Breadcrumbs package into Vile.
Store a crumb that matches the current cursor position.
Return to a stored crumb.
Delete a crumb from the current crumbfile.
Given a crumbfile path, merges all the crumbs from that crumbfile into the current one. If the same crumb name appears in both crumbfiles, you will be asked whether or not you want to overwrite the current value.
Given a crumbfile path, removes any crumbs from the current crumbfile that exist in the given crumbfile, i.e. reverses the effect of a loadcrumbs command.
Brings up a buffer containing a list of all the crumbs in the current crumbfile. Due to certain limitations in Vile, this list buffer is not static, i.e. it doesn't necessarily go away when you kill its window. However, when you enter some Breadcrumbs' command that might affect its contents, the list buffer is updated if it's visible, and destroyed if it's not visible. I suppose you could say it's a semi-static buffer. The crumb list is sorted alphabetically, by default. Sorting can be turned off by setting the variable %breadcrumbs_nosort to a non-zero value.
Show this manual page.
Some exercises left to the reader:
Useful breadcrumb keybindings and macros, e.g. jump to the label under the cursor...
Label completion for the findcrumb command, to include showing all potential matches.
Autogenerated menu of breadcrumbs for use in XVile & WinVile...
Some oddities may occur because the crumb-list buffer is not static. (Vile only supports a fixed set of static buffers.) Nothing too major though. Just an occasional core dump perhaps...
Idea courtesy of Clemens Fischer.
J. Chris Coppick, 2001 (last updated: Sept. 18, 2001)