Permalink
Browse files

Update dox

  • Loading branch information...
1 parent af645c6 commit 4824ea37407cc9bc56627d3542ac2cb5949d93e2 @kchmck committed Oct 17, 2011
Showing with 46 additions and 43 deletions.
  1. +12 −6 Readme.md
  2. +34 −37 doc/coffee-script.txt
View
@@ -1,6 +1,6 @@
This project adds [CoffeeScript] support to the vim editor. It handles syntax,
indenting, and compiling. Also included is an [eco] syntax and support for
-CoffeeScript in HTML.
+CoffeeScript in Haml and HTML.
![Screenshot](http://i.imgur.com/BV29H.png)
@@ -21,21 +21,21 @@ This is the quickest way to get things running.
These steps are also used to update the plugin.
[zipball-vim]: http://www.vim.org/scripts/script.php?script_id=3590
-[zipball-github]: https://github.com/kchmck/vim-coffee-script/archives/master
+[zipball-github]: https://github.com/kchmck/vim-coffee-script/downloads
### Pathogen Installation
Since this plugin has rolling versions based on git commits, using pathogen and
git is the preferred way to install. The plugin ends up contained in its own
-directory, and updates are just a `git pull` away.
+directory and updates are just a `git pull` away.
1. Install tpope's [pathogen] into `~/.vim/autoload/` and add this line to your
`vimrc`:
call pathogen#infect()
To get the all the features of this plugin, make sure you also have a
- `filetype plugin indent on` line.
+ `filetype plugin indent on` line in there.
[pathogen]: http://www.vim.org/scripts/script.php?script_id=2332
@@ -89,6 +89,10 @@ Options given to `CoffeeMake` are passed along to `coffee`:
:CoffeeMake --bare
+`CoffeeMake` can be manually loaded for a file with:
+
+ :compiler coffee
+
#### Recompile on write
To recompile a file when it is written, add an `autocmd` like this to your
@@ -143,13 +147,15 @@ The initial size of the CoffeeCompile buffer can be given as a number:
#### Watch (live preview) mode
-Watch mode brings to vim the "Try CoffeeScript" live preview box on the
-CoffeeScript homepage (or something like it):
+Watch mode is like "Try CoffeeScript" preview box on the CoffeeScript homepage:
![Watch Mode](http://i.imgur.com/wIN6h.png)
![Watch Mode](http://i.imgur.com/GgdCo.png)
![Watch Mode](http://i.imgur.com/QdpAP.png)
+Making changes in the source buffer and exiting insert mode automatically
+updates the preview buffer with the compiled JavaScript.
+
Use `watch` to start watching a buffer (`vert` is also recommended):
:CoffeeCompile watch vert
View
@@ -1,16 +1,15 @@
-*coffee-script.txt* Plugin for editing, compiling and running CoffeeScript
+*coffee-script.txt* For Vim version 7.3
=============================================================================
Author: Mick Koch <kchmck@gmail.com> *coffee-script-author*
License: WTFPL (see |coffee-script-license|)
-
=============================================================================
CONTENTS *coffee-script-contents*
|coffee-script-introduction| Introduction and Feature Summary
-|coffee-script-commands| Commands
-|coffee-script-settings| Settings
+|coffee-script-commands| Commands
+|coffee-script-settings| Settings
{Vi does not have any of this}
@@ -19,61 +18,50 @@ CONTENTS *coffee-script-contents*
INTRODUCTION *coffee-script*
*coffee-script-introduction*
-This plugin provides facilities for editing CoffeeScript, including syntax
-highlighting, indenting and compilation. Also included is syntax support for
-Eco templates, and handling of {text/coffeescript} in HTML.
-
+This projects adds support CoffeeScript syntax, indenting, and compiling. Also
+included is an eco syntax and support for CoffeeScript in Haml and HTML.
COMMANDS *coffee-script-commands*
*:CoffeeMake*
-:CoffeeMake {opts} Calls |:make!|, with 'makeprg' being "coffee -c" plus
- any additional {opts} given. Opens the |quickfix|
- window if there are any errors and jumps to the first
- error. You may set |g:coffee_make_options| to specify
- default command-line options that will always be
- passed. By default, all compiler output is shown --
- running with |:silent| will hide this.
-
- *:CoffeeMake!*
-:CoffeeMake! {opts} As with :CoffeeMake, but will not jump to the first
- error.
+:CoffeeMake[!] {opts} Wrapper around |:make| that also passes options in
+ |g:coffee_make_options| to the compiler. Use |:silent|
+ to hide compiler output. See |:make| for more
+ information about the bang and other helpful commands.
*:CoffeeCompile*
:[range]CoffeeCompile [vertical] [{win-size}]
- Shows how the current file or [range] will be compiled
- to JavaScript. [vertical] (or vert) splits the
+ Shows how the current file or [range] is compiled
+ to JavaScript. [vertical] (or vert) splits the
compile buffer vertically instead of horizontally, and
{win-size} sets the initial size of the buffer. It can
be closed quickly with the "q" key.
:CoffeeCompile {watch} [vertical] [{win-size}]
The watch mode of :CoffeeCompile emulates the "Try
CoffeeScript" live preview on the CoffeeScript web
- site -- after making changes to the source file,
+ site. After making changes to the source file,
exiting insert mode will cause the preview buffer to
- update automatically. {watch} should be given as
- "watch" or "unwatch," where the latter will of course
- stop the automatic updating. [vertical] is
- recommended, and 'scrollbind' is useful.
+ update automatically. {watch} should be given as
+ "watch" or "unwatch," where the latter will stop the
+ automatic updating. [vertical] is recommended, and
+ 'scrollbind' is useful.
*:CoffeeRun*
:[range]CoffeeRun Compiles the file or [range] and runs the resulting
JavaScript, displaying the output.
-
SETTINGS *coffee-script-settings*
-You can configure plugin behavior by setting global variables or syntax
-highlighting directives in your |vimrc|.
+You can configure plugin behavior using global variables and syntax commands
+in your |vimrc|.
Global Settings~
-You may set these in your |vimrc| as illustrated below.
-
- *g:coffee_make_options* >
- let g:coffee_make_options='--bare'
-Always include the specified options when compiling with |:CoffeeCompile|.
+ *g:coffee_make_options*
+Set default options to pass to the compiler with |CoffeeMake|:
+>
+ let g:coffee_make_options = '--bare'
Syntax Highlighting~
*ft-coffee-script-syntax*
@@ -87,11 +75,20 @@ JavaScript.) This can be disabled with:
>
hi link coffeeSemicolonError NONE
-Reserved words like {function} and {var} are highlighted as an error in
-contexts disallowed by CoffeeScript. This can be disabled with:
+Reserved words like {function} and {var} are highlighted where they're not
+allowed in CoffeeScript. This can be disabled with:
+>
+ hi link coffeeReservedError NONE
+
+COMPILER *compiler-coffee-script*
+
+A CoffeeScript compiler is provided as a wrapper around {coffee} and can be
+loaded with;
>
- hi link coffeeReservedError NONE
+ compiler coffee
+This is done automatically when a CoffeeScript file is opened if no other
+compiler is loaded.
=============================================================================

0 comments on commit 4824ea3

Please sign in to comment.