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
: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
To place at the beginning of each line try
:%normal "%P
-dan
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
If you don't want to put the filename on a new line as :put % does, maybe try
:normal "%p
-dan
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
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