Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
CoffeeScript Application Development

You're reading from   CoffeeScript Application Development What JavaScript user wouldn't want to be able to dramatically reduce application development time? This book will teach you the clean, elegant CoffeeScript language and show you how to build stunning applications.

Arrow left icon
Product type Paperback
Published in Aug 2013
Publisher Packt
ISBN-13 9781782162667
Length 258 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ian Greenleaf Young Ian Greenleaf Young
Author Profile Icon Ian Greenleaf Young
Ian Greenleaf Young
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

CoffeeScript Application Development
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
1. Running a CoffeeScript Program FREE CHAPTER 2. Writing Your First Lines of CoffeeScript 3. Building a Simple Application 4. Improving Our Application 5. Classes in CoffeeScript 6. Refactoring with Classes 7. Advanced CoffeeScript Usage 8. Going Asynchronous 9. Debugging 10. Using CoffeeScript in More Places 11. CoffeeScript on the Server Index

CoffeeScript support in the editor


Let's add support for CoffeeScript to your favorite text editor. This step is optional, but I heartily recommend it. At a minimum, these plugins will provide syntax highlighting for CoffeeScript files, which I find very helpful. In addition, most plugins integrate with the editor to allow you to run or compile CoffeeScript snippets without leaving the editor. You don't need these features, but you may find them convenient.

Tip

We'll discuss CoffeeScript support in some of the most popular editors, but there are plugins available for many more. A full list is available on the CoffeeScript wiki at https://github.com/jashkenas/coffee-script/wiki/Text-editor-plugins/.

Follow the instructions to install CoffeeScript in your editor of choice. After installing, restart your editor and try it out by opening setup.coffee. You will see some simple syntax highlighting on the code we just wrote to indicate that the plugin is working correctly.

Support in TextMate

Jeremy Ashkenas, the creator of CoffeeScript, has written a TextMate bundle that provides syntax highlighting, snippets, and inline compilation. Visit the project homepage at https://github.com/jashkenas/coffee-script-tmbundle and follow the installation instructions.

Support in Sublime Text 2

Sublime Text users have several choices available for CoffeeScript support.

One option is to use parts of the TextMate bundle. To use this, create a CoffeeScript directory in Sublime Text's plugin directory (on OS X, this is found at ~/Library/Application Support/Sublime Text 2). Then, download the bundle, extract Syntaxes/CoffeeScript.tmLanguage and Preferences/CoffeeScript.tmPreferences and place these files in the new directory. To simplify the process, you can download these two files directly using the following URLs:

The other option is to use the native Sublime Text plugin for CoffeeScript. This offers more features and is built specifically for Sublime Text. Visit the project homepage at http://xavura.github.io/CoffeeScript-Sublime-Plugin/ and follow the installation instructions.

Support in Vim

A Vim script is available that provides syntax highlighting as well as a :CoffeeCompile command to compile CoffeeScript on the fly. Visit the project homepage at https://github.com/kchmck/vim-coffee-script/ and follow the installation instructions.

Tip

The official repository for this plugin may be abandoned by the original maintainer, and there are several annoying bugs that have gone unfixed. You may wish to install a patched version from one of the several active forks of the project instead, such as https://github.com/CITguy/vim-coffee-script/. Follow the provided installation instructions, but be sure to download files from GitHub and not vim.org. Substitute the fork you are using whenever the instructions specify kchmck/vim-coffee-script.

Support in Emacs

There is an Emacs Major Mode named coffee-mode that provides syntax highlighting, menu support, and on-the-fly compiling. Install it from the Emacs package archive, or visit the project homepage at https://github.com/defunkt/coffee-mode for more information.

You have been reading a chapter from
CoffeeScript Application Development
Published in: Aug 2013
Publisher: Packt
ISBN-13: 9781782162667
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image