Skip to content

mitaki28/coffee-mode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

CoffeeScript Major Mode (Python-Mode Mixin Edition)

OverView

This is CoffeeScript Major Mode marging defunct's coffee-mode and python-mode's heardocs highlighting and smart delete.

basic information:https://github.com/defunkt/coffee-mode

Improvements

Indentation

Configuring

We can set our tab-width to two using set-coffee-tab-width in the coffee-mode-hook:

(defun coffee-custom ()
  "coffee-mode-hook"
 (set-coffee-tab-width 2))

(add-hook 'coffee-mode-hook
  '(lambda() (coffee-custom)))

If we use set-coffee-tab-width, we maybe avoid incorrect indentation bugs.

Indenters

else, switch, when, try, catch, finally also cause the next line to be indented a level deeper automatically.

And, this applies to lines ending in ( additionally.

Syntax Highlighting

Hear Documents

Screenshot

Powered by python-mode's highlight heardocs solution, we highlight heardocs correctly.

Patterns

Screenshot

Highlight lambda function, built-in function, Object's property and number literal.

Edit

Delete and Backspace

When you press backspace once:

line1()
    line2()
	^

delete spaces corresponding to one tab:

line1()
line2()
^

delete is the same. This feature is introduced from python-mode.

Un-Indent

When you press Shift-TAB:

line1()
    line2()
	      ^

we un-indent the line:

line1()
line2()
      ^

Region Indent

When you press C-c <, we un-indent region. And press C-c >, we indent region.

Thanks

About

Emacs Major Mode for CoffeeScript

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 91.8%
  • CoffeeScript 8.2%