I just created this little textmate command that acts like a snippet and inserts an End of file command a la CodeIgniter. Example:
/* End of file eof.tmsnippet.php */
/* Location: ./Sandbox/php/Textmate_Commands/eof.tmsnippet.php */
If you want to start using it right away, I uploaded the .tmCommand
file in CloudApp. I also created a gist with the code of the command so that you can easily modify it if you want to. The links is at the bottom of the post.
Alternatively, you can create the command manually. Here are its attributes:
- Save: Nothing
- Command(s): (The code above)
- Input: None
- Output: Insert as Snippet
- Activation: Tab Trigger (Default: eof)
- Scope Selector: source.php
The command also recognizes three Textmate Shell Variables:
$TM_DIRECTORY_SEPERATOR
: The default value is/
$TM_SERVER_ROOT
: This should be the same value as$_SERVER['DOCUMENT_ROOT']
. If this is not set, the command will display the full path to the file.$TM_PROJECT_ROOT
: This command is the same as$TM_SERVER_ROOT
except that it should be set as project-specific, which you can only do if you have the ProjectPlus plugin installed. (hint: click on the littleI
icon in the bottom right corner of the project drawer)
The command creates one tab stop by directory and each tab stop adds one directory to the selection; I you don't know what I mean, try to use the command and you'll understand.
Enjoy!