+17

soft indentation / soft tabs

Collin Donahue-Oponski 12 ár síðan updated by hced 11 ár síðan 9
I would love it if you copied textmate's soft tabs.  I don't want to convert entire files to spaces or tabs and make the file history confusing and/or break other people's indentation that they like.  I just want sublime to auto-detect the tab size and when i'm at the beginning of the line and press the left or right arrow key, it should jump over 4 spaces and look like i'm jumping over a tab.  Another way to put this is that I would love it if my cursor jumped between TAB guides at the beginning of the line.

Thank you for building a life-changing code editor!  My life has been so much easier the last two weeks.
+1
try to play with:
translate_tabs_to_spacesuse_tab_stopsdetect_indentation

in Preferences -> File Settings - Default


hope it help

+5
Unfortunately, none of these apply to what he's talking about. He wants spaces to act as tabs when using the arrow keys to move through his text.
+1

You can also use shift-tab to go back one (hard/soft) tab. It would be nice if the arrow keys worked for going between tabs, but this suffices too. And this is handy in some other editors as well, like Notepad++.

+1

I googled "sublime text move between soft tabs" and this was my first find. Sadly I still haven't found a way to achieve this. Seems pretty obvious that if you choose to have Tabs as Spaces, you'd really want to be able to still treat those Soft Tabs as Tabs, in terms of movement... Right now, you're actually being forced to hit Arrow keys multiple times to jump between Tab Guides. (If you're not using e.g. Vintage Mode or some plugins, if any exist for this type of functionality.)


@Ehtesh: Shift-Tab moves the actual text, not just the cursor.


@Jon Skinner: Are there any ways in which this can be achieved, or plans to enable what the OP wants?

+1

Sorry (couldn't amend my previous message), here's an apology if my message came out a little too grumpy, especially the "seems pretty obvious.." part. :)

+2

Update for those interested:


I no longer miss this feature from textmate.  My keyflow has changed to use cmd+left to jump to the beginning of the text on the current line (regardless of whether your cursor is left or right of the beginning of the text), or cmd+left a second time to jump to the absolute beginning of the line.


+1

@Collin: The way Cmd-Left works is a sweet benefit, truly agree. But it doesn't replace or substitute the point of having Arrow keys jump between Tab Guides / Stops. I'd say it's still a crucial feature for frequent situations, let's say, when you want to place the cursor at 3rd Tab Stop out of 6. (Happens, right.)


Currently this requires 12 key presses instead of 3 (with a Tab Width of 4). Tab Width: 2 knocks it "down" to 6 keypresses instead of 3, but still, it's redundant labour compared to jumping straight between indentations regardless of your Soft Tabs setting. No miscredit intended to Sublime (it's my favorite editor), but this is almost comparable to TextMate's old undo behavior, reverting character by character instead of speeding things up.

+2

I guess that's what I'm saying - for me, it doesn't happen anymore.  Why do you need your cursor at the 3rd tab stop?  are you inserting text at a random tab stop?  Honest question because I can't imagine a reason you would need your cursor there, when you have easy key commands to increase/decrease indentation from within the line (cmd+[, cmd+]), to start a new line from within a line (cmd+enter), and navigate to beginning of text or beginning of line as in my last comment.

I'm contemplating what you wrote. You may actually be very right. The Cmd-Left shortcut appears to be the whole solution... Even though I'd stumbled across it sporadically earlier, it never occured to me how useful it is (even though I tried to fake it in my prev. comment). Your question seems also pretty spot on: why would I need to jump between Tabs, when Cmd-Left exist? Thinking and rethinking, I never came up with a good reason. Thanks!