These files add Vim syntax highlighting and indenting support for the fantastic CoffeeScript language.
This is a heavyweight/opinionated syntax highlighting file. It's heavyweight in that the only thing NOT colored is function calling and (most) property access. It's opinionated because I slowly add syntax highlighting that helps me avoid the errors I commonly make. I consider both of these pluses but some people don't like it since it results in a visually busy screen.
Most importantly, this syntax file highlights assignment and full function
declarations. Sounds minor, but the flip side to Coffeescript's elegant syntax
is that there's a significant difference between
toString: "$@name:$@id" and
toString: -> "$@name:$@id" even though there's
only a 4 character difference from first to last. Other examples are parens for
foo ('bar')) vs parens for function calls (
property access (
foo['bar']) vs array literals (
In addition, the cursor is automatically indented or outdented based on the
surrounding context. For example, hitting the return key after an
will indent the cursor one
shiftwidth; doing the same after certain
statements -- ones without an attached
unless statement, that is --
will instead outdent the cursor.
If you want to be boring, grab the tarball and extract it in your
~/vimfiles directory like any other vim extension.
If you're feeling adventurous and on an OS that supports symlinks, you can
install it the way I install my plugins. Grab my plugin installer rakefile,
and put it in your
~/.vim file, and then add
alias vim-install="rake -f
$HOME/.vim/rakefile-vim-install" to your .rc file. From there, all you have to
do is clone a plugin repo, change to the directoy, and
vim-install to symlink
everything into the proper location. I do this for all the plugins I have
installed, which allows me to keep everything up to date easily with
pulls and to maintain my own (generally unrelased) patches through updates. It
also allows easy uninstalls: