Hi,
I rewrote my Command 'Insert File/Path Name + AutoCorrect'. Key: CTRL+TAB Scope: none
BTW I use this Command very often to open a file without a mouse or GUI. Just type: 'mate ' and invoke this Command, and finally press CTRL+R.
To illustrate that Command I did a screencast (without sound because my mic is out of order, but there are written comments)
http://www.bibiko.de/TM_InsertFilePathNames.mov (ca. 5.7MB)
Comments are welcome!
Best, Hans
Some features: - simulates the TAB behaviour on a console with pull down menu, auto correction by looking backwards for a vaild begin of a path/ file name, and supports relative path names using TM_DIRECTORY - it tries to complete that file name according to the file name before the caret's position (i.e.: It is possible to use this command not only at the end of the line but also at the end of a given path within the line and even inside a given path to change it.)
- to auto-complete files beginning with a dot type: e.g.: '~/.p' to look for dot files beginning with p '~/.+' to list all dot files in the home directory
- if TM_BUNDLE_SUPPORT, TM_SUPPORT_PATH, etc. occures in a line it will use this directory as start point
Hints: The path ./ will be substitue with $TM_DIRECTORY! ../ is also supported for relative paths using $TM_DIRECTORY as root! You can use wildcards. e.g. ~/Pictures/.*jpg (for all jpg files) [case sensitive!] Symlinks are supported but not for changing a given path name. You can use TAB to jump to the end of the line, or if there is a space in front of the inserted path name you can jump to that space to delete or to insert a /. (Because this command inserts the text as snippet)
Hans-Jörg Bibiko wrote:
Hi,
I rewrote my Command 'Insert File/Path Name + AutoCorrect'. Key: CTRL+TAB Scope: none
BTW I use this Command very often to open a file without a mouse or GUI. Just type: 'mate ' and invoke this Command, and finally press CTRL+R.
To illustrate that Command I did a screencast (without sound because my mic is out of order, but there are written comments)
http://www.bibiko.de/TM_InsertFilePathNames.mov (ca. 5.7MB)
Comments are welcome!
Best, Hans
Excellent, I just tried it out on my latest cutting Edge (beloved TM), it works pretty well.
A nice addition, to the standard TextMate commands.
One possible situation, where this is very handy, if you have very large projects, and somehow loose track, about what exactly is going on in the project Drawer with your Directory and Files.
Thanks, for putting this together.
regards, marios
On Mar 10, 2007, at 1:19 PM, Hans-Jörg Bibiko wrote:
Hi,
I rewrote my Command 'Insert File/Path Name + AutoCorrect'. Key: CTRL+TAB Scope: none
BTW I use this Command very often to open a file without a mouse or GUI. Just type: 'mate ' and invoke this Command, and finally press CTRL+R.
To illustrate that Command I did a screencast (without sound because my mic is out of order, but there are written comments)
http://www.bibiko.de/TM_InsertFilePathNames.mov (ca. 5.7MB)
Comments are welcome!
Best, Hans
<FileName Completion.tmCommand>
Some features:
- simulates the TAB behaviour on a console with pull down menu, auto correction by looking backwards for a vaild begin of a path/
file name, and supports relative path names using TM_DIRECTORY
- it tries to complete that file name according to the file name
before the caret's position (i.e.: It is possible to use this command not only at the end of the line but also at the end of a given path within the line and even inside a given path to change it.)
to auto-complete files beginning with a dot type: e.g.: '~/.p' to look for dot files beginning with p '~/.+' to list all dot files in the home directory
if TM_BUNDLE_SUPPORT, TM_SUPPORT_PATH, etc. occures in a line it
will use this directory as start point
Hints: The path ./ will be substitue with $TM_DIRECTORY! ../ is also supported for relative paths using $TM_DIRECTORY as root! You can use wildcards. e.g. ~/Pictures/.*jpg (for all jpg files) [case sensitive!] Symlinks are supported but not for changing a given path name. You can use TAB to jump to the end of the line, or if there is a space in front of the inserted path name you can jump to that space to delete or to insert a /. (Because this command inserts the text as snippet)
It's been a while now and mine is totally out of date, but have you seen my Filename / Filepath Completion? http://subtlegradient.com/articles/2006/11/02/filename-filepath- completion-for-textmate-screencast
Might have saved you some time to just fix mine, oh well. I'll have to try yours out and see how it works. Maybe I won't have to upgrade mine afterall ;)
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
[...]
It's been a while now and mine is totally out of date, but have you seen my Filename / Filepath Completion? http://subtlegradient.com/articles/2006/11/02/filename-filepath- completion-for-textmate-screencast
Might have saved you some time to just fix mine, oh well. I'll have to try yours out and see how it works. Maybe I won't have to upgrade mine afterall ;)
thomas Aylott — subtleGradient — CrazyEgg — sixteenColors
Of course, I know your Filename Completion and I was inspired by it ;). I used it quite a while. But then it turned out that I prefer a slightly different behaviour.
for example:
- '/us' -> automatically to '/usr/' [if 'us' is unambiguous] - '/usr' -> I like to see the content of '/usr/' (instead of having a pull-down item '/') - I often write '/Apppli' ;) -> so I looked for a kind of 'auto- correction' - Many times I write within a bundle command in Ruby/Perl etc. 'TM_BUNDLE_SUPPORT' or whatever. After it I would like to insert a file name very easily. - I found it quite useful just to invoke the command to see the content of the current directory based on TM_DIRECTORY - and some other tiny stuff - one thing I didn't implement: With your code I can select a part of the path and replace it. By myself I never used it but if there is a need for it I could add it.
regards, hans
Hans-Jörg Bibiko wrote:
Hi,
I rewrote my Command 'Insert File/Path Name + AutoCorrect'. Key: CTRL+TAB Scope: none
BTW I use this Command very often to open a file without a mouse or GUI. Just type: 'mate ' and invoke this Command, and finally press CTRL+R.
To illustrate that Command I did a screencast (without sound because my mic is out of order, but there are written comments)
http://www.bibiko.de/TM_InsertFilePathNames.mov (ca. 5.7MB)
Comments are welcome!
Best, Hans
Hans,
This is awesome! Simply awesome! I just tried it out and it works exactly the way I like to work in the terminal.
One question: Is it possible to force the plugin to always work from the root of a specific directory? For example, I have a website set up as a project. I'm never going to need any files outside of the project. Possible to be able to type control-tab and start from the root of the project folder instead?
Charley
On 11.03.2007, at 17:03, Charley Tiggs wrote:
Hans,
This is awesome! Simply awesome! I just tried it out and it works exactly the way I like to work in the terminal.
One question: Is it possible to force the plugin to always work from the root of a specific directory? For example, I have a website set up as a project. I'm never going to need any files outside of the project. Possible to be able to type control-tab and start from the root of the project folder instead?
Charley
Hi,
well, in principal it is possible to implement this. The question is how?
Suggestion: Supposing I use the character '='. '=' will be replaced by TM_PROJECT_DIRECTORY if it is defined.
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'
Charley: Would be this something you can use?
regards, hans
Hans-Jörg Bibiko wrote:
On 11.03.2007, at 17:03, Charley Tiggs wrote:
Hans,
One question: Is it possible to force the plugin to always work from the root of a specific directory? For example, I have a website set up as a project. I'm never going to need any files outside of the project. Possible to be able to type control-tab and start from the root of the project folder instead?
Hi, 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'
Charley: Would be this something you can use?
Hans,
This is definitely something I can use, with one small modification: strip off the root of the path to css.
so:
=/c CTRL+TAB
inserts "/css", not "/usr/local/src/web/css".
Charley
On Mar 11, 2007, at 1:57 PM, Hans-Jörg Bibiko wrote:
well, in principal it is possible to implement this. The question is how?
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
Btw, ctrl+tab is the key combo that takes you to the drawer and back, so it is a bit of an unfortunate choice.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
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
Hans,
I think misunderstood the example So I'm going to try again.
Given your project example below, let's say I want to create a hyperlink in a.html to the file '/images/1.jpg'. I would not want '/usr/local/src/web' as part of the input. Given your project example below, when I enter '=/i' and hit CTRL+TAB, given that the $TM_PROJECT_PATH is known, and given that I'm creating a link within html, shouldn't the insertion only be '/images'?
I think I'll try modifying the command myself to see if I can accomplish this. As the tool stands, it's extremely useful. Thanks for an awesome beginning!
Charley
Hans-Jörg Bibiko wrote:
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 12 Mar 2007, at 01:43, Charley Tiggs wrote:
Hans,
I think misunderstood the example So I'm going to try again.
Given your project example below, let's say I want to create a hyperlink in a.html to the file '/images/1.jpg'. I would not want '/usr/local/src/web' as part of the input.
OK I see.
Given your project example below, when I enter '=/i' and hit CTRL +TAB, given that the $TM_PROJECT_PATH is known, and given that I'm creating a link within html, shouldn't the insertion only be '/ images'?
Please forgive me if I'm totally wrong. If I want to insert a hyperlink in 'a.html' to '/images/1.jpg' then I would write href="../../images/1.jpg" because my current document's path is the starting point of the file hierarchy. And this is supported.
If you want to that as default, meaning press only CTRL+TAB will show you the content of $TM_PROJECT_PATH instead of $TM_DIRECTORY, well this could be done by using a kind of mode switch (maybe as user- defined TM variable).
I think I'll try modifying the command myself to see if I can accomplish this. As the tool stands, it's extremely useful. Thanks for an awesome beginning!
Best, Hans
Hans-Jörg Bibiko wrote:
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.
Hi Hans,
This looks exactly like what I could use. Excuse my newness - but how do I "invoke this command" - where is it?
---
Steven M. Klass
Strategic Manager, Design Automation - Analog Mixed Signal
SMSC 3930 East Ray Road, Suite 200 Phoenix, Arizona 85044 (480) 704-7046 (Desk) (480) 225-1112 (Mobile) steven.klass@smsc.com
Charley Tiggs lists@tiggs.net Sent by: textmate-bounces@lists.macromates.com 03/11/07 09:03 AM Please respond to TextMate users textmate@lists.macromates.com
To TextMate users textmate@lists.macromates.com cc
Subject Re: [TxMt] Insert File/Path names + open a file without using a GUI
Hans-Jörg Bibiko wrote:
Hi,
I rewrote my Command 'Insert File/Path Name + AutoCorrect'. Key: CTRL+TAB Scope: none
BTW I use this Command very often to open a file without a mouse or GUI.
Just type: 'mate ' and invoke this Command, and finally press CTRL+R.
To illustrate that Command I did a screencast (without sound because my mic is out of order, but there are written comments)
http://www.bibiko.de/TM_InsertFilePathNames.mov (ca. 5.7MB)
Comments are welcome!
Best, Hans
Hans,
This is awesome! Simply awesome! I just tried it out and it works exactly the way I like to work in the terminal.
One question: Is it possible to force the plugin to always work from the root of a specific directory? For example, I have a website set up as a project. I'm never going to need any files outside of the project. Possible to be able to type control-tab and start from the root of the project folder instead?
Charley
______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Hi Steven,
go to my first posting http://article.gmane.org/ gmane.editors.textmate.general/18072
Download the attachment 'FileName Completion.tmCommand' to your hard disk.
Double-click at this tmCommand; TM will install it automatically.
Open a new window and press CTRL+TAB.
Regarding to the key binding: please change the key binding within the bundle editor to whatever you want because CTRL+TAB is an essential short-key for the project drawer.
Cheers,
Hans
On 12.03.2007, at 16:25, Steven.Klass@smsc.com wrote:
Hi Hans,
This looks exactly like what I could use. Excuse my
newness - but how do I "invoke this command" - where is it?
Steven M. Klass
Strategic Manager, Design Automation - Analog Mixed Signal
SMSC 3930 East Ray Road, Suite 200 Phoenix, Arizona 85044 (480) 704-7046 (Desk) (480) 225-1112 (Mobile) steven.klass@smsc.com
Charley Tiggs lists@tiggs.net Sent by: textmate-bounces@lists.macromates.com 03/11/07 09:03 AM Please respond to TextMate users textmate@lists.macromates.com
To TextMate users textmate@lists.macromates.com cc Subject Re: [TxMt] Insert File/Path names + open a file without using a GUI
Hans-Jörg Bibiko wrote:
Hi,
I rewrote my Command 'Insert File/Path Name + AutoCorrect'. Key: CTRL+TAB Scope: none
BTW I use this Command very often to open a file without a mouse
or GUI.
Just type: 'mate ' and invoke this Command, and finally press CTRL+R.
To illustrate that Command I did a screencast (without sound
because my
mic is out of order, but there are written comments)
http://www.bibiko.de/TM_InsertFilePathNames.mov (ca. 5.7MB)
Comments are welcome!
Best, Hans
Hans,
This is awesome! Simply awesome! I just tried it out and it works exactly the way I like to work in the terminal.
One question: Is it possible to force the plugin to always work from the root of a specific directory? For example, I have a website set up as a project. I'm never going to need any files outside of the project. Possible to be able to type control-tab and start from the root of the project folder instead?
Charley
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
********************************************************** Hans-Joerg Bibiko Max Planck Institute for Evolutionary Anthropology Department of Linguistics Deutscher Platz 6 phone: +49 (0) 341 3550 341 D-04103 Leipzig fax: +49 (0) 341 3550 333 Germany e-mail: bibiko@eva.mpg.de **********************************************************