Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

do you know how can one in Textmate open several windows for the same file?

So I can at the same time look and compare different parts of the same file.

share|improve this question
I don't think that's possible with TextMate. Maybe it's just quicker to copy everything, open a new window and paste everything - that's three keystrokes. – slhck Sep 6 '10 at 19:31
@slhck: It's four ;) Command-A, Command-C, Command-N, Command-V. – Wuffers Nov 7 '10 at 23:27
Haha, my bad, you're right of course. – slhck Nov 8 '10 at 9:44
Soon to be possible in TextMate 2 – bobobobo Apr 13 '13 at 19:38
yes because we need it , please – flow Apr 14 '13 at 9:48
up vote 1 down vote accepted

Quick AppleScript to do the copy-paste-etc. operation in sequence:

tell application "TextMate"
    tell application "System Events"
        keystroke "a" using command down
        keystroke "c" using command down
        keystroke "n" using command down
        keystroke "v" using command down
        keystroke "a" using command down
        key code "55"
    end tell
end tell

Basically it executes Select All, Copy, New, Paste, Select All, Up (the last two commands bring the cursor to the top of the newly duplicated file). The new file also will not be syntax-highlighted until you explicitly set the language; that may help distinguish between the original and the duplicate.

In a more advanced version, you could actually grab the filename, duplicate it to a temporary location, and then open it, but then you'd have to maintain the two versions and there's a risk you would modify the duplicate without realizing it.

Hope it helps.

share|improve this answer

If you are working in a "project" you can right-click on a file in the drawer and open it in a new window.

Both "views" are going to stay more or less in sync but complex manipulations can somehow break synchronization.

share|improve this answer

While having the original file open in TextMate, open another instance of TextMate from Terminal

open -na TextMate FILEPATH

This way you'll have two separate instances of TextMate in which you can read and edit the file from two different windows.

EDIT: I wrote "two", but you can actually open as many instances as you want.

share|improve this answer
TextMate prevents that. It's one of the applications open -n fails on. – Daniel Beck Apr 16 '11 at 4:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .