Loading ...
Sorry, an error occurred while loading the content.

Re: -c commandline option, order of execution/ reading files

Expand Messages
  • Bram Moolenaar
    ... Changing this will cause many problems with backwards compatibilty. Vi could not mix -c commands with file names, all -c commands had to come first. You
    Message 1 of 2 , Nov 19, 2005
    • 0 Attachment
      Marc Weber wrote:

      > man vim says: -c command will be executed after the first file has been
      > read.
      >
      > Why not just load files given by command line and execute -c commands in
      > order?
      > Then you could use
      > vim -c "au BufNewFile,BufRead *.tex let g:works=1" t.tex
      > to define the au command before reading t.tex
      > and you could use commands like this:
      > vim myfile -c "s/pattern/substpatt/"
      >
      > it's just a thought. It doesn't matter anyway because you can force the
      > order by using -c 'e myfiletoload' anyway.
      >
      > I just lost some time finding my problem

      Changing this will cause many problems with backwards compatibilty.

      Vi could not mix -c commands with file names, all -c commands had to
      come first.

      You can use --cmd to execute a command early.

      --
      hundred-and-one symptoms of being an internet addict:
      94. Now admit it... How many of you have made "modem noises" into
      the phone just to see if it was possible? :-)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.