5

Typing in TextMate 2 used to be an adventure in indentation frustration, now cured by a global disableIndentCorrections setting. Pasting code, however, always seems to end up in a very wrong indentation level. It's making me crazy.

I've come across the following settings:

{   disableIndentCorrections = :true;
    indentOnPaste = 'default';
}

And in searching I've seen indentOnPaste set to 'default' or 'simple', both of which have code jumping multiple tabs to the right when it really, really should not.

Anyone know how to disable indentation on paste?

2 Answers2

2
  1. Press ---B to enter the Bundle Editor.
  2. Select TextSettingsDisable Indention Correction.
  3. In the right pane, remove the contents of the Scope Selector field to let these settings apply globally.

By default, the contents of the selected item should read as follows:

{   disableIndentCorrections = :true;
    indentOnPaste = 'simple';
}

so there is no need to modify them.

neoxic
  • 535
  • 3
  • 12
0

Taken from the r9283 release notes:


Split disableIndentCorrections into two settings:

The disableIndentCorrections setting disables the (aggressive) indent corrections that TextMate does while you type.

An additional indentOnPaste setting controls how to indent when pasting and can be set to:

  1. simple — this is the indent behavior which was previously implied when setting disableIndentCorrections. It indents the paste to the position of the caret and works well for Python.
  2. disable — the text is inserted as-is without indenting it.
  3. «unset» — indent the paste based on the indent patterns of the current scope.
Michael Sheets
  • 543
  • 3
  • 5
  • Good eye on catching that in the release notes. Unfortunately, indentOnPaste = 'disable' does not actually disable needless indents when pasting. – Metric Scantlings Sep 27 '12 at 18:52
  • This solution did not work for me either. Even removing the increaseIndentPattern from the grammar completely had no effect on the 'ident on paste' behavior. I'm using v2.0-alpha.9495. – Dirk Geurs Nov 19 '13 at 19:19