I doubt this can be done with the current version of TextMate but I want to put it out there and see what people suggest.
When working on git repositories, I find myself jumping from branch to branch often. We use branches heavily in my company for everything from little on-demand bug fixes to entirely new features. Most times switching branches means closing all tabs and opening tabs relevant to the selected branch. It also often involves expanding a number of folders in the drawer but this happens less often as I am a keyboard freak and rarely use the drawer.
It would be awesome if switching branches could trigger TM to close the current tabs and open the ones being worked on the last time this branch was selected. Even better if cursors were moved to the right positions too.
Now, I realize this is too specific for TM to have natively but it would be nice nonetheless. I wonder if a plugin could do this? Maybe by using git branch identifiers as keys to layout specifications that can be saved elsewhere as plugin data.
Does this sound doable? Can anyone point me in the right direction to documentation that I can use to maybe give this a shot? I'm happy to work on a plugin if people are interested in something like this.
Cheers.
Luis
We use git for our repository, and I find that TextMate does a pretty good job of switching between branches as-is. Actually, git is doing all the work, and TextMate is simply responding to (mostly) the disappearance and modifications of files.
So, I know that you are asking for more below, but I thought it might be useful to identify what's already out there, at least for git.
On Mon, Jan 25, 2010 at 3:55 PM, Luis Gomez lgomez@gmail.com wrote:
I doubt this can be done with the current version of TextMate but I want to put it out there and see what people suggest.
When working on git repositories, I find myself jumping from branch to branch often. We use branches heavily in my company for everything from little on-demand bug fixes to entirely new features. Most times switching branches means closing all tabs and opening tabs relevant to the selected branch. It also often involves expanding a number of folders in the drawer but this happens less often as I am a keyboard freak and rarely use the drawer.
It would be awesome if switching branches could trigger TM to close the current tabs and open the ones being worked on the last time this branch was selected. Even better if cursors were moved to the right positions too.
Now, I realize this is too specific for TM to have natively but it would be nice nonetheless. I wonder if a plugin could do this? Maybe by using git branch identifiers as keys to layout specifications that can be saved elsewhere as plugin data.
Does this sound doable? Can anyone point me in the right direction to documentation that I can use to maybe give this a shot? I'm happy to work on a plugin if people are interested in something like this.
Cheers.
Luis
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
hi
I just did a test, and you can version the .tmproj file itself. i did a test, and it seems to store tab state. you have to close the project and reopen it after switching branches though. if you could script that action to reopen the project after, you should have all your tabs restored.
m.
On Jan 26, 2010, at 7:24 PM, Mitchell Amihod wrote:
I just did a test, and you can version the .tmproj file itself. i did a test, and it seems to store tab state. you have to close the project and reopen it after switching branches though. if you could script that action to reopen the project after, you should have all your tabs restored.
Yeah, but I think a lot of the stuff he’s after is stored as extended attributes. Even if Git could track those, I don’t think I would want it to. Imagine dozens of commit messages that simply said “I moved the cursor”.
On 26 Jan 2010, at 00:55, Luis Gomez wrote:
[...] Now, I realize this is too specific for TM to have natively but it would be nice nonetheless. I wonder if a plugin could do this? Maybe by using git branch identifiers as keys to layout specifications that can be saved elsewhere as plugin data.
I think this would be too complex to do with a plug-in (even with the use of class dump).
We are however moving to more open “session info” (with stashability), problem is that document specific data (such as caret position, bookmarks, etc.) is stored with the file (using extended attributes), something git strips when you switch branches.
I’ll keep your use-case in mind.