If I select some leading spaces on a line, and hit tab, it just inserts a new tab character and indents the line including selection, rather than replacing the selection
Is there a way in TM2 to have the Tab character always replace the current selection (similar to most other text input)?
Thanks
On 3 Oct 2015, at 1:38, Carpii UK wrote:
Is there a way in TM2 to have the Tab character always replace the current selection (similar to most other text input)?
Create a snippet with a tab character and set its key equivalent to the tab key, then you get one tab character inserted (except when enabling soft tabs, here TextMate converts tabs in snippets to the proper amount of spaces).
If you only want this override to be active for replacements then set the scope selector to `dyn.selection`.
You can also scope it to `L:dyn.caret.begin` so that it only works when at the beginning of a line. The `L:` prefix here is because we want to match the scope to the left of the caret.
This works a treat. Thanks Allan!
On 3 October 2015 at 12:01, Allan Odgaard mailinglist@textmate.org wrote:
On 3 Oct 2015, at 1:38, Carpii UK wrote:
Is there a way in TM2 to have the Tab character always replace the current
selection (similar to most other text input)?
Create a snippet with a tab character and set its key equivalent to the tab key, then you get one tab character inserted (except when enabling soft tabs, here TextMate converts tabs in snippets to the proper amount of spaces).
If you only want this override to be active for replacements then set the scope selector to `dyn.selection`.
You can also scope it to `L:dyn.caret.begin` so that it only works when at the beginning of a line. The `L:` prefix here is because we want to match the scope to the left of the caret.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate