murtaza52
murtaza52

Reputation: 47431

how to get automatic indentation and 'end' blocks for rails with emacs

I am developing with rails on emacs. I have installed the rinari mode. I have two questions -

1) Automatic indentation - When I am writing code and go to a new line it doesnt ident it by default. I have to press tab inorder for the line to be indented.

How do I get emacs to set the correct indentation on all new lines, and as I write code ?

2) Closing 'end'. I was writing lisp code before and loved the way closing parenthesis were included by default. Then parendit mode even prohibited me from deleting parenthesis by mistake and also highlighted any missing ones.

How do I get the same functionality for missing 'end' blocks ?

Upvotes: 0

Views: 117

Answers (1)

pmr
pmr

Reputation: 59831

For the begin/end blocks you can probably use autopair or skeleton-pair. This will not be as awesome as paredit but a step in the right direction.

For indentation: Usually RET is bound to newline while C-j is bound to newline-and-indent. I highly recommend to start using C-j over RET or to change the bindings.

Upvotes: 1

Related Questions