- CoffeeScript Application Development
- Ian Young
- 442字
- 2021-04-09 23:58:32
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.
- GIMP 2.6 cookbook
- Excel圖表與表格實(shí)戰(zhàn)技巧精粹
- Object/Oriented Programming in ColdFusion
- Photoshop CC超級(jí)學(xué)習(xí)手冊(cè)
- Adobe Illustrator 2023基礎(chǔ)教材
- SolidWorks 2019快速自學(xué)寶典
- 邊做邊學(xué):平面廣告設(shè)計(jì)與制作(Photoshop 2020+Illustrator 2020·第3版·微課版)
- Oracle Fusion Middleware Patterns
- Python 3 Object Oriented Programming
- UG NX 12.0中文版從入門到精通
- Photoshop CS6數(shù)碼照片處理入門到精通
- MATLAB在日常計(jì)算中的應(yīng)用
- Oracle Web Services Manager
- Cinema 4D R20完全學(xué)習(xí)手冊(cè)
- MATLAB科研繪圖與學(xué)術(shù)圖表繪制從入門到精通