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

Re: how to execute outer program with a parameter of the filename being edited

Expand Messages
  • Tony Mechelynck
    ... see ... for example ... or even ... to give to the make program the name of the current file with .c removed and .o added (as a make target). Best regards,
    Message 1 of 3 , Mar 2, 2008
    • 0 Attachment
      guojq wrote:
      > hi, guys,
      >
      > I am wondering how to execute an outer program with a parameter of the
      > filename being edited automatically. Say, when I am editing any c
      > source file, I then can use gcc to compile any source files inside vim
      > and do not need to input the source file name.

      see
      :help current-file
      :help filename-modifiers
      :help 'makeprg'
      :help :compiler
      :help :make

      for example
      :!someprogram %
      or even
      :make %:r.o

      to give to the make program the name of the current file with .c removed
      and .o added (as a make target).


      Best regards,
      Tony.
      --
      We're only in it for the volume.
      -- Black Sabbath

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.