Hi Ted, * Ted Pavlic on Friday, March 07, 2008 at 17:00:04 -0500 > Check out the solution at: > > http://links.tedpavlic.com/shell_scripts/vimlatex
Very neat. > I implemented the sed scripts with single quotes to help make the > "trick" documented on that page a little more clear. Yup. You beat me to it. Single quotes are much easier to handle as long as you don't /have/ to use double quotes. > The "trick" puts a "\" at the end of the sed script and then inserts a > NEWLINE right in the middle of the string. The "\" somehow tells the > shell (or sed) to continue to the next line before assembling the string. > > So, really all you need is something like... > > sed -e 's/blah/\'$'\n''stuff/' > > which will replace "blah" with a newline and then "stuff". Thanks for clarifying. > Hopefully that will do it. Works like a charm with both Apple shipped sed and gsed. > Side notes: > > 1. The OS/X sed has no trouble MATCHING a newline with \n) Ah, right. > 2. I changed the ORDER of the search strings. I also added a SECOND > search string for catching numbers split across lines. It's meant to > catch lines like: > > things 12 > 34 stuff 56 > 78 other things > > Now, if that pattern continues, it will miss a few. I'm hoping that just > catching three lines in a row will be sufficient. A better solution > would be to use perl... but I don't know what's included with OS/X > without installing the developer tools. :( Python and Perl are included; the libs are in a non-standard location: /Library/Perl/... But for for executing scripts you should be fine. Still for these tasks sed and awk are way cooler and faster. c -- __ _ _ _ __ _ _ \ \ | |__| |__ _ __| |_\ \| |_ _ _ __ _ __| |_ \ \| '_ \ / _` / _| / /\ \ _| '_/ _` (_-< ' \ http://www.blacktrash.org/ \_\_.__/_\__,_\__|_\_\ \_\__|_| \__,_/__/_||_| Jabber-ID: [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Vim-latex-devel mailing list Vim-latex-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vim-latex-devel