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

Re: PWD?

Expand Messages
  • 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 1 of 11 , Aug 18, 2000
      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 2 of 11 , Aug 18, 2000
        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 3 of 11 , Aug 18, 2000
          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 4 of 11 , Aug 18, 2000
            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 5 of 11 , Aug 21, 2000
              > 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 6 of 11 , Aug 21, 2000
                * 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 7 of 11 , Aug 21, 2000
                  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 8 of 11 , Aug 23, 2000
                    > 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.