// By default, shift+tab will only unindent if the selection spans
// multiple lines. When pressing shift+tab at other times, it'll insert a
// tab character - this allows tabs to be inserted when tab_completion is
// enabled. Set this to true to make shift+tab always unindent, instead of
// inserting tabs.
"shift_tab_unindent": false,

If @adzenith 's advice works (I didn't test it), it should be very easy to create a macro with the three commands (rather than messing with python, if you don't want to), which you can then invoke by a keybinding, menu item or command in the palette.

What I end up doing in these cases, where I don't want to be bothered with toggling the setting, is to insert some odd character (like a backtick) into the doc where I want tabs, and then do a find/replace, replacing the backtick with \t (regex tab). This allows me to sneak the tab(s) in there.

+1I use spaces for indentation, but I occasionally use the ElasticTabstops plugin to format tables of data.So I'd like the Tab key to enter spaces at the beginning of the line, but a literal tab when used in the middle of a line of text.Has anybody written a plugin to do this?