Re: Perltidy,VIM for C/C++ visual block cleanup

2006-09-14 Thread Yakov Lerner
On 9/14/06, Gundala Viswanath <[EMAIL PROTECTED]> wrote: > I'm afraid only vim internal indenter can be used for partial(block) tidying. > How do you do that Yakov? I believe your earlier suggestion gg=G doesn't do partial right? There are several methods. One was shown by Charles Campbell

Re: Two """problems"""

2006-09-14 Thread Andrea Spadaccini
Ciao Peter, > The Vim Book (http://iccf-holland.org/click5.html#oualline) will get > you up to speed quickly on most of Vim's important features, and > teach you how to use some important tools you might miss otherwise. > Most complex commands can still be reduced down to one or two > keystrokes,

Re: Two """problems"""

2006-09-14 Thread Andy Wokula
Pete Johns schrieb: > " For all lines longer than 72 characters, reformat the > " paragraph from that line.. > 1,$g/.\{73,}/normal v}gq or just :set tw=72 " if set otherwise :g/./normal gqq Andy ___

vim | multiple files editing and delete question

2006-09-14 Thread Nikolaos A. Patsopoulos
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 run this script on multiple files. In vim's help there is this

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

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: 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 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: 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: 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 (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 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 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 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 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 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

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 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 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 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 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

vim | replacement question

2006-09-14 Thread Nikolaos A. Patsopoulos
Hi, another two questions: 1. I want to delete all text that has a specific pattern. I use the following code with s command but I want to keep the \a character in the beginning: :%s/\a,\_.\{-}<\/td><\/tr>/ 2. how can I join lines that have non-numerical characters? e.g. 153 Purdue Canc Ct 1

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 | replacement question

2006-09-14 Thread A.J.Mechelynck
Nikolaos A. Patsopoulos wrote: Hi, another two questions: 1. I want to delete all text that has a specific pattern. I use the following code with s command but I want to keep the \a character in the beginning: :%s/\a,\_.\{-}<\/td><\/tr>/ To delete everything that matches a certain pattern

Re: Matchit's match_words Question

2006-09-14 Thread Benji Fisher
On Tue, Sep 12, 2006 at 07:30:55PM -0500, Bill McCarthy wrote: > > Thanks, Tony. I was just getting ready to respond to myself > with another solution I found with a hint from the help > file: > > let b:match_words = > \'\%(\S\+\)\@ > Hint from ":help matchit-spaces" > Also ":hel

Re: vim | replacement question

2006-09-14 Thread Nikolaos A. Patsopoulos
A.J.Mechelynck wrote: Nikolaos A. Patsopoulos wrote: Hi, another two questions: 1. I want to delete all text that has a specific pattern. I use the following code with s command but I want to keep the \a character in the beginning: :%s/\a,\_.\{-}<\/td><\/tr>/ To delete everything that matc

vim | insert filename into file

2006-09-14 Thread Nikolaos A. Patsopoulos
Hi, how can anyone add the filename in the file in ex-mode? % and "%p works only in normal mode Thanks, Nikos

Re: vim | insert filename into file

2006-09-14 Thread Jürgen Krämer
Hi, Nikolaos A. Patsopoulos wrote: > > how can anyone add the filename in the file in ex-mode? > % and "%p works only in normal mode :put % Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact

Re: vim | insert filename into file

2006-09-14 Thread Nikolaos A. Patsopoulos
Jürgen Krämer wrote: Hi, Nikolaos A. Patsopoulos wrote: how can anyone add the filename in the file in ex-mode? % and "%p works only in normal mode :put % Regards, Jürgen That seems to insert the filename in random place. What if I want to place it e.g. in the beginning of e

Re: vim | insert filename into file

2006-09-14 Thread dcuaron
If you don't want to put the filename on a new line as :put % does, maybe try :normal "%p -dan

Re: vim | insert filename into file

2006-09-14 Thread Tim Chase
how can anyone add the filename in the file in ex-mode? % and "%p works only in normal mode :put % Or, if you need to insert it at a particular place, :10s/$/\=' '.expand('%') will put it at the end of line #10. The basic idiom involves replacing something (EOL, BOL, or some of

Re: vim | insert filename into file

2006-09-14 Thread dcuaron
To place at the beginning of each line try :%normal "%P -dan

Re: vim | insert filename into file

2006-09-14 Thread Tim Chase
:put % That seems to insert the filename in random place. What if I want to place it e.g. in the beginning of each line? It inserts it on the line below where the cursor currently is. You can specify a target (as in :30put % which will put it below line #30) If you want it at the

Re: vim | insert filename into file

2006-09-14 Thread Nikolaos A. Patsopoulos
Tim Chase wrote: :put % That seems to insert the filename in random place. What if I want to place it e.g. in the beginning of each line? It inserts it on the line below where the cursor currently is. You can specify a target (as in :30put % which will put it below line #30) If you w

Re: Two """problems"""

2006-09-14 Thread Peter Hodge
--- Andrea Spadaccini <[EMAIL PROTECTED]> wrote: > > Well.. the vim book is for vim 5.7.. Are there any plans to make a new > version for vim 7.x? > > I would buy it if only it was up-to-date! :) > Many of Vim's best features were included in 5.7. It is still a great book to get you from a nov

Re: Two """problems"""

2006-09-14 Thread Meino Christian Cramer
From: Max Dyckhoff <[EMAIL PROTECTED]> Subject: RE: Two """problems""" Date: Wed, 13 Sep 2006 20:30:15 -0700 Hi Max, thanks a lot for your help ! :) (sorry for the late reply...) I am maintaining a source code from someone else (which left the company) and some of the lines of code are loo

RE: Two """problems"""

2006-09-14 Thread Max Dyckhoff
Ah, I can understand that. I have (so far) in my professional career never had the joy of maintaining someone else's code, or when I have it is written with nice guidelines that avoid lng lines ;) Hope you get on well with it! Max > -Original Message- > From: Meino Ch

Re: Two """problems"""

2006-09-14 Thread Meino Christian Cramer
From: Pete Johns <[EMAIL PROTECTED]> Subject: Re: Two """problems""" Date: Thu, 14 Sep 2006 13:46:42 +1000 > On Thu, 2006-09-14 at 04:45:12 +0200, Meino Christian Cramer sent: > >2.) Currently I am reading the ascii version of the vimtips > >file. One thing I would like to change physically (th

Re: Two """problems"""

2006-09-14 Thread Pete Johns
On Fri, 2006-09-15 at 04:57:24 +0200, Meino Christian Cramer sent: >Hi Pete! > Hi! >thank you very much for this "line of code" -- works like a >charme! > Delighted to hear it. >The only """bad""" thing is: I dont understand completly, how it >works > He he... I'm glad that someone's taken

Re: Display of CJK characters in a utf-8 file on MacOS X / Vim 7

2006-09-14 Thread Axel Kielhorn
Am 12.09.2006 um 20:31 schrieb Elliot Shank: Yongwei Wu wrote: On 9/12/06, Elliot Shank <[EMAIL PROTECTED]> wrote: A.J.Mechelynck wrote: > Elliot Shank wrote: > 3. I don't know the fine points, but is there an Apple/Macintosh site > from which you could download a "language pack" (or somethi

Re: Display of CJK characters in a utf-8 file on MacOS X / Vim 7

2006-09-14 Thread Elliot Shank
Axel Kielhorn wrote: Am 12.09.2006 um 20:31 schrieb Elliot Shank: Yongwei Wu wrote: On 9/12/06, Elliot Shank <[EMAIL PROTECTED]> wrote: A.J.Mechelynck wrote: > 3. I don't know the fine points, but is there an Apple/Macintosh site > from which you could download a "language pack" (or something)