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

Re: name of this file

Expand Messages
  • JuanPablo
    yes, :make is for compile. but my real question is a vim function for get the name of file. ... -- JuanPablo Abarzúa Jaramillo Universidad de La Frontera
    Message 1 of 8 , Oct 29, 2009
    • 0 Attachment
      yes, :make is for compile.

      but my real question is a vim function for get the name of file.

      On Thu, Oct 29, 2009 at 7:38 PM, <kbirkland@...> wrote:
      > Just do a :make instead
      >
      > Sent on the Now Network™ from my Sprint® BlackBerry
      >
      > -----Original Message-----
      > From: JuanPablo <jabar004@...>
      > Date: Thu, 29 Oct 2009 19:33:08
      > To: <vim_use@...>
      > Subject: name of this file
      >
      >
      > hi,
      >  how I can get the name of file I am editing with vim ?
      >  if I editing a file called source.c, how can compilling this file ?
      >
      > !gcc source.c
      >
      > exist a general function for get name of file ?
      >
      > !gcc nameOfFile()
      >
      > --
      > JuanPablo
      >
      >
      >
      > >
      >



      --
      JuanPablo Abarzúa Jaramillo
      Universidad de La Frontera
      Chile

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • kbirkland@gmail.com
      !gcc % Sent on the Now Network™ from my Sprint® BlackBerry ... From: JuanPablo Date: Thu, 29 Oct 2009 19:43:08 To:
      Message 2 of 8 , Oct 29, 2009
      • 0 Attachment
        !gcc %
        Sent on the Now Network™ from my Sprint® BlackBerry

        -----Original Message-----
        From: JuanPablo <jabar004@...>
        Date: Thu, 29 Oct 2009 19:43:08
        To: <vim_use@...>
        Subject: Re: name of this file


        yes, :make is for compile.

        but my real question is a vim function for get the name of file.

        On Thu, Oct 29, 2009 at 7:38 PM, <kbirkland@...> wrote:
        > Just do a :make instead
        >
        > Sent on the Now Network™ from my Sprint® BlackBerry
        >
        > -----Original Message-----
        > From: JuanPablo <jabar004@...>
        > Date: Thu, 29 Oct 2009 19:33:08
        > To: <vim_use@...>
        > Subject: name of this file
        >
        >
        > hi,
        >  how I can get the name of file I am editing with vim ?
        >  if I editing a file called source.c, how can compilling this file ?
        >
        > !gcc source.c
        >
        > exist a general function for get name of file ?
        >
        > !gcc nameOfFile()
        >
        > --
        > JuanPablo
        >
        >
        >
        > >
        >



        --
        JuanPablo Abarzúa Jaramillo
        Universidad de La Frontera
        Chile



        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Reid Thompson
        I usually do CTRL-g --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more information, visit
        Message 3 of 8 , Oct 29, 2009
        • 0 Attachment
          I usually do CTRL-g

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Chris Suter
          ... The % register contains the current filename. So, for example, %p would place the current filename after the cursor. In ex commands, you can just use %
          Message 4 of 8 , Oct 29, 2009
          • 0 Attachment
            On Thu, Oct 29, 2009 at 6:43 PM, JuanPablo <jabar004@...> wrote:

            yes, :make is for compile.

            but my real question is a vim function for get the name of file.

            On Thu, Oct 29, 2009 at 7:38 PM,  <kbirkland@...> wrote:
            > Just do a :make instead
            >
            > Sent on the Now Network™ from my Sprint® BlackBerry
            >
            > -----Original Message-----
            > From: JuanPablo <jabar004@...>
            > Date: Thu, 29 Oct 2009 19:33:08
            > To: <vim_use@...>
            > Subject: name of this file
            >
            >
            > hi,
            >  how I can get the name of file I am editing with vim ?
            >  if I editing a file called source.c, how can compilling this file ?
            >
            > !gcc source.c
            >
            > exist a general function for get name of file ?
            >
            > !gcc nameOfFile()
            >
            > --
            > JuanPablo
            >
            >
            >
            > >
            >



            --
            JuanPablo Abarzúa Jaramillo
            Universidad de La Frontera
            Chile



            The % register contains the current filename. So, for example, "%p would place the current filename after the cursor. In ex commands, you can just use % directly as in
             :!gcc %
            to do what you describe.

            FYI, it's customary to post responses at the bottom of the previous message on this list (known as bottom-posting)

            HTH



            --
            Christopher Suter
            www.grooveshark.com

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---

          • David Fishburn
            ... Or you can get the fullpath of the file name with: expand( %:p ) ... HTH, Dave --~--~---------~--~----~------------~-------~--~----~ You received this
            Message 5 of 8 , Oct 29, 2009
            • 0 Attachment
              On Thu, Oct 29, 2009 at 6:43 PM, JuanPablo <jabar004@...> wrote:
              >
              > yes, :make is for compile.
              >
              > but my real question is a vim function for get the name of file.

              You would use:
              :!gcc %

              Or you can get the fullpath of the file name with:
              expand("%:p")

              So you could use:
              :echo system('gcc '.expand("%:p"))

              :h filename-modifiers

              HTH,
              Dave

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • JuanPablo
              % is the answer many thanks. ... -- JuanPablo Abarzúa Jaramillo Universidad de La Frontera Chile --~--~---------~--~----~------------~-------~--~----~ You
              Message 6 of 8 , Oct 29, 2009
              • 0 Attachment
                % is the answer

                many thanks.

                On Thu, Oct 29, 2009 at 7:48 PM, David Fishburn <dfishburn.vim@...> wrote:
                >
                > On Thu, Oct 29, 2009 at 6:43 PM, JuanPablo <jabar004@...> wrote:
                >>
                >> yes, :make is for compile.
                >>
                >> but my real question is a vim function for get the name of file.
                >
                > You would use:
                > :!gcc %
                >
                > Or you can get the fullpath of the file name with:
                > expand("%:p")
                >
                > So you could use:
                > :echo system('gcc '.expand("%:p"))
                >
                > :h filename-modifiers
                >
                > HTH,
                > Dave
                >
                > >
                >



                --
                JuanPablo Abarzúa Jaramillo
                Universidad de La Frontera
                Chile

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