I attended a friend's masters thesis defense (congrats, Ducky!) and it made me think about bookmarks in editors. For TextMate, it has a simple bookmark feature: press Cmd-F2 to leave one, and then cycle forwards or backwards through them. Vim, on the other hand, has bookmarks labeled by letter, which can be per-file or global.
With TextMate's solution it is quick to set a mark and requires no thinking. The problem, though, is you have to cycle through the bookmarks blindly until you find the one you want. That can be annoying if you are leaving marks behind when you are jumping around following control flow through various methods and classes.
Vim has the opposite problem. You have to assign a bookmark that has not been used previously, but it does allow you to jump directly to marks. If you run the ``:marks`` command you get a list of every mark currently set, complete with line/column/text info. So if you know you set a mark but not sure which one exactly, you can try to do it based on what text is on that line. You can also jump directly back to another file if you set a global mark there, allowing you to track your movement between files. So you trade off the ease-of-use of just leaving any random mark for the ability to be specific and get a list of all known marks.
A place for me to babble on about Python development, Python itself, and coding in general. The title is inspired by some knights who enjoy a good shrubbery.
Showing posts with label textmate. Show all posts
Showing posts with label textmate. Show all posts
2008-07-17
2008-01-30
The Python-Dev bundle for TextMate has started (on my laptop)
I have been relaxing as of late by messing about with TextMate. Beyond writing up a personal FAQ on TextMate (which will go up on my vaporware personal web site that I will start working on once importlib and the stdlib reorg are done), I have started a Python-Dev bundle.
So far I have only done commands I know I have use for. Relying on the assumption that if you are hacking on a checkout of Python you are using a project for the checkout, I have a command to build Python. It doesn't do any more right now than to execute ``make -s`` and pipe the output to an HTML window, but that is enough to handle the compile part of the code-compile-debug cycle of C. It would be great if I could go as far as hyperlink gcc's output so that I could just click on any build errors or warnings from a build to easily fix them. Anyone know if a pre-existing bundle that has this kind of support? Would be really cool to have the raw output put into the HTML window and when the output is done hide it from view while still being able to get to it later. Any warnings or errors could then be listed and thus be obvious that something occurred. It might be as simple as checking for lines that contain a file path (which would be as simple as splitting on words, checking for a leading /, and then verifying the path exists).
I also have a command to build the docs. Once again it does nothing more than run ``make html`` and pipe the output to an HTML window. It is completely Leopard-only as I didn't worry about people specifying an interpreter that is Python 2.5 or higher. I really doubt that much more is needed for this command.
The rest of the commands I have done are about opening things in the web browser. The easiest one was having a command to open issues. Opening PEPs was a little trickier as the number needs to be padded to 4 digits. Luckily bash's printf command has a padding option. Even better, for %d, if the argument is not a number it is considered 0, which leads to the PEP index. =) Dumb luck is on my side for that one.
The last one I am the most proud of, though. When I am hacking on a checkout I am constantly checking the in-development docs for stuff. I do this often enough that I try to keep them built on my local machine (all thanks to Georg and doctools). So I have a command that looks for the HTML index file for the docs if you are in a project. This has the perk of supporting Py3K if you are working on such a checkout and thus making the command not 2.x-specific. If the index file doesn't exist in the project it checks for an environment variable so that if you are just hacking on a single file you don't have to launch a project to view the docs. And if those two options don't work, it goes to the online in-development docs.
I plan to add this to Python's trunk at some point. I am not rushing to do this as I really don't know if anyone is going to use this other than me. =) I am also trying to prevent myself from going overboard on all of this until I actually get back around to doing some Python work (I am currently working on my PyCon slides first). That way I only add things that I will actually use and just toss in features that are not worth the effort in supporting.
So far I have only done commands I know I have use for. Relying on the assumption that if you are hacking on a checkout of Python you are using a project for the checkout, I have a command to build Python. It doesn't do any more right now than to execute ``make -s`` and pipe the output to an HTML window, but that is enough to handle the compile part of the code-compile-debug cycle of C. It would be great if I could go as far as hyperlink gcc's output so that I could just click on any build errors or warnings from a build to easily fix them. Anyone know if a pre-existing bundle that has this kind of support? Would be really cool to have the raw output put into the HTML window and when the output is done hide it from view while still being able to get to it later. Any warnings or errors could then be listed and thus be obvious that something occurred. It might be as simple as checking for lines that contain a file path (which would be as simple as splitting on words, checking for a leading /, and then verifying the path exists).
I also have a command to build the docs. Once again it does nothing more than run ``make html`` and pipe the output to an HTML window. It is completely Leopard-only as I didn't worry about people specifying an interpreter that is Python 2.5 or higher. I really doubt that much more is needed for this command.
The rest of the commands I have done are about opening things in the web browser. The easiest one was having a command to open issues. Opening PEPs was a little trickier as the number needs to be padded to 4 digits. Luckily bash's printf command has a padding option. Even better, for %d, if the argument is not a number it is considered 0, which leads to the PEP index. =) Dumb luck is on my side for that one.
The last one I am the most proud of, though. When I am hacking on a checkout I am constantly checking the in-development docs for stuff. I do this often enough that I try to keep them built on my local machine (all thanks to Georg and doctools). So I have a command that looks for the HTML index file for the docs if you are in a project. This has the perk of supporting Py3K if you are working on such a checkout and thus making the command not 2.x-specific. If the index file doesn't exist in the project it checks for an environment variable so that if you are just hacking on a single file you don't have to launch a project to view the docs. And if those two options don't work, it goes to the online in-development docs.
I plan to add this to Python's trunk at some point. I am not rushing to do this as I really don't know if anyone is going to use this other than me. =) I am also trying to prevent myself from going overboard on all of this until I actually get back around to doing some Python work (I am currently working on my PyCon slides first). That way I only add things that I will actually use and just toss in features that are not worth the effort in supporting.
2008-01-28
So I got TextMate
I decided to use TextMate to do code reviews for Python's GHOP participation. It actually worked out pretty well. I have blogged before about my previous experience with TextMate over a year ago. I ended up liking it enough to buy and give it an honest go.
I have already started a Python-Dev bundle for myself that will most likely end up in Python's svn repository. It will most likely contain stuff that is directly part of the coding process so that one's workflow is not broken. But I don't plan to make it do everything that one does for core development. For instance I will most likely end up with a command that re-generates the docs, but not one to checkout/update the doc tools. And I plan to have it work based on projects that are rooted at a trunk or branch checkout.
And changes to the Python bundle will be needed as well. For instance, the function snippet does not handle multi-line docstrings well at all.
But for all of its standing flaws, none of them are insurmountable and the editor itself overall is still good. Hopefully my purchase won't be for naught. =)
And obviously if people have suggestions on how best to use TextMate I am always open to learn more.
I have already started a Python-Dev bundle for myself that will most likely end up in Python's svn repository. It will most likely contain stuff that is directly part of the coding process so that one's workflow is not broken. But I don't plan to make it do everything that one does for core development. For instance I will most likely end up with a command that re-generates the docs, but not one to checkout/update the doc tools. And I plan to have it work based on projects that are rooted at a trunk or branch checkout.
And changes to the Python bundle will be needed as well. For instance, the function snippet does not handle multi-line docstrings well at all.
But for all of its standing flaws, none of them are insurmountable and the editor itself overall is still good. Hopefully my purchase won't be for naught. =)
And obviously if people have suggestions on how best to use TextMate I am always open to learn more.
Subscribe to:
Posts (Atom)