Textmate 2 Tips

  • Archive
  • RSS
  • Submit

Strip trailing whitespace on Save with …callbacks!

Open the bundle editor (⌃⌥⌘B) and open “Text” → “Menu Actions” → “Converting / Stripping” → “Remove Trailing Spaces in Document / Selection”.

Then in the drawer put callback.document.export in Semantic Class and Document / Replace Document as Input / Output.

Hooray! From now on each time you’ll save a document all trailing space will be stripped!

Bundle Editor

    • #trailing whitespace
    • #textmate2
    • #callbacks
    • #stripping
    • #submission
  • 3 months ago
  • 8
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Replicating Edit Each Line In Selection

Here’s a great tip from eirkeirkeirk :

 I noticed the ⌘⌥A command was gone from TM2. But I figured out a way to replicate it.

- Select all the lines you want to edit

- Turn it into a column selection (tap ⌥)

- Then ⌘→ to move all the carets to the end of each line

This is actually better than the previous incarnation because:

- You can actually see the carets, where as before you were typing blindly

- Each caret acts smarter. So you can do things like  ⌥← to move back one word in each line.

He’s also provided a quick video showing it in action: http://dl.dropbox.com/u/364257/editall.mov

    • #Multiple Carets
    • #Multi select
    • #submission
  • 1 year ago
  • 2
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

An excellent example of a .tm_properties file

A big thanks to hmans for sharing his .tm_properties file. Particularly useful are his instructions on how to hide specific directories (in this case: log, vendor and tmp) from the “Find File” dialog, but not from the project browser.

    • #.tm_properties
    • #Settings
    • #Preferences
    • #submission
  • 1 year ago
  • 11
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

SmartFolders

You can access a “Smart Folder” from the top bar of the folder drawer by clicking on the purple folder with a gear on it. This folder gives you a view of ‘Uncommitted Changes’ and ‘Untracked Files’ in your project*.

smart folder on textmate

You can select files you want to commit using the Git bundle’s “Commit…” command (makes it easier if assign a shortcut to this menu item — maybe ⌘⌥⌃C — though you can use this tip to find one that doesn’t conflict).

You can also access a diff viewer from here which opens within textmate itself. Not ideal compared to GitX or Github, but for small commits it’s nice to not have to switch away from Textmate.

*This requires that you are using a source control system such as Git, Subversion or Mercurial, and that you have configure the proper path in .tm_properties.

    • #scm
    • #file browser
    • #git
    • #svn
    • #hg
    • #smart folder
    • #submission
  • 1 year ago
  • 20
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Logo

Textmate 2: The missing manual. Help us out by submitting any tips or tricks you come across!

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Submit
  • Mobile

Brought to you by Ned Schwarz..

Effector Theme by Pixel Union