One of the things that still puzzles me about how people use TextMate is how they navigate the source code.
I can navigate quite fast on both Emacs and Vim using etags (or ctags). You just basically put the cursor over a function call, and press M-. (or Ctrl-]) and that takes you to the definition of the function. To go back to where you were, you just press M-* (or Ctrl- g) and you're back.
I know about the Ctrl-] command in textmate that brings up an HTML list of things to click at, but that is really slow. Besides, I don't know how to go back to were I was. I also know about 'Find in Project' but that is _extremely_ slow (although it seems that if you do a Project Folder it's faster?). At any rate, it still doesn't solve the navigation issue.
What I've found is that whenever I'm writing new code, and I know what I'm writing, I can use TextMate and I'm faster on it (due to snippets, context-sensitive commands, etc, etc). But when I'm _reading_ code and trying to understand functions, I'm much, much faster in Emacs or Vim.
Maybe I don't know about some better way of finding stuff?
How are people in the list navigating codebases?
Thanks,
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On May 10, 2006, at 4:24 PM, Oscar Bonilla wrote:
I know about the Ctrl-] command in textmate that brings up an HTML list of things to click at, but that is really slow. Besides, I don't know how to go back to were I was. I also know about 'Find in Project' but that is _extremely_ slow (although it seems that if you do a Project Folder it's faster?). At any rate, it still doesn't solve the navigation issue.
There's also TmCodeBrowser. Not as elegant as the Vim/Emacs solution AFAICT, but it's something else to try.
Trevor
Hi Oscar,
On May 10, 2006, at 7:24 PM, Oscar Bonilla wrote:
I know about the Ctrl-] command in textmate that brings up an HTML list of things to click at, but that is really slow.
I think most of the slowness comes from popping up the dialog. Try selecting the word you want to lookup, and then hitting ctrl-]. Is that faster? I could add a an option that selects whether or not CocoaDialog should be used.
Besides, I don't know how to go back to were I was.
A tag stack is something I've wanted to add for a while. I'll try to look into it soon... _matt
When I bought TextMate, the hardest part to live without was the awsome auto-completion that Zend Studio offered me.
It was nice to see an automatic tooltip with the function prototype as I was typing...
Eric Coleman
On May 10, 2006, at 10:17 PM, Matthew Gilbert wrote:
Hi Oscar,
On May 10, 2006, at 7:24 PM, Oscar Bonilla wrote:
I know about the Ctrl-] command in textmate that brings up an HTML list of things to click at, but that is really slow.
I think most of the slowness comes from popping up the dialog. Try selecting the word you want to lookup, and then hitting ctrl-]. Is that faster? I could add a an option that selects whether or not CocoaDialog should be used.
Besides, I don't know how to go back to were I was.
A tag stack is something I've wanted to add for a while. I'll try to look into it soon... _matt
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On May 10, 2006, at 7:17 PM, Matthew Gilbert wrote:
Hi Oscar,
On May 10, 2006, at 7:24 PM, Oscar Bonilla wrote:
I know about the Ctrl-] command in textmate that brings up an HTML list of things to click at, but that is really slow.
I think most of the slowness comes from popping up the dialog. Try selecting the word you want to lookup, and then hitting ctrl-]. Is that faster? I could add a an option that selects whether or not CocoaDialog should be used.
Well, I've just tried it and now it seems to be having problems:
Traceback (most recent call last): File "/Library/Application Support/ TextMate/Bundles/Source.tmbundle/Support/bin/lookup_tag.py", line 11, in ? import pytags.exchtml as exchtml File "/Library/Application Support/TextMate/Bundles/Source.tmbundle/Support/bin/pytags.zip/ pytags/exchtml.py", line 5, in ? File "/Library/Application Support/ TextMate/Bundles/Source.tmbundle/Support/bin/pytags.zip/pytags/ exctags.py", line 9, in ? ImportError: Inappropriate file type for dynamic loading
Any ideas what that means?
Besides, I don't know how to go back to were I was.
A tag stack is something I've wanted to add for a while. I'll try to look into it soon... _matt
That would be awesome...
Thanks,
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On May 11, 2006, at 2:41 PM, Oscar Bonilla wrote:
On May 10, 2006, at 7:17 PM, Matthew Gilbert wrote:
Hi Oscar,
On May 10, 2006, at 7:24 PM, Oscar Bonilla wrote:
I know about the Ctrl-] command in textmate that brings up an HTML list of things to click at, but that is really slow.
I think most of the slowness comes from popping up the dialog. Try selecting the word you want to lookup, and then hitting ctrl-]. Is that faster? I could add a an option that selects whether or not CocoaDialog should be used.
Well, I've just tried it and now it seems to be having problems:
Traceback (most recent call last): File "/Library/Application Support/TextMate/Bundles/Source.tmbundle/Support/bin/ lookup_tag.py", line 11, in ? import pytags.exchtml as exchtml File "/Library/Application Support/TextMate/Bundles/Source.tmbundle/ Support/bin/pytags.zip/pytags/exchtml.py", line 5, in ? File "/ Library/Application Support/TextMate/Bundles/Source.tmbundle/ Support/bin/pytags.zip/pytags/exctags.py", line 9, in ? ImportError: Inappropriate file type for dynamic loading
Any ideas what that means?
Are you on an Intel Mac? When was the last time you checked-out the bundle repo? The latest binary I checked-in is a Universal binary as far as I can tell. But I don't have an Intel Mac to test, so maybe I did something wrong. I checked it in March 29th. _matt
On May 11, 2006, at 2:49 PM, Matthew Gilbert wrote:
Are you on an Intel Mac? When was the last time you checked-out the bundle repo? The latest binary I checked-in is a Universal binary as far as I can tell. But I don't have an Intel Mac to test, so maybe I did something wrong. I checked it in March 29th. _matt
No, I'm on a PowerBook G4. I checked out the latest version from subversion right now and it's still failing for me with the same error.
Traceback (most recent call last): File "/Library/Application Support/ TextMate/Bundles/Source.tmbundle/Support/bin/lookup_tag.py", line 11, in ? import pytags.exchtml as exchtml File "/Library/Application Support/TextMate/Bundles/Source.tmbundle/Support/bin/pytags.zip/ pytags/exchtml.py", line 5, in ? File "/Library/Application Support/ TextMate/Bundles/Source.tmbundle/Support/bin/pytags.zip/pytags/ exctags.py", line 9, in ? ImportError: Inappropriate file type for dynamic loading
Anything else I can do to debug this?
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
Hi,
I would like to suggest the following enhancement to the Javascript syntax:
{ name = 'meta.function.js'; comment = 'match stuff like: foobar: function() { … }'; match = '^\s*\b([a-zA-Z_?.$]+\w*):\s+\b(function)?\s*((.*?))'; captures = { 1 = { name = 'entity.name.function.js'; }; 2 = { name = 'storage.type.function.js'; }; 3 = { name = 'variable.parameter.function.js'; }; }; },
Since the common style in a lot of Javascript libraries (like Prototype/scriptaculous) is to define functions like this:
var Enumerable = { each: function(iterator) { // body },
all: function(iterator) { // body } }
The above rule correctly highlights these definitions and also includes their names in the function popup.
Regards,
Aparajita www.aparajitaworld.com
"If you dare to fail, you are bound to succeed." - Sri Chinmoy | www.srichinmoylibrary.com
Justin Palmer's Vibrant Ink bundle [1] includes a small syntax addon for this sort of construct. With his blessing, I've made tentative plans to move some of this into the main JavaScript bundle. Someday. Meanwhile, you can use his.
[1] http://encytemedia.com/blog/articles/2006/01/03/textmate-vibrant- ink-theme-and-prototype-bundle
Cheers, Andrew Dupont http://andrewdupont.net
On May 12, 2006, at 11:39 AM, Aparajita Fishman wrote:
Hi,
I would like to suggest the following enhancement to the Javascript syntax:
{ name = 'meta.function.js'; comment = 'match stuff like: foobar: function() { … }'; match = '^\s*\b([a-zA-Z_?.$]+\w*):\s+\b(function)?\s*((.*?))'; captures = { 1 = { name = 'entity.name.function.js'; }; 2 = { name = 'storage.type.function.js'; }; 3 = { name = 'variable.parameter.function.js'; }; }; },
Since the common style in a lot of Javascript libraries (like Prototype/scriptaculous) is to define functions like this:
var Enumerable = { each: function(iterator) { // body },
all: function(iterator) { // body } }
The above rule correctly highlights these definitions and also includes their names in the function popup.
Regards,
Aparajita www.aparajitaworld.com
"If you dare to fail, you are bound to succeed."
- Sri Chinmoy | www.srichinmoylibrary.com
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
I have 1 up on that!
Check out my collection of crazy JavaScript wrappers. Including modified versions of Justin Palmer's stuff. http://textmate.svn.subtlegradient.com/Bundles/Javascript% 20Extras.tmbundle/
I made a pretty slick pref for the function popup/window.
For best effect use one of my Brilliance themes to have proper fancy hilighting and whatnot. http://textmate.svn.subtlegradient.com/Themes/
Checkout what the prototype.js file looks like in my Javascript + Prototype Bracketed language syntax.
I also have code completion for a lot of prototype stuff (just the esc to rotate through, not a slick dropdown or anything). Planning on adding more, whenever i have to work in Js for a while i guess i'll do it.
On May 12, 2006, at 2:22 PM, Andrew Dupont wrote:
Justin Palmer's Vibrant Ink bundle [1] includes a small syntax addon for this sort of construct. With his blessing, I've made tentative plans to move some of this into the main JavaScript bundle. Someday. Meanwhile, you can use his.
[1] http://encytemedia.com/blog/articles/2006/01/03/textmate- vibrant-ink-theme-and-prototype-bundle
Cheers, Andrew Dupont http://andrewdupont.net
On May 12, 2006, at 11:39 AM, Aparajita Fishman wrote:
Hi,
I would like to suggest the following enhancement to the Javascript syntax:
{ name = 'meta.function.js'; comment = 'match stuff like: foobar: function() { … }'; match = '^\s*\b([a-zA-Z_?.$]+\w*):\s+\b(function)?\s*((.*?))'; captures = { 1 = { name = 'entity.name.function.js'; }; 2 = { name = 'storage.type.function.js'; }; 3 = { name = 'variable.parameter.function.js'; }; }; },
Since the common style in a lot of Javascript libraries (like Prototype/scriptaculous) is to define functions like this:
var Enumerable = { each: function(iterator) { // body },
all: function(iterator) { // body } }
The above rule correctly highlights these definitions and also includes their names in the function popup.
Regards, Aparajita
thomas Aylott—subtleGradient—oblivious@subtleGradient.com
On May 12, 2006, at 12:11 PM, Oscar Bonilla wrote:
On May 11, 2006, at 2:49 PM, Matthew Gilbert wrote:
Are you on an Intel Mac? When was the last time you checked-out the bundle repo? The latest binary I checked-in is a Universal binary as far as I can tell. But I don't have an Intel Mac to test, so maybe I did something wrong. I checked it in March 29th. _matt
No, I'm on a PowerBook G4. I checked out the latest version from subversion right now and it's still failing for me with the same error.
Hrm... running Tiger?
On May 13, 2006, at 8:54 AM, Matthew Gilbert wrote:
On May 12, 2006, at 12:11 PM, Oscar Bonilla wrote:
On May 11, 2006, at 2:49 PM, Matthew Gilbert wrote:
Are you on an Intel Mac? When was the last time you checked-out the bundle repo? The latest binary I checked-in is a Universal binary as far as I can tell. But I don't have an Intel Mac to test, so maybe I did something wrong. I checked it in March 29th. _matt
No, I'm on a PowerBook G4. I checked out the latest version from subversion right now and it's still failing for me with the same error.
Hrm... running Tiger?
yup,
dirac unix $ sw_vers ProductName: Mac OS X ProductVersion: 10.4.6 BuildVersion: 8I127
Is there a known problem with Tiger?
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On May 15, 2006, at 1:57 PM, Oscar Bonilla wrote:
On May 13, 2006, at 8:54 AM, Matthew Gilbert wrote:
On May 12, 2006, at 12:11 PM, Oscar Bonilla wrote:
On May 11, 2006, at 2:49 PM, Matthew Gilbert wrote:
Are you on an Intel Mac? When was the last time you checked-out the bundle repo? The latest binary I checked-in is a Universal binary as far as I can tell. But I don't have an Intel Mac to test, so maybe I did something wrong. I checked it in March 29th. _matt
No, I'm on a PowerBook G4. I checked out the latest version from subversion right now and it's still failing for me with the same error.
Hrm... running Tiger?
yup,
dirac unix $ sw_vers ProductName: Mac OS X ProductVersion: 10.4.6 BuildVersion: 8I127
Is there a known problem with Tiger?
Nope, there is a known issue with Panther though. Boy, I've not a clue. Can you post the md5 of /Library/Application\ Support/TextMate/Bundles/Source.tmbundle/ Support/bin/pytaglib.so. Mine is 2e938aa900ab7a3ae7d544df2a3aa936. Maybe try importing it manually.
cd /Library/Application\ Support/TextMate/Bundles/Source.tmbundle/ Support/bin python
import pytaglib
Sorry, not sure what else to try. It works fine for me, I have reported success from others as well. _matt
On May 16, 2006, at 3:49 PM, Matthew Gilbert wrote:
Nope, there is a known issue with Panther though. Boy, I've not a clue. Can you post the md5 of /Library/Application\ Support/TextMate/Bundles/Source.tmbundle/ Support/bin/pytaglib.so. Mine is 2e938aa900ab7a3ae7d544df2a3aa936. Maybe try importing it manually.
cd /Library/Application\ Support/TextMate/Bundles/Source.tmbundle/ Support/bin python
import pytaglib
Sorry, not sure what else to try. It works fine for me, I have reported success from others as well. _matt
Ah, I found it.
$ which python /sw/bin/python
That's from fink. I just did
$ sudo chmod 0 /sw/bin/python* $ which python /usr/bin/python
and it worked.
Yeah, it's better. But it's still not as easy as with Emacs. Any reason you're not just jumping to the file? Ah, there might be multiple matches for the function.
A sleazy way of doing it would be to keep a stack in a temporary file somewhere in the user's home directory and provide shortcuts for the next tag, previous position, etc.
I've not seen at the source of your Bundle (and I don't speak Python, so it might take me some time to catch up), but what I'm talking about would be along the lines of:
- User hits Ctrl-] find matches in ctag file Pop TM_CURRENT_WORD, TM_CURRENT_FILE, TM_CURRENT_LINE from file if popped something, skip to ctag after the one we popped else jump to matching tag - User hits Ctrl-[ Pop TM_CURRENT_WORD, TM_CURRENT_FILE, TM_CURRENT_LINE from file Jump to it Do you see where I'm going? Do you think that would work?
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On May 16, 2006, at 7:10 PM, Oscar Bonilla wrote:
On May 16, 2006, at 3:49 PM, Matthew Gilbert wrote:
Nope, there is a known issue with Panther though. Boy, I've not a clue. Can you post the md5 of /Library/Application\ Support/TextMate/Bundles/Source.tmbundle/ Support/bin/pytaglib.so. Mine is 2e938aa900ab7a3ae7d544df2a3aa936. Maybe try importing it manually.
cd /Library/Application\ Support/TextMate/Bundles/Source.tmbundle/ Support/bin python
import pytaglib
Sorry, not sure what else to try. It works fine for me, I have reported success from others as well. _matt
Ah, I found it.
$ which python /sw/bin/python
That's from fink. I just did
$ sudo chmod 0 /sw/bin/python* $ which python /usr/bin/python
and it worked.
What version is in fink? I imagine it's more recent than 2.3? Not sure why it wouldn't work. Thanks for tracking that down though.
A sleazy way of doing it would be to keep a stack in a temporary file somewhere in the user's home directory and provide shortcuts for the next tag, previous position, etc.
I've not seen at the source of your Bundle (and I don't speak Python, so it might take me some time to catch up), but what I'm talking about would be along the lines of:
- User hits Ctrl-] find matches in ctag file Pop TM_CURRENT_WORD, TM_CURRENT_FILE, TM_CURRENT_LINE from file if popped something, skip to ctag after the one we popped else jump to matching tag
- User hits Ctrl-[ Pop TM_CURRENT_WORD, TM_CURRENT_FILE, TM_CURRENT_LINE from file Jump to it
Do you see where I'm going? Do you think that would work?
Thanks for the suggestion. Yeah, I've been thinking about how to keep state. A temp file is probably the best bet, and I think other bundles do something similar (like the hotkey bundle). It's on my todo list, I just don't have much time lately to get to it. _matt
On May 10, 2006, at 6:24 PM, Oscar Bonilla wrote:
One of the things that still puzzles me about how people use TextMate is how they navigate the source code.
I can navigate quite fast on both Emacs and Vim using etags (or ctags). You just basically put the cursor over a function call, and press M-. (or Ctrl-]) and that takes you to the definition of the function. To go back to where you were, you just press M-* (or Ctrl- g) and you're back.
A while ago I wrote a little script that creates a tags file and looks up functions etc. It isn't very pretty but functional and relatively quick. I wrote up a quick description here:
Let me know if that is of any use. BTW I tried to record a macro that would combine setting a bookmark and then calling the ctags lookup, but apparently it is not possible to set bookmarks from a macro.
Gerd