Publish is a plugin for Vim that facilitates automatic publishing of syntax highlighted buffers. It can be used to quickly and easily publish any type of content, from code to articles or even blog posts, making the publishing process more efficient and streamlined.
Using Publish is as easy as :update once you've defined the global variables 'publish_pattern' and 'publish_directory'. When you save your buffers, this plugin automatically publishes them. The plugin uses the value of 'publish_pattern' as a pattern to search for within the first ten lines of the buffer. If it finds a line that matches, the capture of the first subpattern is appended to the filepath defined by 'publish_directory' to determine the filepath where the buffer should be published.
If 'publish_directory' doesn't exist, you'll be prompted to temporarily disable automatic publishing until you create the directory. You can also choose to disable automatic publishing manually by setting 'publish_automatic' to 0. Publish() function keys, which are documented, can be used to customize the way your buffers are published.
If you'd rather not use the autocommand but want to publish Vim buffers from your own scripts, you can use the Publish(path [, options]) function. The 'options' dictionary supports several key/value pairs, including colors, title, header, and linkify. Please keep in mind that this plugin overwrites existing files.
To use Publish, all you need is Vim. To install this fantastic plugin, copy the script to your plugin directory, such as ~/.vim/plugin/ on UNIX.
Version 1.0: N/A