defunkt / coffee-mode

Emacs Major Mode for CoffeeScript
http://ozmm.org/posts/coffee_mode.html
574 stars 147 forks source link

How is it possible to insert new line without indenting? #357

Closed kb01 closed 8 years ago

kb01 commented 8 years ago

Hello,

I read the doc, but I didn't find any way to insert new line without indenting below any code block I want to end -- I find it little bit boring to undo the indentation, of the line succeeding each code block end, manually - Therefore I'm asking for a solution to make the process happen more automatically.

Your help will be much appreciated.

Thank you.

syohex commented 8 years ago

Please overwrite key maps as below.

(define-key coffee-mode-map (kbd "RET") #'newline)
kb01 commented 8 years ago

@syohex Thank you for the quick reply.

Adding the code to .emacs file, as you recommended above, causes the editor to ignore completely the indentation - which is not what I was expecting: Only after the last line in every code block, I need the indentation to be ignored -- so is there any possibility to achieve that?

syohex commented 8 years ago

Ah, I misunderstood. There is no way. Because it is language specification and we cannot detect code block ends.

kb01 commented 8 years ago

@syohex Ok. But, can you add a key binding that helps doing the trick at the click of a button? that would be extremely helpful.

syohex commented 8 years ago

No. Please add it to your configuration file by yourself.