I use HAML a lot, it’s a very nice templating language. And I copy a lot of html/erb snippets to my haml views. Here is how you can configure vim to convert your html to haml.
1) Install the html2haml gem. If you are using rvm, generate a wrapper using the code below.
1 |
|
2) Add the following mapping to your ~/.vimrc
1 |
|
That’s it, now you can select a block of text and hit the <leader>h
command
to convert your html/erb to haml. You need to make sure that the paths and the
rvm strings correspond to your machine settings to get this working, also
html2haml needs a few more gems. Check html2haml for more info
I am currently working on LiveForm which makes
setting up contact forms on your website a breeze.