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