Hi
I have recently started using textmate, and like it very much, with the exception of the search and replace, which I find rather awkward.
from vi and emacs I am familiar with being able to specify the search and replace strings from a command line like, for example in vi I would
%s/OLD/NEW/g
which replaces OLD with NEW throughout the entire file. OLD can also be a regex
In texmate you essentially always have to bring up the find/replace dialog if you want to use regex expression.
for simple find/replace you can use the cmd-E to put the current selection into the search field, but there is no easy way to put a replacement text into the replace field. If the replacement text happens to be some where in the file you can find and select it and shift-cmd-F into the replace field.
But this is all very long and awkward. Am I missing something or is the a easier way to use the find and replace in textmate, without having to bring up the dialog box all the time. seems a lot of key strokes with shift cmd, option, tabs, returns etc compared to my familiar s/regex-find/replace/g
thanks Steve
On Wed, May 12, 2010 at 10:11 PM, Steven McDonald mcdonald@triumf.cawrote:
<snip> Am I missing something or is the a easier way to use the find and replace in textmate, without having to bring up the dialog box all the time. seems a lot of key strokes with shift cmd, option, tabs, returns etc compared to my familiar s/regex-find/replace/g
Not exactly what you're looking for (no regex) but handy and dialog free: 1. cmd+e to load the find buffer 2. type your new text 3. select it 4. cmd+shft+e to load the replace buffer 5. ctrl+cmd+f to replace everything (add shift to limit the replace to a selection)
On 13 May 2010, at 06:22, Will wrote:
On Wed, May 12, 2010 at 10:11 PM, Steven McDonald mcdonald@triumf.ca wrote: <snip> Am I missing something or is the a easier way to use the find and replace in textmate, without having to bring up the dialog box all the time. seems a lot of key strokes with shift cmd, option, tabs, returns etc compared to my familiar s/regex-find/replace/g
Not exactly what you're looking for (no regex) but handy and dialog free:
- cmd+e to load the find buffer
- type your new text
- select it
- cmd+shft+e to load the replace buffer
- ctrl+cmd+f to replace everything (add shift to limit the replace to a selection)
Or if that's too much to change your workflow, write a command that takes the current selection and acts upon the file. Give it a key combo, and you can do s/old/new/g => key combo => everything replaced.
C --- Caius Durling caius@caius.name +44 (0) 7960 268 100 http://caius.name/