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

Re: variable for Current Working Directory

Expand Messages
  • Gary Johnson
    ... It s true the OP did ask for the current working directory in the Subject, but in his explanation he referred to % as the current document s name , so I
    Message 1 of 26 , Oct 2, 2008
      On 2008-10-03, Tony Mechelynck <antoine.mechelynck@...> wrote:
      > On 03/10/08 05:06, Gary Johnson wrote:
      > > On 2008-10-03, Tony Mechelynck<antoine.mechelynck@...> wrote:
      > >> On 03/10/08 01:14, badmagic wrote:
      > >>> Greetings Vim community,
      > >>>
      > >>> (I've searched and searched and can't solve this.)
      > >>>
      > >>> I've got my Website's directory structure mimicked locally. I edit my
      > >>> pages locally and once I'm happy with them, I scp them to the server
      > >>> upstairs using the following command:
      > >>>
      > >>> :!scp % vinton:/public_html/tcpip/
      > >>>
      > >>> ( I called my server vinton after Vint Cerf :)
      > >>>
      > >>> This command uses % to represent the current document's name.
      > >>>
      > >>> What variable could I use to represent the current directory's name?
      > >>> ( e.g. if it were %%, it would = tcpip )
      > >>>
      > >>> Any and all help appreciated,
      > >>> TIA,
      > >>> Steve (BM)
      > >> fnamemodify('.',':p') gives the current working directory with a
      > >> trailing slash.
      > >>
      > >> To place that name on the command-line of a :! call, use the ":exe" command.
      > >>
      > >> exe "!something" fnamemodify('.',':p')
      > >
      > > To put something like that on the command line, you don't even need
      > > the fnamemodify() function--you can just use the
      > > <filename>:<modifier> construct directly. For example, to list the
      > > contents of the current file's directory, you can just execute this:
      > >
      > > :!ls %:p:h
      > >
      > > There's another example under ":help 42.4".
      > >
      > > Regards,
      > > Gary
      >
      > %:p:h is the directory of the current file. The OP wanted the current
      > directory (as given by :pwd), and expand('.:p') didn't give the desired
      > value.

      It's true the OP did ask for the current working directory in the
      Subject, but in his explanation he referred to % as the "current
      document's name", so I assumed that by "current directory" he meant
      the directory in which the "current document" resides. You may be
      right and I assumed too much.

      Regards,
      Gary


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Tony Mechelynck
      ... Maybe you should study :help pi_netrw.txt which includes everything about making Vim interact with remote servers. Best regards, Tony. -- I sent a letter
      Message 2 of 26 , Oct 2, 2008
        On 03/10/08 07:18, badmagic wrote:
        > Gary Johnson wrote:
        >> On 2008-10-03, Tony Mechelynck<antoine.mechelynck@...> wrote:
        >>> On 03/10/08 05:06, Gary Johnson wrote:
        >>>> On 2008-10-03, Tony Mechelynck<antoine.mechelynck@...> wrote:
        >>>>> On 03/10/08 01:14, badmagic wrote:
        >>>>>> Greetings Vim community,
        >>>>>>
        >>>>>> (I've searched and searched and can't solve this.)
        >>>>>>
        >>>>>> I've got my Website's directory structure mimicked locally. I edit my
        >>>>>> pages locally and once I'm happy with them, I scp them to the server
        >>>>>> upstairs using the following command:
        >>>>>>
        >>>>>> :!scp % vinton:/public_html/tcpip/
        >>>>>>
        >>>>>> ( I called my server vinton after Vint Cerf :)
        >>>>>>
        >>>>>> This command uses % to represent the current document's name.
        >>>>>>
        >>>>>> What variable could I use to represent the current directory's name?
        >>>>>> ( e.g. if it were %%, it would = tcpip )
        >>>>>>
        >>>>>> Any and all help appreciated,
        >>>>>> TIA,
        >>>>>> Steve (BM)
        >>>>> fnamemodify('.',':p') gives the current working directory with a
        >>>>> trailing slash.
        >>>>>
        >>>>> To place that name on the command-line of a :! call, use the ":exe" command.
        >>>>>
        >>>>> exe "!something" fnamemodify('.',':p')
        >>>> To put something like that on the command line, you don't even need
        >>>> the fnamemodify() function--you can just use the
        >>>> <filename>:<modifier> construct directly. For example, to list the
        >>>> contents of the current file's directory, you can just execute this:
        >>>>
        >>>> :!ls %:p:h
        >>>>
        >>>> There's another example under ":help 42.4".
        >>>>
        >>>> Regards,
        >>>> Gary
        >>> %:p:h is the directory of the current file. The OP wanted the current
        >>> directory (as given by :pwd), and expand('.:p') didn't give the desired
        >>> value.
        >> It's true the OP did ask for the current working directory in the
        >> Subject, but in his explanation he referred to % as the "current
        >> document's name", so I assumed that by "current directory" he meant
        >> the directory in which the "current document" resides. You may be
        >> right and I assumed too much.
        >>
        >> Regards,
        >> Gary
        >>
        >>
        >> Hi again,
        >
        > sorry I didn't make it clear.
        >
        > What I'm actually doing is sitting in my home directory where I have a
        > directory called
        >
        > ~/public_html/tcpip/
        >
        > which corresponds to a chrooted directory on the server called
        >
        > /public_html/tcpip/
        >
        > I sit in my home directory and type
        >
        > vi public_html/tcpip/tcpip.html
        >
        > edit the file and then issue the scp from within Vim like
        >
        > :!scp % vinton:/public_html/tcpip/
        >
        > So I don't actually cd into the directory (and that's starting to look
        > like a vital piece of info I left out).
        >
        >
        > The reason why I want to do this is so I can reuse the same command
        > using the history (up arrow) to send all of my files off to the server,
        > regardless whether they be in public_html/tcpip, public_html/solaris,
        > public_html/cprogramming etc.
        >
        > TIA,
        > Steve

        Maybe you should study ":help pi_netrw.txt" which includes everything
        about making Vim interact with remote servers.


        Best regards,
        Tony.
        --
        I sent a letter to the fish,
        I told them, "This is what I wish."
        The little fishes of the sea,
        They sent an answer back to me.
        The little fishes' answer was
        "We cannot do it, sir, because ..."
        I sent a letter back to say
        It would be better to obey.
        But someone came to me and said
        "The little fishes are in bed."
        I said to him, and I said it plain
        "Then you must wake them up again."
        I said it very loud and clear,
        I went and shouted in his ear.
        But he was very stiff and proud,
        He said "You needn't shout so loud."
        And he was very proud and stiff,
        He said "I'll go and wake them if ..."
        I took a kettle from the shelf,
        I went to wake them up myself.
        But when I found the door was locked
        I pulled and pushed and kicked and knocked,
        And when I found the door was shut,
        I tried to turn the handle, But ...

        "Is that all?" asked Alice.
        "That is all." said Humpty Dumpty. "Goodbye."
        -- Lewis Carrol, "Through the Looking Glass"

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • badmagic
        ... Sorry to be difficult. I used to use this method before (editing directly on the server) but didn t like it because if I made a changes/mistakes on the
        Message 3 of 26 , Oct 3, 2008
          Tony Mechelynck wrote:
          > On 03/10/08 07:18, badmagic wrote:
          >> Gary Johnson wrote:
          >>> On 2008-10-03, Tony Mechelynck<antoine.mechelynck@...> wrote:
          >>>> On 03/10/08 05:06, Gary Johnson wrote:
          >>>>> On 2008-10-03, Tony Mechelynck<antoine.mechelynck@...> wrote:
          >>>>>> On 03/10/08 01:14, badmagic wrote:
          >>>>>>> Greetings Vim community,
          >>>>>>>
          >>>>>>> (I've searched and searched and can't solve this.)
          >>>>>>>
          >>>>>>> I've got my Website's directory structure mimicked locally. I edit my
          >>>>>>> pages locally and once I'm happy with them, I scp them to the server
          >>>>>>> upstairs using the following command:
          >>>>>>>
          >>>>>>> :!scp % vinton:/public_html/tcpip/
          >>>>>>>
          >>>>>>> ( I called my server vinton after Vint Cerf :)
          >>>>>>>
          >>>>>>> This command uses % to represent the current document's name.
          >>>>>>>
          >>>>>>> What variable could I use to represent the current directory's name?
          >>>>>>> ( e.g. if it were %%, it would = tcpip )
          >>>>>>>
          >>>>>>> Any and all help appreciated,
          >>>>>>> TIA,
          >>>>>>> Steve (BM)
          >>>>>> fnamemodify('.',':p') gives the current working directory with a
          >>>>>> trailing slash.
          >>>>>>
          >>>>>> To place that name on the command-line of a :! call, use the ":exe" command.
          >>>>>>
          >>>>>> exe "!something" fnamemodify('.',':p')
          >>>>> To put something like that on the command line, you don't even need
          >>>>> the fnamemodify() function--you can just use the
          >>>>> <filename>:<modifier> construct directly. For example, to list the
          >>>>> contents of the current file's directory, you can just execute this:
          >>>>>
          >>>>> :!ls %:p:h
          >>>>>
          >>>>> There's another example under ":help 42.4".
          >>>>>
          >>>>> Regards,
          >>>>> Gary
          >>>> %:p:h is the directory of the current file. The OP wanted the current
          >>>> directory (as given by :pwd), and expand('.:p') didn't give the desired
          >>>> value.
          >>> It's true the OP did ask for the current working directory in the
          >>> Subject, but in his explanation he referred to % as the "current
          >>> document's name", so I assumed that by "current directory" he meant
          >>> the directory in which the "current document" resides. You may be
          >>> right and I assumed too much.
          >>>
          >>> Regards,
          >>> Gary
          >>>
          >>>
          >>> Hi again,
          >> sorry I didn't make it clear.
          >>
          >> What I'm actually doing is sitting in my home directory where I have a
          >> directory called
          >>
          >> ~/public_html/tcpip/
          >>
          >> which corresponds to a chrooted directory on the server called
          >>
          >> /public_html/tcpip/
          >>
          >> I sit in my home directory and type
          >>
          >> vi public_html/tcpip/tcpip.html
          >>
          >> edit the file and then issue the scp from within Vim like
          >>
          >> :!scp % vinton:/public_html/tcpip/
          >>
          >> So I don't actually cd into the directory (and that's starting to look
          >> like a vital piece of info I left out).
          >>
          >>
          >> The reason why I want to do this is so I can reuse the same command
          >> using the history (up arrow) to send all of my files off to the server,
          >> regardless whether they be in public_html/tcpip, public_html/solaris,
          >> public_html/cprogramming etc.
          >>
          >> TIA,
          >> Steve
          >
          > Maybe you should study ":help pi_netrw.txt" which includes everything
          > about making Vim interact with remote servers.
          >
          >
          > Best regards,
          > Tony.
          Sorry to be difficult.

          I used to use this method before (editing directly on the server) but
          didn't like it because if I made a changes/mistakes on the original
          docs, I've lost the only copy (apart from backup~ files and archiving
          every now and then).

          It's just simpler to edit them locally and upload them when I'm truly
          satisfied with my work. It's also safer this way because I've got 2
          copies of everything (plus my backups).

          Regards,
          Steve

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Charles Campbell
          ... Netrw doesn t permit editing directly on the server; it permits editing the file on one s local machine. vim scp://host/path/file downloads a copy of the
          Message 4 of 26 , Oct 3, 2008
            badmagic wrote:
            >
            > Sorry to be difficult.
            >
            > I used to use this method before (editing directly on the server) but
            > didn't like it because if I made a changes/mistakes on the original
            > docs, I've lost the only copy (apart from backup~ files and archiving
            > every now and then).
            >
            > It's just simpler to edit them locally and upload them when I'm truly
            > satisfied with my work. It's also safer this way because I've got 2
            > copies of everything (plus my backups).
            >
            Netrw doesn't permit editing directly on the server; it permits editing
            the file on one's local machine.

            vim scp://host/path/file

            downloads a copy of the file to your local machine, whereupon one may
            inspect and edit it. Then

            :w

            causes netrw to upload the edited copy. The transfers in this case are
            via scp; one may also use ftp. You could then just write the file
            locally instead: :w localfilename .

            Regards,
            Chip Campbell


            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • badmagic
            ... Actually, netrw is just a fancy way of saying Vim allows you to use scp ( part of the ssh tools, port 22 TCP) to open remote files on a server in their
            Message 5 of 26 , Oct 3, 2008
              >>
              > Netrw doesn't permit editing directly on the server; it permits editing
              > the file on one's local machine.
              >
              > vim scp://host/path/file
              >
              > downloads a copy of the file to your local machine, whereupon one may
              > inspect and edit it. Then
              >
              > :w
              >
              > causes netrw to upload the edited copy. The transfers in this case are
              > via scp; one may also use ftp. You could then just write the file
              > locally instead: :w localfilename .
              >
              > Regards,
              > Chip Campbell
              >
              >
              >
              Actually, netrw is just a fancy way of saying Vim allows you to use scp
              ( part of the ssh tools, port 22 TCP) to open "remote" files on a server
              "in their place". It might add some fancy commands for browsing etc. but
              it's still just an ssh/scp connection that Vim adds another layer on top
              of so you can use the netrw commands from within vim.

              It doesn't open it locally. Any editing you do on the file is being done
              on the remote file. This can be proven with tcpdump.

              If you run tcpdump as you're editing the file, you can see the packets
              traversing the network on port 22 TCP. Every keystroke causes network
              traffic. Every command (including :w) is being issued to the remote
              file. The remote file is being edited in place in real time.

              netrw will also allow local browsing and editing but that's not what's
              happening here.

              I just want a variable I can use to specify the directory the file
              that's being edited below my home directory is in.

              Within Vim, if I issue the following command:

              :echo fnamemodify('.',':p:p')

              it returns

              /export/home/badmagic

              but I can't find an explanation of the '.',':p:p' part.

              Where can I find a description of all the :p and other variables that
              represent file names, directories etc?


              TIA,
              Steve

















              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • Tony Mechelynck
              ... Vim never edits a file in place. It reads the file into memory and edits it there. It only writes the file if you tell it to. If every keystroke causes
              Message 6 of 26 , Oct 3, 2008
                On 04/10/08 05:40, badmagic wrote:
                >
                >>>
                >> Netrw doesn't permit editing directly on the server; it permits editing
                >> the file on one's local machine.
                >>
                >> vim scp://host/path/file
                >>
                >> downloads a copy of the file to your local machine, whereupon one may
                >> inspect and edit it. Then
                >>
                >> :w
                >>
                >> causes netrw to upload the edited copy. The transfers in this case are
                >> via scp; one may also use ftp. You could then just write the file
                >> locally instead: :w localfilename .
                >>
                >> Regards,
                >> Chip Campbell
                >>
                >>
                >>
                > Actually, netrw is just a fancy way of saying Vim allows you to use scp
                > ( part of the ssh tools, port 22 TCP) to open "remote" files on a server
                > "in their place". It might add some fancy commands for browsing etc. but
                > it's still just an ssh/scp connection that Vim adds another layer on top
                > of so you can use the netrw commands from within vim.
                >
                > It doesn't open it locally. Any editing you do on the file is being done
                > on the remote file. This can be proven with tcpdump.
                >
                > If you run tcpdump as you're editing the file, you can see the packets
                > traversing the network on port 22 TCP. Every keystroke causes network
                > traffic. Every command (including :w) is being issued to the remote
                > file. The remote file is being edited in place in real time.

                Vim never edits a file in place. It reads the file into memory and edits
                it there. It only writes the file if you tell it to.

                If every keystroke causes network traffic, that network traffic does not
                (with the exception of file saves, maybe) go to the file being edited.
                It may go to the Vim swapfile, if you happen to open it on the remote
                site (which I don't recommend). ":w" without a filename writes the file
                from memory back to where it was read from (i.e., on the remote site).
                With a filename (which may include a path), it writes it to that
                location, and if that location is local, nothing of that write goes over
                the line.

                >
                > netrw will also allow local browsing and editing but that's not what's
                > happening here.
                >
                > I just want a variable I can use to specify the directory the file
                > that's being edited below my home directory is in.
                >
                > Within Vim, if I issue the following command:
                >
                > :echo fnamemodify('.',':p:p')
                >
                > it returns
                >
                > /export/home/badmagic
                >
                > but I can't find an explanation of the '.',':p:p' part.

                one :p is enough, and it's explained under ":help filename-modifiers",
                which is linked from ":help fnamemodify()", the very help for the
                function you used. If youda RTFM youda faunt it.

                >
                > Where can I find a description of all the :p and other variables that
                > represent file names, directories etc?

                In general, in the Vim help. It beats the help for any other program
                I've ever seen the way a royal flush beats a 7-5-4-3-2 polychrome hand
                in poker. If you ask nicely I'll tell you (after I've slept) what
                helptag completion and the :helpgrep command are all about; but by that
                time you ought to have found it without my help.

                >
                >
                > TIA,
                > Steve

                Best regards,
                Tony.
                --
                Lazlo's Chinese Relativity Axiom:
                No matter how great your triumphs or how tragic your defeats --
                approximately one billion Chinese couldn't care less.

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • Matt Wozniski
                ... scp doesn t allow you to open files in place - it allows you to download and upload files, no more. And, the post that you were contesting was written by
                Message 7 of 26 , Oct 3, 2008
                  On Fri, Oct 3, 2008 at 11:40 PM, badmagic <badmagic@...> wrote:
                  >
                  >> Netrw doesn't permit editing directly on the server; it permits editing
                  >> the file on one's local machine.
                  >>
                  >> vim scp://host/path/file
                  >>
                  >> downloads a copy of the file to your local machine, whereupon one may
                  >> inspect and edit it. Then
                  >>
                  >> :w
                  >>
                  >> causes netrw to upload the edited copy. The transfers in this case are
                  >> via scp; one may also use ftp. You could then just write the file
                  >> locally instead: :w localfilename .
                  >>
                  >> Regards,
                  >> Chip Campbell
                  >
                  > Actually, netrw is just a fancy way of saying Vim allows you to use scp
                  > ( part of the ssh tools, port 22 TCP) to open "remote" files on a server
                  > "in their place". It might add some fancy commands for browsing etc. but
                  > it's still just an ssh/scp connection that Vim adds another layer on top
                  > of so you can use the netrw commands from within vim.
                  >
                  > It doesn't open it locally. Any editing you do on the file is being done
                  > on the remote file. This can be proven with tcpdump.

                  scp doesn't allow you to open files in place - it allows you to
                  download and upload files, no more. And, the post that you were
                  contesting was written by the netrw author...

                  ~Matt

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • John Beckett
                  ... That can t be right. Suppose you are sitting at computer Local and are using netrw to edit a file using scp on computer Remote. You are not executing
                  Message 8 of 26 , Oct 3, 2008
                    badmagic wrote:
                    > Actually, netrw is just a fancy way of saying Vim allows you
                    > to use scp ( part of the ssh tools, port 22 TCP) to open
                    > "remote" files on a server "in their place". It might add
                    > some fancy commands for browsing etc. but it's still just an
                    > ssh/scp connection that Vim adds another layer on top of so
                    > you can use the netrw commands from within vim.
                    >
                    > It doesn't open it locally. Any editing you do on the file is
                    > being done on the remote file. This can be proven with tcpdump.

                    That can't be right. Suppose you are sitting at computer Local and are using netrw
                    to edit a file using scp on computer Remote. You are not executing anything on
                    Remote (apart from the ssh daemon that responds to requests to copy a file using
                    scp).

                    You might "ssh to Remote". In that case you WOULD be running Vim on Remote, and you
                    would NOT be using netrw to edit the file via scp. The file you're editing is a
                    local file on Remote.

                    > If you run tcpdump as you're editing the file, you can see
                    > the packets traversing the network on port 22 TCP. Every
                    > keystroke causes network traffic.

                    That sounds like my second scenario where you are not using netrw (unless you are
                    using netrw to access files from Remote).

                    John


                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  • badmagic
                    ... I wasn t contesting or trying to be difficult. I m just trying to make heads and tails out of it and I m not very good at explaining what I mean in writing
                    Message 9 of 26 , Oct 3, 2008
                      > scp doesn't allow you to open files in place - it allows you to
                      > download and upload files, no more. And, the post that you were
                      > contesting was written by the netrw author...
                      >
                      > ~Matt

                      I wasn't contesting or trying to be difficult. I'm just trying to make
                      heads and tails out of it and I'm not very good at explaining what I
                      mean in writing sometimes....


                      Let me try like this:



                      [me@laptop:/etc]$ cd ~

                      [me@laptop:~]$ vi public_html/tcpip/tcpip.html

                      What var will give me ^^^^^^^^^^^^^^^^^^^^^^^^^^^^



                      I must be able to get it because the statusbar in Vim displays this.


                      Thanks for the help
                      Cheers,
                      Steve

                      --~--~---------~--~----~------------~-------~--~----~
                      You received this message from the "vim_use" maillist.
                      For more information, visit http://www.vim.org/maillist.php
                      -~----------~----~----~----~------~----~------~--~---
                    • Gary Johnson
                      ... Your explanation was not difficult to understand--it was wrong. ... The current file name is in the % register. See ... The are various ways to access the
                      Message 10 of 26 , Oct 4, 2008
                        On 2008-10-04, badmagic <badmagic@...> wrote:
                        > > scp doesn't allow you to open files in place - it allows you to
                        > > download and upload files, no more. And, the post that you were
                        > > contesting was written by the netrw author...
                        > >
                        > > ~Matt
                        >
                        > I wasn't contesting or trying to be difficult. I'm just trying to make
                        > heads and tails out of it and I'm not very good at explaining what I
                        > mean in writing sometimes....

                        Your explanation was not difficult to understand--it was wrong.

                        > Let me try like this:
                        >
                        > [me@laptop:/etc]$ cd ~
                        >
                        > [me@laptop:~]$ vi public_html/tcpip/tcpip.html
                        >
                        > What var will give me ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

                        The current file name is in the % register. See

                        :help registers

                        The are various ways to access the contents of registers. For
                        example, you could set the variable x to the contents of the %
                        register with

                        :let x = @%

                        or you could insert the contents of the % register into the command
                        or text you are typing by first hitting Ctrl-R then %. See

                        :help c_CTRL-R
                        :help i_CTRL-R

                        In addition, in certain contexts such as the command line, the %
                        character is replaced by the current file name when the command
                        containing it is executed. See

                        :help :_%

                        You can also use filename modifiers to get the full path name or
                        just components of the current file name as Tony explained. In
                        addition to those references, see

                        :help :_%:

                        So for example, you could put the relative path to the current file
                        into the variable x with the command

                        :let x = expand('%')

                        or put the full path to the current file into the variable x with
                        the command

                        :let x = expand('%:p')

                        If neither one of those is exactly what you want, you could use
                        other filename modifiers to get other forms or parts of the name, or
                        you could use the substitute() function to edit the name. See

                        :help expand()
                        :help substitute()

                        and

                        :help functions

                        for a list of all of vim's built-in functions.

                        > I must be able to get it because the statusbar in Vim displays this.

                        That's not a valid conclusion. That you can see something doesn't
                        necessarily imply that it's accessible by the user.

                        Regards,
                        Gary


                        --~--~---------~--~----~------------~-------~--~----~
                        You received this message from the "vim_use" maillist.
                        For more information, visit http://www.vim.org/maillist.php
                        -~----------~----~----~----~------~----~------~--~---
                      • badmagic
                        I Worked It Out: It s simple and makes sense if you think about it. ... Vim expanded % to path/to/file/file.html which is what I was after in the first
                        Message 11 of 26 , Oct 4, 2008
                          I Worked It Out:

                          It's simple and makes sense if you think about it.

                          I noticed that when I pressed Enter on the following command:

                          :!scp % server:/path/to/file/

                          Vim expanded % to 'path/to/file/file.html'

                          which is what I was after in the first place.



                          So now, if I use the command:

                          :!scp % server:/%

                          Vim expands it to:

                          :!scp path/to/file/file.html webby:/path/to/file/file.html

                          it works. :)


                          All that for something so simple

                          Thank you all for trying to help me.

                          Regards,
                          Steve

                          --
                          Hey! It compiles! Ship it!

                          --~--~---------~--~----~------------~-------~--~----~
                          You received this message from the "vim_use" maillist.
                          For more information, visit http://www.vim.org/maillist.php
                          -~----------~----~----~----~------~----~------~--~---
                        • badmagic
                          ... Hi Antoine, Thanks for the email. Don t know if you saw my last email or not but I figured out how to do it all on my own. As it turned out % was the
                          Message 12 of 26 , Oct 4, 2008
                            Tony Mechelynck wrote:
                            > On 04/10/08 05:40, badmagic wrote:
                            >>> Netrw doesn't permit editing directly on the server; it permits editing
                            >>> the file on one's local machine.
                            >>>
                            >>> vim scp://host/path/file
                            >>>
                            >>> downloads a copy of the file to your local machine, whereupon one may
                            >>> inspect and edit it. Then
                            >>>
                            >>> :w
                            >>>
                            >>> causes netrw to upload the edited copy. The transfers in this case are
                            >>> via scp; one may also use ftp. You could then just write the file
                            >>> locally instead: :w localfilename .
                            >>>
                            >>> Regards,
                            >>> Chip Campbell
                            >>>
                            >>>
                            >>>
                            >> Actually, netrw is just a fancy way of saying Vim allows you to use scp
                            >> ( part of the ssh tools, port 22 TCP) to open "remote" files on a server
                            >> "in their place". It might add some fancy commands for browsing etc. but
                            >> it's still just an ssh/scp connection that Vim adds another layer on top
                            >> of so you can use the netrw commands from within vim.
                            >>
                            >> It doesn't open it locally. Any editing you do on the file is being done
                            >> on the remote file. This can be proven with tcpdump.
                            >>
                            >> If you run tcpdump as you're editing the file, you can see the packets
                            >> traversing the network on port 22 TCP. Every keystroke causes network
                            >> traffic. Every command (including :w) is being issued to the remote
                            >> file. The remote file is being edited in place in real time.
                            >
                            > Vim never edits a file in place. It reads the file into memory and edits
                            > it there. It only writes the file if you tell it to.
                            >
                            > If every keystroke causes network traffic, that network traffic does not
                            > (with the exception of file saves, maybe) go to the file being edited.
                            > It may go to the Vim swapfile, if you happen to open it on the remote
                            > site (which I don't recommend). ":w" without a filename writes the file
                            > from memory back to where it was read from (i.e., on the remote site).
                            > With a filename (which may include a path), it writes it to that
                            > location, and if that location is local, nothing of that write goes over
                            > the line.
                            >
                            >> netrw will also allow local browsing and editing but that's not what's
                            >> happening here.
                            >>
                            >> I just want a variable I can use to specify the directory the file
                            >> that's being edited below my home directory is in.
                            >>
                            >> Within Vim, if I issue the following command:
                            >>
                            >> :echo fnamemodify('.',':p:p')
                            >>
                            >> it returns
                            >>
                            >> /export/home/badmagic
                            >>
                            >> but I can't find an explanation of the '.',':p:p' part.
                            >
                            > one :p is enough, and it's explained under ":help filename-modifiers",
                            > which is linked from ":help fnamemodify()", the very help for the
                            > function you used. If youda RTFM youda faunt it.
                            >
                            >> Where can I find a description of all the :p and other variables that
                            >> represent file names, directories etc?
                            >
                            > In general, in the Vim help. It beats the help for any other program
                            > I've ever seen the way a royal flush beats a 7-5-4-3-2 polychrome hand
                            > in poker. If you ask nicely I'll tell you (after I've slept) what
                            > helptag completion and the :helpgrep command are all about; but by that
                            > time you ought to have found it without my help.
                            >
                            >>
                            >> TIA,
                            >> Steve
                            >
                            > Best regards,
                            > Tony.

                            Hi Antoine,

                            Thanks for the email.

                            Don't know if you saw my last email or not but I figured out how to do
                            it all on my own. As it turned out % was the answer. A simple % and
                            no-one could tell me straight off. (Michael worked it out about an hour
                            after I had already figured it out).

                            Instead, all I got from you was fnamemodify() which I didn't need,
                            filename-modifiers which were useless, the promise of info on helptag
                            (after you'd slept) which I didn't need, a very condescending attitude
                            which I didn't appreciate ("If you ask nicely I'll tell you (after I've
                            slept)") and told to read the F'ing manual ("If youda RTFM youda faunt
                            it.") which I did and it didn't help because you sent me on a wild goose
                            chase reading irrelevant stuff I didn't need.

                            % expands out to subdir/to/file.html

                            pure and simple

                            Sometimes it's alright to just say, "I don't know!"


                            I do appreciate you taking the time to help me but sometimes, it doesn't
                            pay to be too full of yourself, especially when you're wrong and don't
                            know the right answer.

                            Regards,
                            Steve


                            --~--~---------~--~----~------------~-------~--~----~
                            You received this message from the "vim_use" maillist.
                            For more information, visit http://www.vim.org/maillist.php
                            -~----------~----~----~----~------~----~------~--~---
                          • Agathoklis D. Hatzimanikas
                            ... But % expands to the current file name, and you ve asked about the current working directory. ... And excuse my interference, but Tony knows (extremely)
                            Message 13 of 26 , Oct 4, 2008
                              On Sun, Oct 05, at 05:01 badmagic wrote:
                              >
                              >
                              > Don't know if you saw my last email or not but I figured out how to do
                              > it all on my own. As it turned out % was the answer. A simple % and
                              > no-one could tell me straight off. (Michael worked it out about an hour
                              > after I had already figured it out).
                              >
                              > Instead, all I got from you was fnamemodify() which I didn't need,
                              > filename-modifiers which were useless, the promise of info on helptag
                              > (after you'd slept) which I didn't need, a very condescending attitude
                              > which I didn't appreciate ("If you ask nicely I'll tell you (after I've
                              > slept)") and told to read the F'ing manual ("If youda RTFM youda faunt
                              > it.") which I did and it didn't help because you sent me on a wild goose
                              > chase reading irrelevant stuff I didn't need.
                              >
                              > % expands out to subdir/to/file.html
                              >

                              But "%" expands to the current file name, and you've asked about the
                              current working directory.

                              > pure and simple
                              >
                              > Sometimes it's alright to just say, "I don't know!"
                              >
                              > I do appreciate you taking the time to help me but sometimes, it doesn't
                              > pay to be too full of yourself, especially when you're wrong and don't
                              > know the right answer.

                              And excuse my interference, but Tony knows (extremely) well about the
                              subject, see:

                              echo expand("%") --> eval.txt
                              echo expand("%:p") --> /usr/share/vim/vim72/doc/eval.txt
                              echo expand('%:r') --> eval
                              echo expand('%:e') --> txt
                              echo expand("%:p:h") --> /usr/share/vim/vim72/doc
                              echo fnamemodify("%", ":p:h") --> /usr/share/vim/vim72/doc
                              echo fnamemodify('%', ':p:h:t') --> doc
                              ...

                              see for reference:

                              :help expand()
                              :help filename-modifiers
                              :help fnamemodify()

                              As a plus, please also have a look to:

                              :help getcwd()
                              :help 'autochdir'

                              >
                              > Regards,
                              > Steve

                              Regards,
                              Ag.


                              --~--~---------~--~----~------------~-------~--~----~
                              You received this message from the "vim_use" maillist.
                              For more information, visit http://www.vim.org/maillist.php
                              -~----------~----~----~----~------~----~------~--~---
                            • Tony Mechelynck
                              ... Well, sorry if I misunderstood you, but please note the following: 1) % means the current file, the way it appears on the status line; however in your
                              Message 14 of 26 , Oct 4, 2008
                                On 04/10/08 20:01, badmagic wrote:
                                > Tony Mechelynck wrote:
                                >> On 04/10/08 05:40, badmagic wrote:
                                >>>> Netrw doesn't permit editing directly on the server; it permits editing
                                >>>> the file on one's local machine.
                                >>>>
                                >>>> vim scp://host/path/file
                                >>>>
                                >>>> downloads a copy of the file to your local machine, whereupon one may
                                >>>> inspect and edit it. Then
                                >>>>
                                >>>> :w
                                >>>>
                                >>>> causes netrw to upload the edited copy. The transfers in this case are
                                >>>> via scp; one may also use ftp. You could then just write the file
                                >>>> locally instead: :w localfilename .
                                >>>>
                                >>>> Regards,
                                >>>> Chip Campbell
                                >>>>
                                >>>>
                                >>>>
                                >>> Actually, netrw is just a fancy way of saying Vim allows you to use scp
                                >>> ( part of the ssh tools, port 22 TCP) to open "remote" files on a server
                                >>> "in their place". It might add some fancy commands for browsing etc. but
                                >>> it's still just an ssh/scp connection that Vim adds another layer on top
                                >>> of so you can use the netrw commands from within vim.
                                >>>
                                >>> It doesn't open it locally. Any editing you do on the file is being done
                                >>> on the remote file. This can be proven with tcpdump.
                                >>>
                                >>> If you run tcpdump as you're editing the file, you can see the packets
                                >>> traversing the network on port 22 TCP. Every keystroke causes network
                                >>> traffic. Every command (including :w) is being issued to the remote
                                >>> file. The remote file is being edited in place in real time.
                                >>
                                >> Vim never edits a file in place. It reads the file into memory and
                                >> edits it there. It only writes the file if you tell it to.
                                >>
                                >> If every keystroke causes network traffic, that network traffic does
                                >> not (with the exception of file saves, maybe) go to the file being
                                >> edited. It may go to the Vim swapfile, if you happen to open it on the
                                >> remote site (which I don't recommend). ":w" without a filename writes
                                >> the file from memory back to where it was read from (i.e., on the
                                >> remote site). With a filename (which may include a path), it writes it
                                >> to that location, and if that location is local, nothing of that write
                                >> goes over the line.
                                >>
                                >>> netrw will also allow local browsing and editing but that's not what's
                                >>> happening here.
                                >>>
                                >>> I just want a variable I can use to specify the directory the file
                                >>> that's being edited below my home directory is in.
                                >>>
                                >>> Within Vim, if I issue the following command:
                                >>>
                                >>> :echo fnamemodify('.',':p:p')
                                >>>
                                >>> it returns
                                >>>
                                >>> /export/home/badmagic
                                >>>
                                >>> but I can't find an explanation of the '.',':p:p' part.
                                >>
                                >> one :p is enough, and it's explained under ":help filename-modifiers",
                                >> which is linked from ":help fnamemodify()", the very help for the
                                >> function you used. If youda RTFM youda faunt it.
                                >>
                                >>> Where can I find a description of all the :p and other variables that
                                >>> represent file names, directories etc?
                                >>
                                >> In general, in the Vim help. It beats the help for any other program
                                >> I've ever seen the way a royal flush beats a 7-5-4-3-2 polychrome hand
                                >> in poker. If you ask nicely I'll tell you (after I've slept) what
                                >> helptag completion and the :helpgrep command are all about; but by
                                >> that time you ought to have found it without my help.
                                >>
                                >>>
                                >>> TIA,
                                >>> Steve
                                >>
                                >> Best regards,
                                >> Tony.
                                >
                                > Hi Antoine,
                                >
                                > Thanks for the email.
                                >
                                > Don't know if you saw my last email or not but I figured out how to do
                                > it all on my own. As it turned out % was the answer. A simple % and
                                > no-one could tell me straight off. (Michael worked it out about an hour
                                > after I had already figured it out).
                                >
                                > Instead, all I got from you was fnamemodify() which I didn't need,
                                > filename-modifiers which were useless, the promise of info on helptag
                                > (after you'd slept) which I didn't need, a very condescending attitude
                                > which I didn't appreciate ("If you ask nicely I'll tell you (after I've
                                > slept)") and told to read the F'ing manual ("If youda RTFM youda faunt
                                > it.") which I did and it didn't help because you sent me on a wild goose
                                > chase reading irrelevant stuff I didn't need.
                                >
                                > % expands out to subdir/to/file.html
                                >
                                > pure and simple
                                >
                                > Sometimes it's alright to just say, "I don't know!"
                                >
                                >
                                > I do appreciate you taking the time to help me but sometimes, it doesn't
                                > pay to be too full of yourself, especially when you're wrong and don't
                                > know the right answer.
                                >
                                > Regards,
                                > Steve
                                >
                                >

                                Well, sorry if I misunderstood you, but please note the following:

                                1) % means the current file, the way it appears on the status line;
                                however in your Subject you asked for the current directory, which is
                                quite a different thing, and usually not even the directory of the
                                current file.

                                2) How could I know that telling you where to find what :p meant would
                                be "sending you on a wild goose chase" when you yourself _asked_ for it?
                                As for my "condescending" tone, it might have been less so if your own
                                post hadn't made it obvious that you had not even looked up the help for
                                the function where that :p was used.

                                3) About mentioning ways to search the help: you yourself seemed to
                                indicate that using the Vim help was foreign to your thinking. Sorry if
                                I misunderstood. "After I slept" was pure truth: it was 6 AM at my place
                                when I wrote that mail, and I hadn't yet gone to bed.

                                I think I would have run less chance of sending you on a wild goose
                                chase if _you_ hadn't sent _us_ on a wild goose chase to begin with.

                                Regards,
                                Tony.
                                --
                                Flugg's Law:
                                When you need to knock on wood is when you realize that the
                                world is composed of vinyl, naugahyde and aluminum.

                                --~--~---------~--~----~------------~-------~--~----~
                                You received this message from the "vim_use" maillist.
                                For more information, visit http://www.vim.org/maillist.php
                                -~----------~----~----~----~------~----~------~--~---
                              • bill lam
                                ... Hi Steve, I know how bad it was when told to rtfm but I, and most of list members, can assure that tony is a good guy. You can browse mail achieve to see
                                Message 15 of 26 , Oct 4, 2008
                                  On Sun, 05 Oct 2008, badmagic wrote:
                                  > Hi Antoine,
                                  >
                                  > Thanks for the email.
                                  >
                                  > Don't know if you saw my last email or not but I figured out how to do
                                  > it all on my own. As it turned out % was the answer. A simple % and
                                  > no-one could tell me straight off. (Michael worked it out about an hour
                                  > after I had already figured it out).
                                  >
                                  > Instead, all I got from you was fnamemodify() which I didn't need,
                                  > filename-modifiers which were useless, the promise of info on helptag
                                  > (after you'd slept) which I didn't need, a very condescending attitude
                                  > which I didn't appreciate ("If you ask nicely I'll tell you (after I've
                                  > slept)") and told to read the F'ing manual ("If youda RTFM youda faunt
                                  > it.") which I did and it didn't help because you sent me on a wild goose
                                  > chase reading irrelevant stuff I didn't need.
                                  >
                                  > % expands out to subdir/to/file.html
                                  >
                                  > pure and simple
                                  >
                                  > Sometimes it's alright to just say, "I don't know!"
                                  >
                                  >
                                  > I do appreciate you taking the time to help me but sometimes, it doesn't
                                  > pay to be too full of yourself, especially when you're wrong and don't
                                  > know the right answer.
                                  >
                                  > Regards,
                                  > Steve

                                  Hi Steve,
                                  I know how bad it was when told to rtfm but I, and most of list
                                  members, can assure that tony is a good guy. You can browse mail
                                  achieve to see that tony answers questions in great detail no matter
                                  how basic or trivial the question is. He usually answer exactly what
                                  you look for and then show where the answer can be found inside the
                                  help manual (rtfm). For particular instance you quoted
                                  > % expands out to subdir/to/file.html
                                  > pure and simple

                                  It depends on context, and may fails eg,
                                  :echo %

                                  is erroneous because % is not a literal or variable that evaluated to
                                  a literal. I believe tony meant to be humorous to you. No hard
                                  feeling, In fact tony is one of the most helpful persons in mailing
                                  lists that I visited.

                                  Also, if you could change the name inside email address from "badmagic" to a human
                                  name...

                                  --
                                  regards,
                                  ====================================================
                                  GPG key 1024D/4434BAB3 2008-08-24
                                  gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

                                  --~--~---------~--~----~------------~-------~--~----~
                                  You received this message from the "vim_use" maillist.
                                  For more information, visit http://www.vim.org/maillist.php
                                  -~----------~----~----~----~------~----~------~--~---
                                • badmagic
                                  Hi Tony (et al) Don t worry about it. It was a misunderstanding. You d been up until 6AM?! I don t think I d even be able to type at 6am let alone think about
                                  Message 16 of 26 , Oct 4, 2008
                                    Hi Tony (et al)

                                    Don't worry about it. It was a misunderstanding.

                                    You'd been up until 6AM?! I don't think I'd even be able to type at 6am
                                    let alone think about this kind of stuff.

                                    I do appreciate this list as I mentioned before. It's help me several
                                    times in the past when there's been no answer to be found in the Internet.


                                    In one email, I mentioned that I don't always explain myself well and
                                    Gary told me "Your explanation was not difficult to understand" so I
                                    think we'll just put it down to a communications mix-up.


                                    I know % == filename (without the directory part) but not apparently if
                                    you're sitting in your home directory editing a file a couple of dirs
                                    below.

                                    If you start vim with a filename that includes a path component, Vim
                                    includes that path in the filename represented by %.

                                    I know that's not what people believe, but I tell you, I'm watching it
                                    happen with my own eyes.

                                    ----------------------

                                    I start vim like:
                                    ~ vi public_html/tcpip/tcpip.html // and edit the file


                                    Then, I issue the following command:
                                    :!scp % vint:/%

                                    After I press Enter, for about a second, Vim expands the expression to:

                                    :!scp public_html/tcpip/tcpip.html vint:/public_html/tcpip/tcpip.html

                                    (I copied the above line straight out of Vim after it expanded the %.


                                    Anyway, it's working and it's putting the files where they need to go on
                                    the server. That's all I really care about.

                                    Now I don't have to type the whole path on the server. Because the local
                                    path and the directory structure on the server match, I can just use %
                                    and Vim types (sorry, expands) it all out for me. I can use the same
                                    command from history regardless of which dir the file is in or how many
                                    levels down it is.



                                    Once again Tony, I do really appreciate you taking the time to help me
                                    and now I know you were up until 6am, I appreciate your time even more
                                    and I'm sorry about what happened.

                                    Cheers,
                                    Steve

                                    PS

                                    You should get some more sleep. We need it. :)





                                    --~--~---------~--~----~------------~-------~--~----~
                                    You received this message from the "vim_use" maillist.
                                    For more information, visit http://www.vim.org/maillist.php
                                    -~----------~----~----~----~------~----~------~--~---
                                  • Raúl Núñez de Arenas Coronado
                                    Saluton badmagic :) ... You know the problem with this list: it s a bunch of eejits that don t know that your particular problem is a matter of % . BTW, since
                                    Message 17 of 26 , Oct 5, 2008
                                      Saluton badmagic :)

                                      On Sun, 05 Oct 2008 05:01:01 +1100, badmagic dixit:
                                      > Don't know if you saw my last email or not but I figured out how to
                                      > do it all on my own. As it turned out % was the answer. A simple %
                                      > and no-one could tell me straight off. (Michael worked it out about
                                      > an hour after I had already figured it out).

                                      You know the problem with this list: it's a bunch of eejits that don't
                                      know that your particular problem is a matter of "%".

                                      BTW, since you seem to do very good on your own, next time don't bother
                                      the list with questions, please. You won't get any useful answer anyway,
                                      since Tony is stupid!

                                      > Instead, all I got from you was fnamemodify() which I didn't need,
                                      > filename-modifiers which were useless,

                                      Oh, my, Tony is a very stupid guy!

                                      > the promise of info on helptag (after you'd slept)

                                      Heck! He even dare to sleep!

                                      > which I didn't need, a very condescending attitude which I didn't
                                      > appreciate ("If you ask nicely I'll tell you (after I've slept)")

                                      Mmm, but that's not fair. It's like if I consider you what in Spain we
                                      call "un chulo de merendero" (sorry, I don't know how to translate that,
                                      because I'm very stupid too (otherwise I won't be on this list)), just
                                      because you can't pick the tone in Tony messages. That wouldn't be fair,
                                      either.

                                      > and told to read the F'ing manual ("If youda RTFM youda faunt it.")

                                      Reading manuals is for morons. Real men don't read.

                                      > which I did and it didn't help because you sent me on a wild goose
                                      > chase reading irrelevant stuff I didn't need.

                                      Again, how stupid can be Tony!

                                      > I do appreciate you taking the time to help me but sometimes, it
                                      > doesn't pay to be too full of yourself, especially when you're wrong
                                      > and don't know the right answer.

                                      Great... Really, Tony is STUPID, written in capitals. Otherwise he won't
                                      be wasting his time trying to help people like you. But, you know, he is
                                      like that: helping people now and again, not waiting even for a simple
                                      "thank you". And then comes someone that misinterprets the tone in a
                                      message and thinks that if an answer you get for free is not 100%
                                      correct, then the "answerer" is full of himself. Well, I just hope Tony
                                      will keep on being stupid and helping a lot. We cannot simply afford he
                                      not being on the list giving clever advice and working solutions (and
                                      yes, he is human and sometimes gives potential solutions that don't fit
                                      your problem).

                                      Raúl "DervishD" Núñez de Arenas Coronado
                                      --
                                      Linux Registered User 88736 | http://www.dervishd.net
                                      It's my PC and I'll cry if I want to... RAmen!
                                      We are waiting for 13 Feb 2009 23:31:30 +0000 ...

                                      --~--~---------~--~----~------------~-------~--~----~
                                      You received this message from the "vim_use" maillist.
                                      For more information, visit http://www.vim.org/maillist.php
                                      -~----------~----~----~----~------~----~------~--~---
                                    • Steve Laurie
                                      Raúl, ... Mate, If you ve read my last email, I apologised to Tony. I wasn t rude. I thought Tony was being rude to me and I simply stated that I wasn t happy
                                      Message 18 of 26 , Oct 5, 2008
                                        Raúl,


                                        Raúl Núñez de Arenas Coronado wrote:
                                        > Saluton badmagic :)
                                        >

                                        > You know the problem with this list: it's a bunch of eejits that don't
                                        > know that your particular problem is a matter of "%".

                                        Mate,

                                        If you've read my last email, I apologised to Tony. I wasn't rude. I
                                        thought Tony was being rude to me and I simply stated that I wasn't
                                        happy about being spoken to like that. I later realised that I had
                                        misunderstood his attitude, admitted I was wrong and apologised.


                                        > BTW, since you seem to do very good on your own, next time don't bother
                                        > the list with questions, please. You won't get any useful answer anyway,
                                        > since Tony is stupid!


                                        I've been heavily into computers since 1978 when I started writing
                                        Assembly for the Z80. I'm completely self taught. When I started in
                                        computers, there was no Internet. Vinton Cerf and Bob Kahn had just
                                        split TCP into TCP and IP.

                                        In that time, I've learnt many computer languages (including FORTRAN,
                                        COBOL and LISP). I now do socket programming under SunOS/Solaris and BSD
                                        using the Berkeley Sockets API in C/C++ and Java and I also do WinSock
                                        programming for Windows using C++ and VB. I've also been building and
                                        repairing computers since the XTs came on the market. I've had more
                                        computer problems in that time than you've had hot dinners and the
                                        majority of them, I've had to solve myself since there was no Internet
                                        and nobody around to ask.

                                        I've only been using Vim for around 4 years (ex Emacs user) and I can
                                        get around in Vim quite well but every now and again, a simple one will
                                        catch me out and it's nice to know there are nice people out there like
                                        Tony who are willing to lend a hand for nothing. I also help people for
                                        nothing and I would be quite upset if someone was rude to me without
                                        provocation. It was just a misunderstanding.


                                        > Oh, my, Tony is a very stupid guy!
                                        >
                                        Them's fightin' words!

                                        Once again, I never said Tony was stupid. Not even Tony himself has
                                        responded agressively towards me. Why have you taken it upon yourself to
                                        attack me? I don't need you sticking your nose in where it doesn't
                                        concern you if you're going to be rude and aggressive towards me.


                                        >> the promise of info on helptag (after you'd slept)
                                        >
                                        > Heck! He even dare to sleep!

                                        It wasn't the sleeping I objected to. It was that I thought he was being
                                        condescending but have since found out I was wrong and apologised.


                                        I think you're one of these people who sees a situation where there's an
                                        opportunity to be rude and aggressive, even if it's none of your
                                        business and you stick your nose in where it's not needed.
                                        >
                                        > Raúl "DervishD" Núñez de Arenas Coronado

                                        thanks,
                                        Steve

                                        --~--~---------~--~----~------------~-------~--~----~
                                        You received this message from the "vim_use" maillist.
                                        For more information, visit http://www.vim.org/maillist.php
                                        -~----------~----~----~----~------~----~------~--~---
                                      • Tony Mechelynck
                                        ... [...] ... I started in 1969 after I decided 5 years or more of university courses weren t for me. ... I m self-taught too. A little FORTRAN and BASIC while
                                        Message 19 of 26 , Oct 5, 2008
                                          On 05/10/08 12:48, Steve Laurie wrote:
                                          > Raúl,
                                          [...]
                                          > I've been heavily into computers since 1978 when I started writing
                                          > Assembly for the Z80. I'm completely self taught. When I started in
                                          > computers, there was no Internet. Vinton Cerf and Bob Kahn had just
                                          > split TCP into TCP and IP.

                                          I started in 1969 after I decided 5 years or more of university courses
                                          weren't for me.

                                          >
                                          > In that time, I've learnt many computer languages (including FORTRAN,
                                          > COBOL and LISP). I now do socket programming under SunOS/Solaris and BSD
                                          > using the Berkeley Sockets API in C/C++ and Java and I also do WinSock
                                          > programming for Windows using C++ and VB. I've also been building and
                                          > repairing computers since the XTs came on the market. I've had more
                                          > computer problems in that time than you've had hot dinners and the
                                          > majority of them, I've had to solve myself since there was no Internet
                                          > and nobody around to ask.

                                          I'm self-taught too. A little FORTRAN and BASIC while still in college,
                                          then I found, in the Univerity bookshop, the wonderful books of David
                                          McCracken about ALGOL, COBOL, FORTRAN and others. Read them like novels.
                                          There weren't any programming schools at the time so I didn't have too
                                          much problems getting into a programming servicebureau. Mostly COBOL but
                                          while my programs were compiling I read the manuals for the machine's
                                          assembly language. After a few years I was the one coming in weekends to
                                          do what would nowadays be called compiling kernels (and also the rest of
                                          the software) not only for day-to-day use on our machine but also for
                                          use when it broke down and we had to rent time in Paris, London or
                                          Manchester -- nothing nearer which had at least 128K of core memory,
                                          enough tapes and disks, and a processor supporting hardware protection
                                          and relocation. (The memory speed was 667 kHz which was quite fast.)
                                          Maybe I should have stayed in the computer business. Later I thought I
                                          could use some more education -- and suddenly one day I found out that
                                          jobs like the one I'd held weren't available anymore unless you were
                                          both under 35 years and the holder of a Computer Science degree (what's
                                          the equivalent "current" idiom? BSc in computer science I guess), and I
                                          fulfilled neither condition. So I helped a friend do translations on an
                                          8086 running Dos 2...

                                          >
                                          > I've only been using Vim for around 4 years (ex Emacs user) and I can
                                          > get around in Vim quite well but every now and again, a simple one will
                                          > catch me out

                                          I've been using Vim since -- when was it? I'm losing track of time but I
                                          think it was when the current version was 6.1 or maybe 6.2. The single
                                          thing which caught my attention was the outstanding documentation --
                                          really far ahead of every other program's IMHO. Since then I've been
                                          reading it, sometimes even by the MonteCarlo method. It even has (and
                                          needs) several tools to overcome the needle-and-haystack effect.

                                          > and it's nice to know there are nice people out there like
                                          > Tony who are willing to lend a hand for nothing. I also help people for
                                          > nothing and I would be quite upset if someone was rude to me without
                                          > provocation. It was just a misunderstanding.

                                          OK, let's drop it. I guess I should have used an emoticon or two.

                                          >
                                          >
                                          >> Oh, my, Tony is a very stupid guy!
                                          >>
                                          > Them's fightin' words!
                                          >
                                          > Once again, I never said Tony was stupid. Not even Tony himself has
                                          > responded agressively towards me. Why have you taken it upon yourself to
                                          > attack me? I don't need you sticking your nose in where it doesn't
                                          > concern you if you're going to be rude and aggressive towards me.
                                          [...]

                                          Please, Steve, drop it. Raúl thought you were attacking me groundlessly
                                          and he jumped to my defense with a bit of his own kind of irony.


                                          Best regards,
                                          Tony.
                                          --
                                          I think pop music has done more for oral intercourse than anything else
                                          that has ever happened, and vice versa.
                                          -- Frank Zappa

                                          --~--~---------~--~----~------------~-------~--~----~
                                          You received this message from the "vim_use" maillist.
                                          For more information, visit http://www.vim.org/maillist.php
                                          -~----------~----~----~----~------~----~------~--~---
                                        • Richard Hartmann
                                          On Sun, Oct 5, 2008 at 13:47, Tony Mechelynck ... Indeed. From my outsider s POV, I would say that more than one person did not act ideally and it is a
                                          Message 20 of 26 , Oct 5, 2008
                                            On Sun, Oct 5, 2008 at 13:47, Tony Mechelynck
                                            <antoine.mechelynck@...> wrote:

                                            > Please [...] drop it.

                                            Indeed. From my outsider's POV, I would say that more than one person
                                            did not act ideally and it is a misunderstanding becoming a _lot_ more
                                            than it should reasonably be.

                                            As I am an outsider to this particular thread, I will take up the arbiter's
                                            role. Thus, I would ask all involved to simply stop replying to anything
                                            in this thread (unless it is along the lines of "i agree, let's stop this &
                                            hug").

                                            I know that, sometimes, one wants to add just a tiny bit of justification
                                            or something after such a break. Believe me, no one will think worse
                                            of anyone involved for simply stopping here.


                                            Now, let's group hug :)
                                            Richard

                                            --~--~---------~--~----~------------~-------~--~----~
                                            You received this message from the "vim_use" maillist.
                                            For more information, visit http://www.vim.org/maillist.php
                                            -~----------~----~----~----~------~----~------~--~---
                                          • Steve Laurie
                                            ... --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more information, visit
                                            Message 21 of 26 , Oct 5, 2008
                                              Richard Hartmann wrote:
                                              > On Sun, Oct 5, 2008 at 13:47, Tony Mechelynck
                                              > <antoine.mechelynck@...> wrote:
                                              >
                                              >> Please [...] drop it.
                                              >
                                              > Indeed. From my outsider's POV, I would say that more than one person
                                              > did not act ideally and it is a misunderstanding becoming a _lot_ more
                                              > than it should reasonably be.
                                              >
                                              > As I am an outsider to this particular thread, I will take up the arbiter's
                                              > role. Thus, I would ask all involved to simply stop replying to anything
                                              > in this thread (unless it is along the lines of "i agree, let's stop this &
                                              > hug").
                                              >
                                              > I know that, sometimes, one wants to add just a tiny bit of justification
                                              > or something after such a break. Believe me, no one will think worse
                                              > of anyone involved for simply stopping here.
                                              >
                                              >
                                              > Now, let's group hug :)
                                              > Richard
                                              >
                                              > I'm all for a group hug :)


                                              --~--~---------~--~----~------------~-------~--~----~
                                              You received this message from the "vim_use" maillist.
                                              For more information, visit http://www.vim.org/maillist.php
                                              -~----------~----~----~----~------~----~------~--~---
                                            • Teemu Likonen
                                              ... --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more information, visit
                                              Message 22 of 26 , Oct 6, 2008
                                                Tony Mechelynck <antoine.mechelynck@...>2008-10-05 01:21 +0300> On 04/10/08 20:01, badmagic wrote:
                                                >> Tony Mechelynck wrote:
                                                >>> On 04/10/08 05:40, badmagic wrote:
                                                >>>>> Netrw doesn't permit editing directly on the server; it permits editing
                                                >>>>> the file on one's local machine.
                                                >>>>>
                                                >>>>> vim scp://host/path/file
                                                >>>>>
                                                >>>>> downloads a copy of the file to your local machine, whereupon one may
                                                >>>>> inspect and edit it. Then
                                                >>>>>
                                                >>>>> :w
                                                >>>>>
                                                >>>>> causes netrw to upload the edited copy. The transfers in this case are
                                                >>>>> via scp; one may also use ftp. You could then just write the file
                                                >>>>> locally instead: :w localfilename .
                                                >>>>>
                                                >>>>> Regards,
                                                >>>>> Chip Campbell
                                                >>>>>
                                                >>>>>
                                                >>>>>
                                                >>>> Actually, netrw is just a fancy way of saying Vim allows you to use scp
                                                >>>> ( part of the ssh tools, port 22 TCP) to open "remote" files on a server
                                                >>>> "in their place". It might add some fancy commands for browsing etc. but
                                                >>>> it's still just an ssh/scp connection that Vim adds another layer on top
                                                >>>> of so you can use the netrw commands from within vim.
                                                >>>>
                                                >>>> It doesn't open it locally. Any editing you do on the file is being done
                                                >>>> on the remote file. This can be proven with tcpdump.
                                                >>>>
                                                >>>> If you run tcpdump as you're editing the file, you can see the packets
                                                >>>> traversing the network on port 22 TCP. Every keystroke causes network
                                                >>>> traffic. Every command (including :w) is being issued to the remote
                                                >>>> file. The remote file is being edited in place in real time.
                                                >>>
                                                >>> Vim never edits a file in place. It reads the file into memory and
                                                >>> edits it there. It only writes the file if you tell it to.
                                                >>>
                                                >>> If every keystroke causes network traffic, that network traffic does
                                                >>> not (with the exception of file saves, maybe) go to the file being
                                                >>> edited. It may go to the Vim swapfile, if you happen to open it on the
                                                >>> remote site (which I don't recommend). ":w" without a filename writes
                                                >>> the file from memory back to where it was read from (i.e., on the
                                                >>> remote site). With a filename (which may include a path), it writes it
                                                >>> to that location, and if that location is local, nothing of that write
                                                >>> goes over the line.
                                                >>>
                                                >>>> netrw will also allow local browsing and editing but that's not what's
                                                >>>> happening here.
                                                >>>>
                                                >>>> I just want a variable I can use to specify the directory the file
                                                >>>> that's being edited below my home directory is in.
                                                >>>>
                                                >>>> Within Vim, if I issue the following command:
                                                >>>>
                                                >>>> :echo fnamemodify('.',':p:p')
                                                >>>>
                                                >>>> it returns
                                                >>>>
                                                >>>> /export/home/badmagic
                                                >>>>
                                                >>>> but I can't find an explanation of the '.',':p:p' part.
                                                >>>
                                                >>> one :p is enough, and it's explained under ":help filename-modifiers",
                                                >>> which is linked from ":help fnamemodify()", the very help for the
                                                >>> function you used. If youda RTFM youda faunt it.
                                                >>>
                                                >>>> Where can I find a description of all the :p and other variables that
                                                >>>> represent file names, directories etc?
                                                >>>
                                                >>> In general, in the Vim help. It beats the help for any other program
                                                >>> I've ever seen the way a royal flush beats a 7-5-4-3-2 polychrome hand
                                                >>> in poker. If you ask nicely I'll tell you (after I've slept) what
                                                >>> helptag completion and the :helpgrep command are all about; but by
                                                >>> that time you ought to have found it without my help.
                                                >>>
                                                >>>>
                                                >>>> TIA,
                                                >>>> Steve
                                                >>>
                                                >>> Best regards,
                                                >>> Tony.
                                                >>
                                                >> Hi Antoine,
                                                >>
                                                >> Thanks for the email.
                                                >>
                                                >> Don't know if you saw my last email or not but I figured out how to do
                                                >> it all on my own. As it turned out % was the answer. A simple % and
                                                >> no-one could tell me straight off. (Michael worked it out about an hour
                                                >> after I had already figured it out).
                                                >>
                                                >> Instead, all I got from you was fnamemodify() which I didn't need,
                                                >> filename-modifiers which were useless, the promise of info on helptag
                                                >> (after you'd slept) which I didn't need, a very condescending attitude
                                                >> which I didn't appreciate ("If you ask nicely I'll tell you (after I've
                                                >> slept)") and told to read the F'ing manual ("If youda RTFM youda faunt
                                                >> it.") which I did and it didn't help because you sent me on a wild goose
                                                >> chase reading irrelevant stuff I didn't need.
                                                >>
                                                >> % expands out to subdir/to/file.html
                                                >>
                                                >> pure and simple
                                                >>
                                                >> Sometimes it's alright to just say, "I don't know!"
                                                >>
                                                >>
                                                >> I do appreciate you taking the time to help me but sometimes, it doesn't
                                                >> pay to be too full of yourself, especially when you're wrong and don't
                                                >> know the right answer.
                                                >>
                                                >> Regards,
                                                >> Steve
                                                >>
                                                >>
                                                >
                                                > Well, sorry if I misunderstood you, but please note the following:
                                                >
                                                > 1) % means the current file, the way it appears on the status line;
                                                > however in your Subject you asked for the current directory, which is
                                                > quite a different thing, and usually not even the directory of the
                                                > current file.
                                                >
                                                > 2) How could I know that telling you where to find what :p meant would
                                                > be "sending you on a wild goose chase" when you yourself _asked_ for it?
                                                > As for my "condescending" tone, it might have been less so if your own
                                                > post hadn't made it obvious that you had not even looked up the help for
                                                > the function where that :p was used.
                                                >
                                                > 3) About mentioning ways to search the help: you yourself seemed to
                                                > indicate that using the Vim help was foreign to your thinking. Sorry if
                                                > I misunderstood. "After I slept" was pure truth: it was 6 AM at my place
                                                > when I wrote that mail, and I hadn't yet gone to bed.
                                                >
                                                > I think I would have run less chance of sending you on a wild goose
                                                > chase if _you_ hadn't sent _us_ on a wild goose chase to begin with.
                                                >
                                                > Regards,
                                                > Tony.
                                                > --
                                                > Flugg's Law:
                                                > When you need to knock on wood is when you realize that the
                                                > world is composed of vinyl, naugahyde and aluminum.
                                                >
                                                >

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