TextMate命令段-在窗口标题中显示文档路径
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TextMate命令段-在窗口标题中显示文档路径相关的知识,希望对你有一定的参考价值。
##Instructions1. Create a new Command: Bundles > Bundle Editor > Edit Commands
2. Click the "+" button to add a new command
3. Give your command a descriptive name ("TM Path in title", for example)
4. Set the following properties on the command: {save:Nothing, Input:None, Output:Show as Tool Tip, Activation:⌥⌘T, Scope Selector: NULL}
5. Close the command window
6. Test out a document inside a project. The title should be replaced with an absolute path based on the root directory of your project.
> Feedback and improvements are absolutely welcome. I'm looking to find a way to automatically fire this when a document is opened. Anybody know if this is possible?
#!/bin/bash A=${TM_PROJECT_DIRECTORY:-""} B=${A##*/} C=${TM_FILEPATH:-""} D=${C/$A//$B} [[ ! -z $C ]] && { osascript -e "tell application "TextMate" to set name of window 1 to "$D""; } :
以上是关于TextMate命令段-在窗口标题中显示文档路径的主要内容,如果未能解决你的问题,请参考以下文章
(Java) 在 macbook 中使用 Textmate 时,如何在 File 类中创建完整路径?
使用TextMate&ŧ039;s tmŧdialog命令显示警报框