Coder Social home page Coder Social logo

hammer.vim's Introduction

OVERVIEW

Project Hammer.vim
Homepage https://github.com/matthias-guenther/hammer.vim
Author Matthias Guenther
Form-Author Rob Gleeson

DESCRITPION

Hammer is a Vim plugin written (mostly) in Ruby. It can be used to transform your markup language of choice to HTML, and open the transformed HTML in whatever your favorite browser is.

It supports a large number of markup languages out of box but it also supports adding custom renderers for markup languages it does not support.

It has support for multiple different layouts (with one styled like the GitHub README layout). You can use your favorite template language to draw up your own layouts (ERB, HAML, โ€ฆ). Layouts are passed the rendered HTML as a partial.

People familiar with Ruby web development should feel right at home with the layout & partial style templates.

SUPPORTED MARKUP

  • .markdown -- gem install redcarpet
  • .textile -- gem install RedCloth
  • .rdoc
  • .org -- gem install org-ruby
  • .creole -- gem install creole
  • .mediawiki -- gem install wikicloth
  • .rst -- easy_install docutils
  • .asciidoc -- brew install asciidoc
  • .pod -- Pod::Simple::HTML comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.
  • .1 -- Requires groff
  • .html
  • .xhtml

COMMANDS

The :Hammer command will transform your content to HTML, and open your browser.

CONFIG VARIABLES

  • g:HAMMER_DIRECTORY The path where transformed HTML files are kept. Defaults to /tmp on UNIX, and $TEMP on Windows.

  • g:HAMMER_BROWSER The path to a browser for viewing HTML files. Defaults to open on OSX, start on Windows, and xdg-open on X11 machines.

  • g:HAMMER_TEMPLATE The template to use. Defaults to 'default', a GitHub-esque README template.

  • g:HAMMER_BROWSER_ARGS Optional arguments to pass to the browser command. On OS X, it can be useful to set this to '-g' to open the browser window in the background.

INSTALL

You may need to install other dependencies for your markup language (See Above)

$ [sudo] gem install github-markup tilt
$ git clone git://github.com/robgleeson/hammer.vim.git
$ cp -R hammer.vim/plugin/* $HOME/.vim/plugin

SCREENSHOTS

RVM USERS

If you use RVM, it may be the culprit of what appear to be random segmentation faults but they're not random and their cause is easily pin pointed.

RVM sets $GEM_HOME and $GEM_PATH to point at the gems for the currently selected RVM ruby, but Vim may not be built against the Ruby selected by RVM. If Vim were to be built against 1.8 and RVM pointed at gems for 1.9, you'll see Vim try to load 1.9 C extensions, which can end up causing segmentation faults in the worst possible scenario.

The solution proposed by Wayne Seguin(author of RVM) is to define 'vim' as a shell function that unsets $GEM_HOME and $GEM_PATH before the launch of Vim:

mvim()
{
  (unset GEM_PATH GEM_HOME; command mvim "$@")
}

LICENSE

See LICENSE.txt

TODO

hammer.vim's People

Contributors

nelstrom avatar lmarburger avatar kylewest avatar henrik avatar kelan avatar maba avatar mattijs avatar oj avatar bronson avatar webframp avatar shad avatar zaiste avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.