Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coachshea/jade-vim
full-featured vim plugin for jade
https://github.com/coachshea/jade-vim
Last synced: about 16 hours ago
JSON representation
full-featured vim plugin for jade
- Host: GitHub
- URL: https://github.com/coachshea/jade-vim
- Owner: coachshea
- Created: 2014-04-07T20:18:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-22T23:03:56.000Z (over 9 years ago)
- Last Synced: 2023-08-17T09:42:13.636Z (over 1 year ago)
- Language: VimL
- Size: 242 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jade-Vim #
Full-featured Vim plugin for Jade
This is a fork of [vim-jade](https://github.com/digitaltoad/vim-jade.git)
## Installation
Installation using Tim Pope's [pathogen.vim](https://github.com/tpope/vim-pathogen).
```
cd ~/.vim/bundle git clone git://github.com/coachshea/jade-vim.git
```If you do not want to use pathogen. You can always install vim-jade in the
normal manner by copying each directory to your ~/.vim directory. Make sure not
to overwrite any existing directory of the same name and instead copy only the
contents of the source directory to the directory of the same name in your
~/.vim directory.## Usage
To view the compiled jade in a preview window use the JadeWatch command
```
:JadeWatch [html] [vert[ical]] [N]
```The html option will show the output as html as opposed to the default
javascript.The vert[ical] option wil show the display window in a vertical split.
The N option is a number which represents the size of the window.
Once a preview window is opened, it will automatically update on InsertLeave and
on BufWritePostFor convenience, it is recommended that shortcuts to your favorite options are
set in you .vimrc file. For example:```
au FILETYPE jade nnoremap h :JadeWatch html vert
au FILETYPE jade nnoremap j :JadeWatch vert
```The default complilers can be set with these options:
```
:let g:JadeCompiler = "myfavoritecompiler"
:let g:JadeHtmlCompiler = "myfavoriteHTMLcompiler"
```## jadeclient
Many people use [clientjade](https://github.com/jgallen23/clientjade.git) to
compile their front-end jade templates. Unfortunately, clientjade does not allow
for compilation from stdin and, therefore, does not play nice with this plugin.
I have created a fork of clientjade called
[jadeclient](https://github.com/coachshea/jadeclient.git), which is a superset
of clientjade. You can use it just as you've used clientjade and get the exact
same results. However, it has one additional option "-s" or "--stdin"
which allows for reading over stdin. For example:```
$echo "h1 hello" | jadeclient -sjade.templates["buffer"] = function(locals, attrs, escape, rethrow, merge) {
attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow =
rethrow || jade.rethrow; merge = merge || jade.merge; var buf = []; with
(locals || {}) { var interp; buf.push(''); } return
buf.join(""); }
```To use jadeclient with vim-jade simple type the following command (assuming a
global install, although it will work with a local install as well):```
:let g:JadeCompiler = "jadeclinet -s"
```This is, of course, not suited for production as every function will be named
"buffer", however it will allow you to quickly see what the compiled javascript
(minus the function name) will look like.If you are someone who uses jadeclient frequently, be sure to set the
global variable in your .vimrc to save time.