![]() That would drop my caret (shown as ‸) at the beginning of the third line: ‸pos = «line» (':' «column»)? If I save the above grammar to a selection_string_syntax.txt file, I can open it with the following command: mate -l 3 selection_string_syntax.txt OK, geeky, but what does it really mean? Let’s look at some examples. Range = «pos» | «normal_range» | «column_range» Here’s the formal grammar for a Selection String: selection = «range» ('&' «range»)* These are a new tool in TextMate 2 for describing selections. In the new version, it now takes a Selection String. It just took a number and it took you to that line. With the old version of mate, -l was super simple. That’s true, but -l is far more powerful in TextMate 2 and that new power has spread to other commands. I mentioned before that TextMate 1’s version of mate supported -l. This use of -name clears that up by telling me exactly what I’m looking at. git/COMMIT_EDITMSG, our window isn’t going to have the best title by default. That leads us, finally, to the new option used above. That’s not too helpful for a quick edit, so -l 1 forces the caret back to the beginning. Since that last location was probably at the end of a message that’s changed or no longer present, the caret would likely be left in the middle of Git’s comments. I force the first line here because Git has a habit of reusing commit message files and TextMate would otherwise try restore the caret to it’s last location. l just tells TextMate to place the caret on the indicated line. That’s what allows you to use the command as an external editor for tools like Git that are waiting for an answer. w just tells TextMate to wait for the edit to finish. ![]() The -w and -l options have been around for a while. For a good use of that, let me share a line from my Bash configuration: export GIT_EDITOR="mate -name 'Git Commit Message' -w -l 1" This allows you to set TM_DISPLAYNAME which is typically shown in the title bar on TextMate’s windows. Since the name of standard files like this don’t always include an extension, we can just tell TextMate 2 how to handle the file as we open it: mate -t READMEĪnother new option is -name. Personally, I like this feature for README files, which I prefer to write in Markdown. One is -t, which allows you to set the type of an opened file. Next, mate has picked up some new command-line options. You can use this to edit restricted access files in TextMate 2 without being bothered by an authorization dialog on save: sudo mate /etc/hosts What’s upgraded in mate?įirst, it’s a small tweak, but you will be happy to hear that mate now works with sudo. If you would like to find where your TextMate 1 version is before you upgrade, feed your Terminal this command: which mate. Users usually install mate into ~/bin if they just need it for the current user and /usr/local/bin if they would rather make it accessible to all users (assuming they have /usr/local/bin in their PATH). This pane can later be used to uninstall the command if you need to do that. You may be prompted to Replace an old version, if present. To install or upgrade mate, just select a Location and hit Install. You can now find it in the TextMate menu under Preferences… in the Terminal pane. The installer of this command-line utility has moved in TextMate 2. This allows you to take advantage of its new features. Once you have TextMate 2, you need to make sure you refresh the command-line mate application. A new partner-in-crime has also been introduced: rmate. ![]() In TextMate 2, mate has learned some new tricks. TextMate has always bridged the gap between these environments with its trusty command-line sidekick: mate. However, developers are often forced to walk in two worlds using both GUI and command-line tools. TextMate is and will always be a modern GUI application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |