These can refer to local files which can be useful when: The txmt URL scheme allows you to open files in TextMate via hyperlinks found for example in HTML documents (anchors). To setup TextMate to be used with less, you need to setup the LESSEDIT variable: export LESSEDIT='mate -l %lm %f' The less pager supports editing the file being viewed by pressing v. To setup TextMate to be used in this case, setup the TEXEDIT variable like this: export TEXEDIT='mate -w -l %d "%s"' When TeX gives an error message relating to a file, you can enter e to edit the file (and correct the error). To set it like this for Git, you can set the GIT_EDITOR variable or Git’s core.editor configuration variable. This instructs TextMate to open with the caret at line 1 rather than where it last was. To avoid this problem you can set the Git editor to mate -wl1. This is because Git reuses the temporary file used for the commit message and TextMate stores per-file caret position (via extended attributes). When you commit to a Git repository you may find that your caret is not at the first line. For example: ln -s mate ~/bin/mate_wait # run this once to create the linkĮxport EDITOR='mate_wait' # use in your ~/.bash_profile If you need to use it, you can create a symbolic link to mate with a _wait suffix which implies -w. There is one command which does not support giving arguments in the EDITOR variable, it is crontab (which is sort of obsoleted by launchd). We add the -w argument to make the command wait for TextMate to close the file, before continuing. in ~/.bash_profile or ~/.zshrc): export EDITOR='mate -w' To use TextMate as the editor for the EDITOR variable, set it like this (for bash and zsh users e.g. The EDITOR variable is used by many shell commands, like svn (subversion) and CVS. This assumes that you have ~/bin created and in your path and that TextMate is installed in /Applications.Īfter having created this link, you may want to setup a few shell variables to make other applications use TextMate as an external editor. The mate command is located inside the TextMate application bundle and it is recommended that you create a symbolic link which points to the command (rather than “install” it), so that if the command is updated in the future, you will not need to reinstall the updated command.Ĭreating a symbolic link can either be done by selecting Help → Terminal Usage… from the menu, or from the shell by running something like the following: ln -s /Applications/TextMate.app/Contents/Resources/mate ~/bin/mate For usage instructions you can run mate -h (from Terminal). when using an editor to write something like a subversion commit message.įor this reason TextMate comes with its own mate shell command, which supersedes the open command. This standard command has a few shortcomings: it can only open one file at a time, it cannot open a document at a specific line and it cannot “stall” the shell until the file has been closed, which is useful e.g. will open the current folder in TextMate (as a scratch project). It can also perform an Open With… operation by use of the -a argument, e.g.: open -a TextMate. Mac OS X comes with an open shell command which can be used to simulate a double click from within Terminal. Calling TextMate from Other Applications Shell / Terminal
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |