Send textmate mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of textmate digest..."
Today's Topics:
1. Re: Executing command on all files in a project AND using TM
variables in a search and replace (Allan Odgaard)
2. Re: Latex: completion with esc not working (Christopher Brewster)
3. Re: TODO problem (Jasper van der Meulen)
Date: October 20, 2006 1:42:15 AM EDT
Subject: Re: [TxMt] Executing command on all files in a project AND using TM variables in a search and replace
On 19. Oct 2006, at 22:12, J Fishwick wrote:
Command:
eval arr=("$TM_SELECTED_FILES")
for (( i = 0; i < ${#arr[@]}; i++ )); do
perl -pe 'while ($string =~ m/mc\d+(.*\n.*True)/g) {$string =~
s/mc\d+/tf$TM_FILENAME/g;}';
done
Input: Entire Doc
Output: Replace selected text
You need to set input/output to none/discard (or show tool tip, or maybe show as HTML and make your command output some progress info).
Then your actual command needs to load the file itself, it already iterators over the selected files, it just doesn’t tell perl to load/overwrite each of them.
So a simple example would instead be:
eval arr=("$TM_SELECTED_FILES")
for f in "${arr[@]}"; do
perl -i.bak -pe 's/bar/bar/' "$f"
done
rescan_project # do this after you make changes to files, so TM will rescan
This will replace foo with bar in all selected files (and create a .bak file with the old contents).
Two other things: 1) inside single quoted strings, shell variables are not expanded, so if you want to use $TM_… then you need to use double quotes, and 2) TM_FILENAME is the filename of the file open when you called the file, it won’t update inside the loop. Here you would instead use the current file given by the loop (in my example $f).
Date: October 20, 2006 6:35:06 AM EDT
Subject: Re: [TxMt] Latex: completion with esc not working
On 19 Oct 2006, at 23:13, Charilaos Skiadas wrote:
Is this what they should be?
That looks right. Is this a saved file? Try it with both saved files as well as untitled documents.
The problem is specific to that project I am afraid. There is no problem with other latex files in other folders.
Is it part of a project, via TM_LATEX_MASTER?
yes it is
Are you setting TM_LATEX_BIB? (You don't have to, just checking your settings)
Checking this I realised for Bibtex the path had changed. So the \cite{} case is solved.
But the \ref{} case is still not working (in this project).
How are you testing that it is not working?
for \ref{}
put cursor in braces and press esc
Does the other completion command work, the one via opt-esc?
This does nothing.
Make sure that you are up to date, I recently fixed a problem someone else had that sounds possibly similar, though his was with the Command Completion command.
I am up to date.
Thanks,
Christopher
______________________________________________________________________
(threading gets destroyed and the universe will collapse if you don't)
Date: October 20, 2006 7:43:02 AM EDT
Subject: Re: [TxMt] TODO problem
I don't think you understand what i mean...
I've got it in a picture now ..
<screenshot 2.png>
however
On 20-okt-2006, at 7:26, Allan Odgaard wrote:
On 20. Oct 2006, at 00:02, Jasper van der Meulen wrote:
Could it be that a project is different for the TODO ?
It visits all files found under TM_PROJECT_DIRECTORY (using the globally configured folder reference patterns for what to skip).
______________________________________________________________________
(threading gets destroyed and the universe will collapse if you don't)
_______________________________________________
textmate mailing list