aboutsummaryrefslogtreecommitdiff
path: root/vim/doc/coffee-script.txt
blob: 792ffff2dd295612584cf9125fb5285d1b194d90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
*coffee-script.txt*	Plugin for editing, compiling and running CoffeeScript

=============================================================================
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

{Vi does not have any of this}

=============================================================================

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.


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.

						*:CoffeeCompile*
:[range]CoffeeCompile [vertical] [{win-size}]
			Shows how the current file or [range] will be 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,
			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.

						*: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|.

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|.

Syntax Highlighting~
						*ft-coffee-script-syntax*
Trailing whitespace is highlighted as an error by default. This can be
disabled with:
>
	hi link coffeeSpaceError NONE

Trailing semicolons are also considered an error (for help transitioning from
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:
>
	hi link coffeeReservedError NONE


=============================================================================

LICENSE							*coffee-script-license*

		DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
			Version 2, December 2004

     Copyright (C) 2010 to 2011 Mick Koch <kchmck@gmail.com>

     Everyone is permitted to copy and distribute verbatim or modified
     copies of this license document, and changing it is allowed as long
     as the name is changed.

		DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
       TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

      0. You just DO WHAT THE FUCK YOU WANT TO.

 vim:tw=78:ts=8:ft=help:norl: