• Stars
    star
    209
  • Rank 188,325 (Top 4 %)
  • Language
    Vim Script
  • License
    GNU General Publi...
  • Created almost 14 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vim plugin for previewing markup files(markdown,rdoc,textile,html)

Preview - Vim plugin for previewing markup files

by Sergey Potapov (aka Blake)

Intro

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.

Supported Formats

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
  • html(htm)
  • ronn - depends on ronn ruby gem
  • reStructuredText(rst) - depends on RbST ruby gem and rst2html system util

Dependencies

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 "Supported Formats" 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.

Installation

To install the plugin just copy autoload, plugin, doc directories into your .vim directory.

Usage

  • <Leader>P - will open current file converted to HTML in your browser.

I want to remind that <Leader> in most cases is "\" key.

Troubleshooting

If you encountered this err when you press <Leader>P.

Preview: don't know how to handle .modula2 format

You may add this piece of code to .vimrc

autocmd BufNewFile,BufRead \*.{md,mdwn,mkd,mkdn,mark\*} set filetype=markdown

Know bugs

  • In some cases vim can do fork if it uses ruby 1.9. To avoid this trouble fork is done via python.

If you found a bug, please report it. Or better send me a pull request:)

TODO

  • Make more unique names for temporary files than just base name ending with .html. There should be vim_preview prefix, PID of Vim and number of buffer to guarantee avoiding conflicts.
  • Add ability to use alternative gems for processing markdown and other formats.
  • Handle exception when 'rubygems' is not found.

Credits

License

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

More Repositories

1

nutype

Rust newtype with guarantees πŸ‡ΊπŸ‡¦ πŸ¦€
Rust
1,068
star
2

whatlang-rs

Natural language detection library for Rust. Try demo online: https://whatlang.org/
Rust
926
star
3

ta-rs

Technical analysis library for Rust language
Rust
584
star
4

envconfig-rs

Build a config structure from environment variables in Rust without boilerplate
Rust
186
star
5

blogo

Mountable blog engine for Ruby on Rails
Ruby
101
star
6

kinded

Generate Rust enum variants without associated data
Rust
81
star
7

cargo-testify

Watches changes in a rust project, runs test and shows friendly notification
Rust
80
star
8

awesome-programming-books

List of good programming books for beginners and professionals
80
star
9

mago

Magic numbers detector for Ruby source code
Ruby
58
star
10

humble-investing

List of resources that I use for investing research
41
star
11

jsonpath-rs

JSONPath for Rust
Rust
37
star
12

from-typescript-to-rescript

Frontend of https://Inhyped.com written in TypeScript and rewritten in ReScript
TypeScript
29
star
13

telebot

Ruby client for Telegram bot API
Ruby
28
star
14

fast_seeder

Speed up seeding your Rails application using multiple SQL inserts!
Ruby
25
star
15

xplan

Visualizes dependencies between tasks
Rust
22
star
16

dm-rspec

RSpec matchers for DataMapper
Ruby
19
star
17

hellcheck

HTTP health checker implemented in Rust
Rust
19
star
18

vim-esperanto

Vim plugin for typing Esperanto language in any way (Esperanto keyboard, h, x, ^)
Vim Script
15
star
19

crystal-google_translate

Google Translate client for Crystal
Crystal
14
star
20

hail

HTTP load testing tool powered by Rust
Rust
14
star
21

crystal-magma

Crystal interpreter
Crystal
13
star
22

poloniex-rs

Rust client for Poloniex API
Rust
9
star
23

whatlang-ffi

C bindings for whatlang Rust library
C
9
star
24

rustcast

Code for RustCast screencast episodes (https://www.youtube.com/channel/UCZSy_LFJOtOPPcsE64KxDkw)
Rust
8
star
25

crystal-aitk

Artificial Intelligence Tool Kit for Crystal lang
Crystal
8
star
26

tokipona

Ruby library to process constructed language Toki Pona
Ruby
8
star
27

rails3_pg_deferred_constraints

Rails 3 engine which provides a hack to avoid RI_ConstraintTrigger Error bug.
Ruby
7
star
28

dotvim

My .vim
Vim Script
4
star
29

conway-rs

Conway's Game of Life implemented in Rust.
Rust
4
star
30

arbitrary_ext

Provides a way to derive Arbitrary trait but set custom implementation for single fields if necessary.
Rust
4
star
31

crystal-glosbe

Crystal Client for Glosbe API
Crystal
3
star
32

rails_markdown

Allows you to use markdown templates with placeholders in rails application}
Ruby
3
star
33

vim-smartdict

Vim plugin to use translate words (dictionary).
Vim Script
3
star
34

dot-nvim

My nvim config
Vim Script
2
star
35

crystal-cossack

Simple and flexible HTTP client for Crystal with middleware and test support.
2
star
36

enum_param-rs

Rust
2
star
37

beep-alarm

Alarm written in bash and based on beep tool
2
star
38

crystal-delemma

Lemmatization tool for German language.implemented in Crystal
Crystal
2
star
39

crystal-telegram_bot

Crystal
2
star
40

whatlang-website

Website for whatlang (whatlang.org)
JavaScript
2
star
41

crystal-icr

Interactive console for Crystal programming language
2
star
42

envconfig-rs-old

An easy way to build a config structure form environment variables in Rust without boilerplate.
Rust
1
star
43

greyblake.github.com

My blog
HTML
1
star
44

talks

Public talks / presentations
Vue
1
star
45

alis

Tool to create more flexible aliases.
Ruby
1
star
46

rustcast-travis-demo

Rust
1
star
47

gync

Synchronize data of desktop applications with Git
Ruby
1
star
48

dm-enum

Enumerated models for DataMapper
Ruby
1
star
49

deutscher_bot

Telegram Bot that helps to learn German, implemented in Crystal
Crystal
1
star
50

crystal-jwt

JWT implementation in Crystal
1
star