*preview.txt* For Vim version 7.3. Last Change: 2011 Nov 4 Description: Vim global plugin to preview markup files(markdown,rdoc,textile) Author: Sergey Potapov (aka Blake) Version: 0.8 Homepage: http://github.com/greyblake/vim-preview License: GPLv2+ -- look it up. Copyright: Copyright (C) 2010-2011 Sergey Potapov (aka Blake) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ============================================================================== 1. Contents *PreviewContents* 1. Contents .............................. |PreviewContents| 2. Intro ................................. |PreviewIntro| 3. Supported Formats ..................... |PreviewFormats| 4. Dependencies .......................... |PreviewDeps| 5. Configurations ........................ |PreviewConfig| 5.1 PreviewBrowsers .................. |PreviewBrowsers| 5.2 PreviewCSSPath ................... |PreviewCSSPath| 5.3 PreviewMarkdownExt ............... |PreviewMarkdownExt| 5.4 PreviewMarkdownFences ............ |PreviewMarkdownFences| 5.5 PreviewTextileExt ................ |PreviewTextileExt| 5.6 PreviewRdocExt ................... |PreviewRdocExt| 5.7 PreviewHtmlExt ................... |PreviewHtmlExt| 5.8 PreviewRonnExt ................... |PreviewRonnExt| 5.9 PreviewRstExt .................... |PreviewRstExt| 6. Commands .............................. |PreviewCommands| 6.1 Preview .......................... |Preview| 6.2 PreviewMarkdown .................. |PreviewMarkdown| 6.3 PreviewTextile ................... |PreviewTextile| 6.4 PreviewRdoc ...................... |PreviewRdoc| 6.5 PreviewHtml ...................... |PreviewHtml| 6.6 PreviewRonn ...................... |PreviewRonn| 6.7 PreviewRst ....................... |PreviewRst| 7. Mapping ............................... |PreviewMapping| 8. Known Bugs ............................ |PreviewBugs| 9. Credits ............................... |PreviewCredits| 10. Contact .............................. |PreviewContact| ============================================================================== 2. Intro *PreviewIntro* Preview plugin is a tool developed to help you to preview markup files such as *.markdown, *.rdoc, *.textile and *.html when you are editing them. It builds html files and opens them in your browser. ============================================================================== 3. Supported Formats *PreviewFormats* The plugin supports the next formats: * markdown(md, mkd, mkdn, mdown) depends on 'redcarpet' ruby gem * rdoc depends on 'github-markup' ruby gem * textile depends on 'RedCloth' ruby gem * ronn depends on 'ronn' ruby gem * reStructuredText(rst) depends on 'RbSt' ruby gem and rst2html util * html(htm) ============================================================================== 4. Dependencies *PreviewDeps* The plugin requires a builtin ruby interpreter. It means that your Vim should be compiled with '--enable-rubyinterp' option. To find out does your Vim have builtin ruby interpreter you can do the next: > :echo has('ruby') < If output is '1' the ruby interpreter is builtin. The second thing you should verify is that you have installed all necessary ruby gems. Please see |PreviewFormats| section to find out what gems you need. For reStructuredText(rst) format except RbST ruby gem you also need rst2html. To get rst2html util you probably should install python-docutils package. Otherwise PreviewRst vim command will show empty html file. ============================================================================== 5. Configurations *PreviewConfig* You can tweak the behaviour of preview plugin by setting a few variables in you vimrc file. For example: > let g:PreviewBrowsers='safari,firefox' let g:PreviewCSSPath='/path/to/css/file' let g:PreviewTextileExt='textile,txt' > ------------------------------------------------------------------------------ 5.1 g:PreviewBrowsers *PreviewBrowsers* Set browsers what will be used to open generated html file. Values should be comma separated. The highest priority has the first value. For example: > let g:PreviewBrowsers='safari,firefox' < Will try to use safari first. If command 'safari' does not exist 'firefox' will be used. Default: firefox,safari,chromium-browser,epiphany,google-chrome,opera ------------------------------------------------------------------------------ 5.2 g:PreviewCSSPath *PreviewCSSPath* Set a path to user's CSS file. If it's empty the plugin will use builtin styles. Default: empty ------------------------------------------------------------------------------ 5.3 g:PreviewMarkdownExt *PreviewMarkdownExt* Specifies file extensions separated by comma which should be handled as markdown. Default: markdown,md,mkd,mkdn,mdown ------------------------------------------------------------------------------ 5.4 g:PreviewMarkdownFences *PreviewMarkdownFences* b:PreviewMarkdownFences Enables support for fenced code blocks in markdown files. Value 1 enables, 0 disables. Default: 1 ------------------------------------------------------------------------------ 5.5 g:PreviewTextileExt *PreviewTextileExt* Specifies file extensions separated by comma which should be handled as textile. Default: textile ------------------------------------------------------------------------------ 5.6 g:PreviewRdocExt *PreviewRdocExt* Specifies file extensions separated by comma which should be handled as rdoc. Default: rdoc ------------------------------------------------------------------------------ 5.7 g:PreviewHtmlExt *PreviewHtmlExt* Specifies file extensions separated by comma which should be handled as html. Default: html,htm ------------------------------------------------------------------------------ 5.8 g:PreviewRonnExt *PreviewRonnExt* Specifies file extensions separated by comma which should be handled as ronn. Default: ronn ------------------------------------------------------------------------------ 5.9 g:PreviewRstExt *PreviewRstExt* Specifies file extensions separated by comma which should be handled as reStructuredText. Default: rst ============================================================================== 6. Commands *PreviewCommands* Preview plugin provides a set of commands for you. You can use them in command mode or map to keys. ------------------------------------------------------------------------------ 6.1 Preview Defines how to handle file depending on its format and Preview*Ext variables. If Preview*Ext variables doesn't have name of appropriate file extension it gives a message. ------------------------------------------------------------------------------ 6.2 PreviewMarkdown *PreviewMarkdown* Preview current file as markdown. ------------------------------------------------------------------------------ 6.3 PreviewTextile *PreviewTextile* Preview current file as textile. ------------------------------------------------------------------------------ 6.4 PreviewRdoc *PreviewRdoc* Preview current file as rdoc. ------------------------------------------------------------------------------ 6.5 PreviewHtml *PreviewHtml* Preview current file as html. File will be opened without any converting. ------------------------------------------------------------------------------ 6.6 PreviewRonn *PreviewRonn* Preview current file as ronn. ------------------------------------------------------------------------------ 6.7 PreviewRst *PreviewRst* Preview current file as reStructuredText. ============================================================================== 7. Mapping *PreviewMapping* Default mapping to preview file is P . You can easy map it to other keys. For example > :nmap p :Preview < Also you can map some other commands which is not mapped by default. E.g. > :nmap Pm :PreviewMarkdown :nmap Pt :PreviewTextile :nmap Pr :PreviewRdoc :nmap Ph :PreviewHtml < ============================================================================== 8. Known Bugs *PreviewBugs* If you found other bugs please report it. See |PreviewContact| for a contact. ============================================================================== 9. Credits *PreviewCredits* * Donald Ephraim Curtis - some support for OSX and Safari, fixing bugs * Sung Pae - fixing bugs * Rdark - support for ronn file format ============================================================================== 10. Contact *PreviewContact* To contact the author (Sergey Potapov), please email: blake131313 AT gmail DOT com I'll appreciate any suggestions or improvements offered for the plugin. vim:tw=78:ts=8:ft=help:norl: