Emacs – tabs

by

To make an emacs mode forget about the indentation rules and insert tabs whenever you press the TAB key, add this to your .emacs file:

(define-key html-mode-map (kbd “TAB”) ‘self-insert-command); # only in html-mode

If you don’t really want tabs, but spaces to be inserted whenever you press the TAB key, add this to your .emacs file:

(define-key html-mode-map (kbd “TAB”) ‘tab-to-tab-stop); # only in html-mode

Make sure to call the above function in a mode hook.

You might also want to edit the size of each tab, so use:

M-x edit-tab-stops

For more info:
http://www.student.northpark.edu/pemente/emacs_tabs.htm

Advertisements

One Response to “Emacs – tabs”

  1. Hasit Mistry Says:

    Very helpful. Thank you

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: