Sublime Forum

Disable auto indentation

#1

I would like to disable auto indentation altogether. Is this possible?

I checked and double checked the sublime preferences text files, and also did some forum searches but nothing came up. Am I overlooking this setting? I’m an old school notepad/metapad user and I just can’t get used to all this whitespace being added automatically :smile:

Thanks in advance!

0 Likes

#2

It’s not possible atm (not sure how I missed that), but I’ll change this for the next beta.

0 Likes

#3

Excellent! :smile: Thank you very much for your efforts!

0 Likes

#4

This in in the 20091029 beta, exposed as the option ‘autoIndent’

0 Likes

#5

Setting this to false does not seem to change any of the indent behaviour for me in the new beta… Maybe some other setting I have is conflicting with it? Here is my user file:

[code]# Sets the colors used within the text area
colorscheme Packages/Color Scheme - Default/Blackboard.tmTheme

Font to draw with. To override the system antialiasing settings, append

:noantialias to the end of the line.

font Lucida Console 10

The number of spaces a tab is considered equal to

tabSize 2

Set to false to stop auto pairing quotes, brackets etc

autoMatchEnabled false

Set to true to insert spaces when tab is pressed

translateTabsToSpaces true

Set to false for horizontal scrolling

wordWrap false

Set to ‘none’ to turn off drawing whitespace, ‘selection’ to draw only the

whitespace within the selection, and ‘all’ to draw all whitespace

drawWhiteSpace none

Set to false to hide the vertical and horizontal scroll bars

wantVerticalScrollBar false
wantHorizontalScrollBar true

Set to false to disable automatic indentation

autoIndent false[/code]

0 Likes

#6

When it’s off, pressing enter will still copy the leading white space from the previous line, but it won’t increase or decrease it in response to ‘{’, ‘}’ etc.

If you were expecting pressing enter to always leave the cursor the first column with to leading whitespace inserted, I’ve got nothing against adding an option for that too.

0 Likes

#7

Yes, please. Sorry, I wasn’t clear enough in my explanation :smile:

No automatic whitespace insertion was what I meant originally. Also the “smart home” behaviour, is rolled into that.

Cheers!

0 Likes

#8

Changed in 20091108 so that disabling auto indentation disables all automatic whitespace insertion.

0 Likes

#9

Success! It works just like I expected it to work! Thanks very much for being so responsive on this; you’ve definitely sold this customer. I’ll be buying a license and switching to Sublime :smiley:

I would still like to be able to disable the “smart home” behaviour, but the autoIndent was the biggie. I’ll make a new thread about that in the Feature requests forum and consider this issue closed.

Thanks again! :smile:

0 Likes

#10

I have been using Sublime with this option disabled for a while and apparently I have missed documenting one little thing.

If I’m working with indented text when the cursor is at the first character in the line, and I press backspace, then [tab width] space characters are removed instead of just one. Personally, since it has to do with automatic behaviours relating to indentation, I think this behaviour should be part of what is disabled with the “autoIndent false” option. My “translateTabsToSpaces” option has been set to “true”, if that makes any difference.

However, perhaps there is some way to fix this using the keybindings? Currently there is:

<binding key="backspace" command="leftDeleteCharacters"/>

But changing that to “leftDeleteCharacter” or “leftDelete” just disabled the backspace key :neutral_face: Any help?

Thanks!

0 Likes

#11

It would have to be done via a plugin currently, I’ll add an item to the todo list though.

0 Likes

#12

Excellent! Thank you once again. :smile:

0 Likes

#13

In 20091212, there’s now an option, ‘useTabStops’, that controls this behaviour.

0 Likes

#14

This does precisely what I expect. Cheers and thanks very much! :smile:

0 Likes

#15

[quote=“jps”]When it’s off, pressing enter will still copy the leading white space from the previous line, but it won’t increase or decrease it in response to ‘{’, ‘}’ etc.

If you were expecting pressing enter to always leave the cursor the first column with to leading whitespace inserted, I’ve got nothing against adding an option for that too.[/quote]

Is there an option for auto_indent that will make it copy the leading white space from the previous line? If not, could it be broken down into more finite options rather than just being one or the other?

0 Likes