[TxMt] Insert File/Path names + open a file without using a GUI

Hans-Jörg Bibiko bibiko at eva.mpg.de
Sun Mar 11 22:27:21 UTC 2007


One moment please.
Charley: back to my example

Project Example:

root (path='/usr/local/src/web')
|
|-css
| |- a.css
| |- b.css
|-images
| |- 1.jpg
| |- 2.jpg
|-main
| |-includes
| | |-j.js
| |-htmls
|   |-a.html

My current document is 'a.html'. I type:

'=/c' ; press CTRL+TAB ; the command will insert:  '/usr/local/src/ 
web/css'

You said '=/c' should only insert '/css'.

One humble question: What would be written in 'a.html' before '=/c'?
Could it be that this line in a.html contains a TM_* variable?
Otherwise it wouldn't make a sense to me (?)
If so, I implemented this for TM_SUPPORT_PATH and TM_BUNDLE_SUPPORT.  
If one of these variables is before my caret and I invoke the  
completion the command shows its content (see my screencast). To  
expand that mechanism to other variables would be easy.


On 11.03.2007, at 20:03, Charilaos Skiadas wrote:

>> Suggestion:
>> Supposing I use the character '='. '=' will be replaced by  
>> TM_PROJECT_DIRECTORY if it is defined.
>
> Why not simply have the command also expand environment variable  
> names, e.g. if I type:
>
> $TM_P
>
> and then ctrl+tab I would get
>
> $TM_PROJECT_DIRECTORY

Well, this is a good idea. I never thought that way. But, why not?  
The only tricky thing could be that TM_* variables are used in  
different programming languages, and one has to parse it correctly.

>
> Btw, ctrl+tab is the key combo that takes you to the drawer and  
> back, so it is a bit of an unfortunate choice.
>

ARRRGH. You're right! The key binding must be changed, of course.

Hans



More information about the textmate mailing list