summaryrefslogtreecommitdiffstats
path: root/autoload/coffee.vim
blob: 76eab3b009245f32473f011b853dd3c96c512967 (plain) (blame)
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
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1

" Language:    CoffeeScript
" Maintainer:  Mick Koch <mick@kochm.co>
" URL:         http://github.com/kchmck/vim-coffee-script
" License:     WTFPL

" Set up some common global/buffer variables.
function! coffee#CoffeeSetUpVariables()
  " Path to coffee executable
  if !exists('g:coffee_compiler')
    let g:coffee_compiler = 'coffee'
  endif

  " Options passed to coffee with make
  if !exists('g:coffee_make_options')
    let g:coffee_make_options = ''
  endif

  " Path to cake executable
  if !exists('g:coffee_cake')
    let g:coffee_cake = 'cake'
  endif

  " Extra options passed to cake
  if !exists('g:coffee_cake_options')
    let g:coffee_cake_options = ''
  endif

  " Path to coffeelint executable
  if !exists('g:coffee_linter')
    let g:coffee_linter = 'coffeelint'
  endif

  " Options passed to CoffeeLint
  if !exists('g:coffee_lint_options')
    let g:coffee_lint_options = ''
  endif

  " Pass the litcoffee flag to tools in this buffer if a litcoffee file is open.
  " Let the variable be overwritten so it can be updated if a different filetype
  " is set.
  if &filetype == 'litcoffee'
    let b:coffee_litcoffee = '--literate'
  else
    let b:coffee_litcoffee = ''
  endif
endfunction

function! coffee#CoffeeSetUpErrorFormat()
  CompilerSet errorformat=Error:\ In\ %f\\,\ %m\ on\ line\ %l,
                         \Error:\ In\ %f\\,\ Parse\ error\ on\ line\ %l:\ %m,
                         \SyntaxError:\ In\ %f\\,\ %m,
                         \%f:%l:%c:\ error:\ %m,
                         \%-G%.%#
endfunction

endif