Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When in markdown-mode, I would like to disable smart indent. Instead, when I highlight a block of code and press TAB, I would like the block to be indented one level deeper, like how Sublime does it.

What goes in my ~/.emacs to achieve this?

share|improve this question
    
Could you show an example of your desired output for those of us who do not use sublime? –  terdon Mar 22 '13 at 16:08

2 Answers 2

up vote 1 down vote accepted

You can use the indent-rigidly command to do this. I would however not recommend disabling markdown-mode's standard TAB binding since it does much more than indenting (for exemple it cycles visibility when point is on a header line)

For example, put this in your initialization file to bind C-TAB to rigid indentation:

(eval-after-load "markdown-mode"
  '(define-key markdown-mode-map (kbd "C-<tab>")
     (lambda ()
       (interactive)
       (indent-rigidly (region-beginning) (region-end) 4))))
share|improve this answer

Try: C-u C-x Tab. Should be working in any mode.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.