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

PWD?

Expand Messages
  • Robert Link
    ... Hash: SHA1 How can I open a file from the command line without typing the entire path name? I m using vimppc 5.7.9 on a revC iMac, sys8.5.1. If there s a
    Message 1 of 11 , Aug 17, 2000
    • 0 Attachment
      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      How can I open a file from the command line without typing the entire
      path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If
      there's a good faq for this kind of thing, feel free to point me to
      it. Thanks!
      - --
      Robert Link

      -----BEGIN PGP SIGNATURE-----
      Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com>

      iQA/AwUBOZvke4HvG1x/HQ+LEQK+NACg65G9YTxgYkWhF1YCfAgczTgWvPEAoOb2
      HdHjzRCUEht5Gm9fxsuUXdns
      =46HE
      -----END PGP SIGNATURE-----
    • Benji Fisher
      ... Is this a vim question or a Mac question? I do not know what revC means, and (perhaps related) I have never seen a command line on a Mac. I do have a
      Message 2 of 11 , Aug 17, 2000
      • 0 Attachment
        Robert Link wrote:
        >
        > -----BEGIN PGP SIGNED MESSAGE-----
        > Hash: SHA1
        >
        > How can I open a file from the command line without typing the entire
        > path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If
        > there's a good faq for this kind of thing, feel free to point me to
        > it. Thanks!
        > - --
        > Robert Link

        Is this a vim question or a Mac question? I do not know what
        "revC" means, and (perhaps related) I have never seen a command line on
        a Mac. I do have a utility for starting programs from the keyboard;
        once vim is running, I can use :cd or :find or ...

        HTH --Benji Fisher
      • Eugene Lee
        ... revC is his shorthand to indicate the hardware revision C iMacs. However, it doesn t matter what Mac he s using. And it really doesn t matter what MacOS
        Message 3 of 11 , Aug 17, 2000
        • 0 Attachment
          On Thu, Aug 17, 2000 at 09:24:18PM -0400, Benji Fisher wrote:
          :
          : Robert Link wrote:
          : >
          : > How can I open a file from the command line without typing the entire
          : > path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If
          : > there's a good faq for this kind of thing, feel free to point me to
          : > it. Thanks!
          :
          : Is this a vim question or a Mac question? I do not know what
          : "revC" means,

          "revC" is his shorthand to indicate the hardware revision C iMacs.
          However, it doesn't matter what Mac he's using. And it really doesn't
          matter what MacOS version he's using, either.

          : and (perhaps related) I have never seen a command line on
          : a Mac. I do have a utility for starting programs from the keyboard;
          : once vim is running, I can use :cd or :find or ...

          Command lines don't exist on a regular Mac system. I've played with a
          Tcl shell from the Mac Tcl/Tk distribution that offers a few functions
          for a very *very* basic shell, but nothing like a modern Unix shell.

          To answer the original question, there isn't a way to. Unless you
          customize Vim to put you in a specific folder when it's started, you
          normally are stuck in the same folder as the VimPPC app itself. Now
          there is a built-in filename completion feature that uses the TAB key,
          but it doesn't seem to work terribly well (at least for me) if your
          pathname starts with a Mac volume.

          Now if you wanna open a text file with Vim whose file creator isn't set
          to "VIM!", the easiest thing to do is to drag your text file onto the
          VimPPC icon directly, or indirectly on an alias or a launcher app.


          --
          Eugene Lee
          eugene@...
        • Nils Kassube
          ... You can :cd to your work directory, e.g. ... File name completion via Tab works fine for me, at least in the current directory. Cheers, Nils --
          Message 4 of 11 , Aug 18, 2000
          • 0 Attachment
            rlink@... (Robert Link) wrote:

            > How can I open a file from the command line without typing the entire
            > path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If

            You can :cd to your work directory, e.g.

            :cd Macintosh HD:Desktop Folder

            File name completion via Tab works fine for me, at least in
            the current directory.

            Cheers,
            Nils
            --
            nika@... | nika@... (preferred)
            4kassube@...-hamburg.de | nika@...
          • Leedsnet
            ... Are you writing as a developer or a user? I guess that ... is not doing what you want or what you expect. Is there a variety of ... that could help you at
            Message 5 of 11 , Aug 18, 2000
            • 0 Attachment
              At 02:11 PM 8/17/00, Robert Link wrote:
              >-----BEGIN PGP SIGNED MESSAGE-----
              >Hash: SHA1
              >
              >How can I open a file from the command line without typing the entire
              >path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If
              >there's a good faq for this kind of thing, feel free to point me to
              >it. Thanks!
              >- --


              Are you writing as a developer or a user?

              I guess that

              :e SomeFile.txt

              is not doing what you want or what you expect.

              Is there a variety of

              :browse confirm e

              that could help you at least temporarily?

              Mac applications should have a 'working directory' & there are details
              in Inside Mac on how to manipulate it using old and new calls. This is not
              a perfect system as the Mac identifies files using alias records or
              a volume/DirID/File triple.

              Ben.



              --
              Leedsnet - The information resource for Leeds and the West Riding
              < URL:http://www.leedsnet.com/ >
            • Robert Link
              Thanks to Benji, Eugene and Nils! ... needed files are in one directory. I didn t think to try it, I think this was because I don t think of that as something
              Message 6 of 11 , Aug 18, 2000
              • 0 Attachment
                Thanks to Benji, Eugene and Nils!

                :cd to the desired working directory works fine, at least when all the
                needed files are in one directory. I didn't think to try it, I think this
                was because I don't think of that as something vim does, but rather as
                something bash does---perhaps I'm a bit over my head technically. Tab
                completion also works fairly well. As for the drag-and-drop, I have an
                icon on my desktop for just that reason, but my whole love for vi(m) is
                avoiding the mouse, keeping my fingers on their appointed keys.


                I'd be interested to try the Tcl mentioned by Eugene and the utility
                metnioned by Benji.
                --
                Robert Link
              • H. Eckert
                ... Well, once again time to mention MPW, I guess :-) But you re right, on a regular Mac there is no MPW installed... The MPW scripting language offers about
                Message 7 of 11 , Aug 18, 2000
                • 0 Attachment
                  Quoting Eugene Lee (eugene@...):
                  > Command lines don't exist on a regular Mac system. I've played with a
                  > Tcl shell from the Mac Tcl/Tk distribution that offers a few functions
                  > for a very *very* basic shell, but nothing like a modern Unix shell.

                  Well, once again time to mention MPW, I guess :-)
                  But you're right, on a regular Mac there is no MPW installed...

                  The MPW scripting language offers about the same features as a
                  Bourne shell on a Unix machine. The command names differ and
                  for certain features MPW makes use of special characters present
                  in the Mac character encoding...

                  I don't think MPW offers a proper terminal emulation to the tools
                  otherwise having an adaption of vim as an MPW tool would be a
                  very weird but probably even useful thing to have :-)
                  (Keep in mind that MPW is a combination of an editor and a
                  command line with scripting. It might be compared somewhat to
                  emacs if your scripting and command line language was lisp...)

                  > Now if you wanna open a text file with Vim whose file creator isn't set
                  > to "VIM!", the easiest thing to do is to drag your text file onto the
                  > VimPPC icon directly, or indirectly on an alias or a launcher app.

                  Well, wouldn't it be straightforward (from a user's point of view)
                  if Vim would take the file's directory as the current directory if
                  Vim is started by drag'n'drop ?


                  Greetings,
                  Ripley
                  --
                  H. Eckert, 10777 Berlin, Germany, http://me.in-berlin.de/~nostromo/
                  ISO 8859-1: Ä=Ae, Ö=Oe, Ü=Ue, ä=ae, ö=oe, ü=ue, ß=sz.
                  "(Technobabbel)" (Jetrel) - "Müssen wir uns diesen Schwachsinn wirklich
                  anhören?" (Neelix)
                • vim-mac-egroups-wrapper@vim.org
                  ... Do you want to open the file from the MPW commandline or from the Vim comandline? On the Vim commandline you can cd to the path of the current document,
                  Message 8 of 11 , Aug 21, 2000
                  • 0 Attachment
                    > How can I open a file from the command line without typing the entire
                    > path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If
                    > there's a good faq for this kind of thing, feel free to point me to
                    > it. Thanks!

                    Do you want to open the file from the MPW commandline or from the Vim
                    comandline?

                    On the Vim commandline you can cd to the path of the current document,
                    after that :e looks in this folder and below.

                    You can use an autocommand like the one shown im macvimrc:
                    autocmd VimEnter * if strlen(@%) != 0 | cd %:p:h | endif

                    Axel
                    --
                    There is nothing left to try
                    There is nothing left to choose
                    There is no greater power
                    Then the power of VI
                  • Sven Guckes
                    ... Sven
                    Message 9 of 11 , Aug 21, 2000
                    • 0 Attachment
                      * Robert Link <rlink@...> [000817 13:11]:
                      > How can I open a file from the command line
                      > without typing the entire path name?

                      :e file workdir filename
                      :e ../dir/file relative filename
                      :e /path/dir/file absolute filename

                      > I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1.
                      > If there's a good faq for this kind of thing,
                      > feel free to point me to it.

                      :help editing.txt
                      :help :browse

                      Sven
                    • Eugene Lee
                      ... Actually, I ve modified my .vimrc so that when Vim starts up with a file, it also changes to that file s directory. If it starts up without a file, then
                      Message 10 of 11 , Aug 21, 2000
                      • 0 Attachment
                        On Sat, Aug 19, 2000 at 01:11:54AM +0200, H. Eckert wrote:
                        : Quoting Eugene Lee (eugene@...):
                        :
                        : > Now if you wanna open a text file with Vim whose file creator isn't set
                        : > to "VIM!", the easiest thing to do is to drag your text file onto the
                        : > VimPPC icon directly, or indirectly on an alias or a launcher app.
                        :
                        : Well, wouldn't it be straightforward (from a user's point of view)
                        : if Vim would take the file's directory as the current directory if
                        : Vim is started by drag'n'drop ?

                        Actually, I've modified my .vimrc so that when Vim starts up with a
                        file, it also changes to that file's directory. If it starts up without
                        a file, then it changes to the desktop folder/directory.


                        --
                        Eugene Lee
                        eugene@...
                      • vim-mac-egroups-wrapper@vim.org
                        ... File name completion has problems when there is a space in the path. But you can always use ... to get a file-selector. Axel
                        Message 11 of 11 , Aug 23, 2000
                        • 0 Attachment
                          > rlink@... (Robert Link) wrote:
                          >
                          > > How can I open a file from the command line without typing the entire
                          > > path name? I'm using vimppc 5.7.9 on a revC iMac, sys8.5.1. If
                          >
                          > You can :cd to your work directory, e.g.
                          >
                          > :cd Macintosh HD:Desktop Folder
                          >
                          > File name completion via Tab works fine for me, at least in
                          > the current directory.

                          File name completion has problems when there is a space in the path.

                          But you can always use
                          :browse e
                          to get a file-selector.

                          Axel
                        Your message has been successfully submitted and would be delivered to recipients shortly.