Skip to content
Browse files

Add coffee_make_compiler to set a compiler path (#78)

  • Loading branch information...
1 parent e80c775 commit 014fb6e3f4e25b6f122f3f424648e67d7377421a @kchmck committed
Showing with 19 additions and 2 deletions.
  1. +7 −0 Readme.md
  2. +7 −1 compiler/coffee.vim
  3. +5 −1 doc/coffee-script.txt
View
7 Readme.md
@@ -116,6 +116,13 @@ variable along to the compiler. You can use this to set default options:
let coffee_make_options = "--bare"
+#### Path to compiler
+
+To change the compiler used by `CoffeeMake`, set `coffee_make_compiler` to the
+full path of an executable or the filename of one in your `$PATH`:
+
+ let coffee_make_compiler = "/usr/bin/coffee"
+
### CoffeeCompile: Compile Snippets of CoffeeScript
The `CoffeeCompile` command shows how the current file or a snippet of
View
8 compiler/coffee.vim
@@ -11,6 +11,11 @@ let current_compiler = 'coffee'
" Pattern to check if coffee is the compiler
let s:pat = '^' . current_compiler
+" Path to CoffeeScript compiler
+if !exists('coffee_make_compiler')
+ let coffee_make_compiler = 'coffee'
+endif
+
" Extra options passed to CoffeeMake
if !exists("coffee_make_options")
let coffee_make_options = ""
@@ -19,7 +24,8 @@ endif
" Get a `makeprg` for the current filename. This is needed to support filenames
" with spaces and quotes, but also not break generic `make`.
function! s:GetMakePrg()
- return 'coffee -c ' . g:coffee_make_options . ' $* ' . fnameescape(expand('%'))
+ return g:coffee_make_compiler . ' -c ' . g:coffee_make_options . ' $* '
+ \ . fnameescape(expand('%'))
endfunction
" Set `makeprg` and return 1 if coffee is still the compiler, else return 0.
View
6 doc/coffee-script.txt
@@ -57,7 +57,11 @@ You can configure plugin behavior using global variables and syntax commands
in your |vimrc|.
Global Settings~
-
+ *g:coffee_make_options*
+Set the path to the compiler used by |CoffeeMake| (by default it's {coffee})
+>
+ let coffee_make_compiler = '/usr/bin/coffee'
+<
*g:coffee_make_options*
Set default options |CoffeeMake| should pass to the compiler.
>

0 comments on commit 014fb6e

Please sign in to comment.
Something went wrong with that request. Please try again.