0

I am using slim with emacs for development. I am able to indent blocks of slim code by just marking the block and then pressing tab.

However how do I unindent a whole block back? Any help will be appreciated.

Thanks, Murtaa

ylluminate
  • 12,102
  • 17
  • 78
  • 152
murtaza52
  • 46,887
  • 28
  • 84
  • 120
  • What exactly do you mean by unindent? Remove all whitespace from the front of each line, or moving the whole block left by a fix amount of spaces/tabs? – Thomas Aug 23 '12 at 00:33
  • @Thomas thanks for the reply. I am would like to move the whole block left by a fix amount of spaces/tabs, how do I do that? – murtaza52 Aug 23 '12 at 05:11

1 Answers1

1

Select the code block, then do C-u - 4 C-x TAB to unindent the marked region by 4 spaces.

  • C-u allows to specify a prefix argument to the following indent command
  • - 4 gives the amount of indentation (-4). Since the number is negative, you're indenting to the left.
  • C-x TAB indents the region by the given amount.

This answer might also be interesting to you: https://stackoverflow.com/a/11624677/261142

Community
  • 1
  • 1
Thomas
  • 17,016
  • 4
  • 46
  • 70
  • thanks for the reply. When I tried the above I got this message `This buffer cannot use 'imenu-default-create-index-function'. – murtaza52 Aug 23 '12 at 06:23
  • Also I am using slim-mode which lets me indent 2 spaces with just a TAB. – murtaza52 Aug 23 '12 at 06:29
  • Which slim-mode are you using? I just tested the above method with the slim-mode from here: https://github.com/minad/emacs-slim and it works as expected. – Thomas Aug 23 '12 at 07:21