Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Add syntax error customization (thanks patrkris)

The coffee_no_trailing_space_error and coffee_no_trailing_semicolon_error
options can be used to disable those respective errors
  • Loading branch information...
commit 1a2148eef1d56bf839447205b0273bc9cbb0f2b3 1 parent 80f735f
@kchmck authored
Showing with 26 additions and 4 deletions.
  1. +18 −0
  2. +8 −4 syntax/coffee.vim
@@ -51,3 +51,21 @@ extension or a `Cakefile` will load all the CoffeeScript stuff.
$ git pull
Everything will then be brought up to date!
+### Customizing
+Some of the possibly unwanted syntax highlighting elements can be disabled
+in the following ways.
+#### Disable trailing whitespace error highlighting
+If having trailing whitespace highlighted as an error is a bit much, the
+following line can be added to your `~/.vimrc` to disable it:
+ let coffee_no_trailing_space_error = 1
+#### Disable trailing semicolon error highlighting
+Likewise for the highlighting of trailing semicolons:
+ let coffee_no_trailing_semicolon_error = 1
12 syntax/coffee.vim
@@ -122,12 +122,16 @@ syntax region coffeeHeredoc start=/'''/ end=/'''/ contains=@coffeeSimpleString
highlight default link coffeeHeredoc String
" Displays an error for trailing whitespace
-syntax match coffeeSpaceError /\s\+$/ display
-highlight default link coffeeSpaceError Error
+if !exists("coffee_no_trailing_space_error")
+ syntax match coffeeSpaceError /\s\+$/ display
+ highlight default link coffeeSpaceError Error
" Displays an error for trailing semicolons
-syntax match coffeeSemicolonError /;$/ display
-highlight default link coffeeSemicolonError Error
+if !exists("coffee_no_trailing_semicolon_error")
+ syntax match coffeeSemicolonError /;$/ display
+ highlight default link coffeeSemicolonError Error
" Displays an error for reserved words
syntax keyword coffeeReservedError case default do function var void with const
Please sign in to comment.
Something went wrong with that request. Please try again.