Textmate 2 Tips

Feb 09

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

Jan 25

Create a new file in a project folder

One of the big changes in TM2 is that you can no longer create new files from the Project Drawer’s right click menu. This was a handy feature that I honestly miss.

Fortunately, there is a work around though it’s somewhat less intuitive.

  1. Create a new file/tab by hitting ⌥⌘N or choosing File > New Tab from the menu.
  2. Select the folder that you want to save the file in from the File Browser/Project Drawer:

    Selecting a folder in the file drawer

    Here I have the stylesheets folder selected.

  3. Save the new tab (“untitled” in the screenshot above) by hitting ⌘S or choosing File > Save from the menu.
  4. The file dialog will come up with the folder you chose in step 2 selected.

    There's your folder

    The save dialog with your folder selected.

  5. Give your new file a name and hit Enter or click Save and the file will be right where you want it!

    A new file created in a folder of your choosing

    There it is.

It’s worth pointing out that steps 1 and 2 can be done in any order.

Dec 19

Launch files from the File Browser with a single click

Open files with a single click

Want to be able to open files in the File Browser with a single click like you used to in TextMate 1? Click the file’s icon! A lot of people are asking about this one.

8956 Released

Development continues. This release allows you to disable the functionality that hides the tab bar when only one file is open. Disabling that auto hide makes Textmate 2’s functionality like that of Textmate 1.

2011-12-18

TextMate Blog » Multiple Carets -

In this article will discuss:

Dec 18

⌘X in the File Browser

Allan pointed out to us yesterday that In addition to ⌘C one can also use ⌘X and ⌘V to move/copy files around (⌘X doesn’t “cut” before ⌘V is used).

Language codes -

Thanks to llamageddon for this list of language codes used for spellingLanguage in tm_properties

Dec 17

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

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.

8949 Released

I was delighted to see a significant update to the alpha released earlier today, with some much anticipated features/settings added. The big items here are the ability to disable text aliasing, the ability to put the file-browser on the right side of the window, and the option for HTML output to have its own window. See below for the complete release notes:

2011–12–16