Re: editor that has multi file search/replace?

news_at_celticbear.com
Date: 11/16/05


Date: 16 Nov 2005 08:53:41 -0800


Dances With Crows wrote:
> On Wed, 16 Nov 2005 17:15:45 +0100, Michael Heiming staggered into the
> Black Sun and said:
> > In comp.os.linux.misc news@celticbear.com <news@celticbear.com>:
> >> Any recommendations on any free programs for Linux, script/code
> >> editors with syntax hilighting, that allows you to open multiple
> >> files and then can do a find and search/replace on all open files?
> > $ for f in *.txt
> > do
> > vi $f 2>/dev/null << EOF
> >:%s/blah/xyz/g
> >:wq!
> > EOF
> > done
> >
> > Adjust to your taste.
>
> Er, what news@ wanted was something that worked *within* a text editor.
> vim does that too, natch:
>
[..]
DwC, thanks. You're right, and I tried it with the example given in the
help.
I was worried at first, because sometimes I need to find/replace on
about 50 different files, I wasn't about to type "vim file1 file2 file3
etc.". "vim *.php" seemed to work OK.
I may use this method when I need to do things like just change a
directory path on all the files real quick.

> ...start vim and enter ":help 26.3" for the complete reference for this
> and other ways to apply vim commands to many files, windows, or buffers.
> news@ doesn't seem like a vim kind of person, though. Maybe he'd prefer
> emacs?[0]
>
Acually, I like Vim more than Emacs. =) Never got the hang of Emacs.
But, you're partly right. I use Vim CONSTANLY on the server to make
changes here and there to config files, to read READMEs and doc files,
and make quick changes.
But I hate using Vim (or any non GUI editor) when scripting HTML/PHP
files and building sites. I just really like to be able to quickly
scroll around, use a mouse to copy/paste, switch between files quickly.
Oh I know you can do all that with Vim (except the mouse part,) I just
find the GUI easier for me. Especially for things like Zend studio,
where it has auto function complete, marking and bookmarking lines,
quick display of the beginning of end brackets, built-in SQL
connections and other geegaws that just makes 8 hours of scripting a
day easy for me. =)

But I will never give up using Vim for on-the-server file viewing and
quick editing!

> > I'd use perl/sed/awk if you have more then a few dozen files to edit.
>
> AOL on that.
>
I really should learn Perl sometime....

> [0] There are 2 text editors, vim and emacs. Everything else is not
> powerful enough, lacking useful features, and not ubiquitous.
>

Thanks for the reply!!
Liam



Relevant Pages

  • Re: Anyone use ELSE minor-mode in Emacs?
    ... > with the standard emacs keys, but I don't like to change them. ... Emacs and Vim key-bindings are pretty different, ... Vim that I was in Emacs. ... Then a Python script analyses the received email and pre-sorts it in ...
    (comp.lang.python)
  • [Fwd: Re: HTML editor. What to use?]
    ... I always admired emacs for it's ability to run a shell within a frame of the ... However, I am one of those who prefer vim, and vim does not have this ability ... I've often considered a nice gui editor for webdesign, but each time i start to ...
    (Debian-User)
  • Re: An Editor that Skips to the End of a Def
    ... that are to be found on the way up the Emacs learning curve. ... Off the top of my head, I can think of a few vim commands that have ... the latter case, you can't use backspace, you have to use "X". ...
    (comp.lang.python)
  • Re: Great SWT Program
    ... IDE-like features such as syntax highlighting and automatic ... I discovered that vim had them too. ... Just for the record, and vim is a fine product, emacs has these features also. ... those of us who cling to these old-time editors would ...
    (comp.lang.java.programmer)
  • Unix is not an *I*DE (Was: Any TextMate Editor equivelent for Windows ?)
    ... Please recall that IDE means 'integrated development environment'. ... In Emacs in order to open a file in the editor you ... Some vim users may be surprised but vim actually has a similar ... RFC-compliant coffee machine. ...
    (comp.lang.ruby)