Re: vim | multiple files editing and delete question

2006-09-15 Thread A.J.Mechelynck
Tim Chase wrote: for %a in (*.txt) do [command using %a] instead of for %%a in (*.txt) do [command using %%a] Then again, maybe I'm among the freakish few that actually use for-loops at the dos-prompt. :) -tim I have used them too, starting (in my case) with Dos 3.1. Your warning

Re: vim | multiple files editing and delete question

2006-09-15 Thread Tim Chase
for %a in (*.txt) do [command using %a] instead of for %%a in (*.txt) do [command using %%a] Then again, maybe I'm among the freakish few that actually use for-loops at the dos-prompt. :) -tim I have used them too, starting (in my case) with Dos 3.1. Your warning is valid on old D

Re: vim | multiple files editing and delete question

2006-09-15 Thread A.J.Mechelynck
Tim Chase wrote: To do an operation on multiple files in a WinXP DOS batch: for %%A in (*.txt) do [command] Just a small caveat to the reader, this works within a batch file by escaping the variable ("%A" in this case). If you're running it from the command-line, you don't escape it, and

Re: vim | multiple files editing and delete question

2006-09-15 Thread A.J.Mechelynck
Nikolaos A. Patsopoulos wrote: Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> Yakov Lerner wrote: >> > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> >>

RE: vim | multiple files editing and delete question

2006-09-14 Thread Bulgrien, Kevin
Is this what you want for #3? --- $ mkdir 1 2 $ >1/a $ >1/b $ >2/c $ >2/d ]$ tree . |-- 1 | |-- a | `-- b `-- 2 |-- c `-- d 2 directories, 4 files $ for file in $(find . -type f); do dir=$(dirname "${file}"); mv "${file}" "${dir}/$(basename "${dir}"_$(basename "${file}"))"; done $ t

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Sibin P. Thomas wrote: If u have Cygwin then creating a batch file with the following would be the simplest solution - set TARGETDIR=C:\something set SCRIPTDIR=C:\something_else find %TARGETDIR% -name "*.[ch]" -exec gvim -s %SCRIPTDIR%\win32_vimscript.vim "{}" ";" Basically use "find" to help u

RE: vim | multiple files editing and delete question

2006-09-14 Thread Sibin P. Thomas
If u have Cygwin then creating a batch file with the following would be the simplest solution - set TARGETDIR=C:\something set SCRIPTDIR=C:\something_else find %TARGETDIR% -name "*.[ch]" -exec gvim -s %SCRIPTDIR%\win32_vimscript.vim "{}" ";" Basically use "find" to help u (actually it's just one

Re: vim | multiple files editing and delete question

2006-09-14 Thread Tim Chase
To do an operation on multiple files in a WinXP DOS batch: for %%A in (*.txt) do [command] Just a small caveat to the reader, this works within a batch file by escaping the variable ("%A" in this case). If you're running it from the command-line, you don't escape it, and thus use

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Steve Hall wrote: On Thu, 2006-09-14 at 13:01 +0300, Nikolaos A. Patsopoulos wrote: 1. I want to edit multiple files from command line so I created a vim script with all the commands (>20). I use a batch file in WinXP: |@echo off vim -s script file.txt exit however I need to run this

Re: vim | multiple files editing and delete question

2006-09-14 Thread Steve Hall
On Thu, 2006-09-14 at 13:01 +0300, Nikolaos A. Patsopoulos wrote: > > 1. I want to edit multiple files from command line so I created a > vim script with all the commands (>20). I use a batch file in WinXP: > > |@echo off > vim -s script file.txt > exit > > however I need to run this script o

Re: vim | multiple files editing and delete question

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote> Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> Yakov Lerner wrote: >> > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> >> Yakov Lerner wrote: >> >> > On 9/14/06, Nikolaos A.

Re: vim | multiple files editing and delete question (bash script)

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> 3. This is not Vim related but I wonder if anyone knows sth. I have >> the following structure of folders and files: >> >> ..

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> Yakov Lerner wrote: >> > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> >> 2.Can I delete after a pattern

Re: vim | multiple files editing and delete question (bash script)

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> 3. This is not Vim related but I wonder if anyone knows sth. I have >> the following structure of folders and files: >> >> .. >> folder1 >>

Re: vim | multiple files editing and delete question

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> Yakov Lerner wrote: >> > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> >> 2.Can I delete after a pattern search? Sth like this

Re: vim | multiple files editing and delete question (bash script)

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: 3. This is not Vim related but I wonder if anyone knows sth. I have the following structure of folders and files: .. folder1 file1 file2 folder2 file1 file2 . and want to ad

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> 2.Can I delete after a pattern search? Sth like this: >> >> :/^: /-3d >> >> and how can I repeat this globally? > > :g/^: /.-

Re: vim | multiple files editing and delete question

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Yakov Lerner wrote: > On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: >> 2.Can I delete after a pattern search? Sth like this: >> >> :/^: /-3d >> >> and how can I repeat this globally? > > :g/^: /.-3d > > Yakov > > I ge

Re: vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
Yakov Lerner wrote: On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: 2.Can I delete after a pattern search? Sth like this: :/^: /-3d and how can I repeat this globally? :g/^: /.-3d Yakov I get an E16: invalid range error -- Nikolaos A. Patsopoulos, MD Department of Hygiene

Re: vim | multiple files editing and delete question

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: 3. This is not Vim related but I wonder if anyone knows sth. I have the following structure of folders and files: .. folder1 file1 file2 folder2 file1 file2 . and want to add the folder name int

Re: vim | multiple files editing and delete question

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: 2.Can I delete after a pattern search? Sth like this: :/^: /-3d and how can I repeat this globally? :g/^: /.-3d Yakov

Re: vim | multiple files editing and delete question

2006-09-14 Thread Yakov Lerner
On 9/14/06, Nikolaos A. Patsopoulos <[EMAIL PROTECTED]> wrote: Hi, I have a series of questions: 1. I want to edit multiple files from command line so I created a vim script with all the commands (>20). I use a batch file in WinXP: |@echo off vim -s script file.txt exit however I need to ru