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

Re: Mac OSX Issues

Expand Messages
  • Eugene Lee
    ... I would try using some shareware tool to the creator code of that text file to VIM! and see if Finder launches MacVim. Another work-around is to put
    Message 1 of 12 , Mar 19, 2003
    • 0 Attachment
      On Wed, Mar 19, 2003 at 03:41:03PM -0500, Benji Fisher wrote:
      :
      : Erik Westra wrote:
      : >
      : >Firstly, none of the text files I brought across from OS9 are associated
      : >with Vim, so double-clicking on the files brings up the standard
      : >TextEdit application (urgh) rather than Vim. I've tried using the "Get
      : >Info/Open With/Other/Vim/Change All" trick, but it just doesn't seem to
      : >work. I assume there's some problem here with Vim's creator ID, but I
      : >don't know enough about OSX to figure this out (I don't have the
      : >developer tools CD, for example). Without the ability to double-click
      : >on a document to bring it up in Vim, this version of Vim is almost
      : >useless for me. Help!
      :
      : I am not sure how to fix this. The last time I tried (a while ago)
      : nothing seemed to work. I should try again some time ... Does anyone have
      : a work-around for this?

      I would try using some shareware tool to the creator code of that text
      file to "VIM!" and see if Finder launches MacVim.

      Another work-around is to put MacVim in the Dock, then drag any text
      file to the Dock icon to open it up in MacVim.

      : >Secondly, when I do open a file brought across from OS9, by default all
      : >the line endings are mucked up.
      :
      : See item #3 on the bugs list:
      : http://macvim.swdev.org/OSX/#Bugs
      : Since I do not see the problem reported there, I may again distribute a
      : system vimrc file with the line
      :
      : :set ffs+=mac
      :
      : included.

      I added an explicit "set fileformats=unix,mac,dos" in my vimrc.


      --
      Eugene Lee
    • Erik Westra
      Hi Benji, ... Got it. Thanks... ... I ll have a play and see what I can figure out...I developed Mac software for nine years, before my employer forced me to
      Message 2 of 12 , Mar 20, 2003
      • 0 Attachment
        Hi Benji,

        > Yes, I abandoned my iDisk when Apple decided to charge for it.
        > macvim.swdev.org is now the preferred site.

        Got it. Thanks...

        >>Firstly, none of the text files I brought across from OS9 are associated
        >>with Vim, so double-clicking on the files brings up the standard TextEdit
        >>application (urgh) rather than Vim. I've tried using the "Get Info/Open
        >>With/Other/Vim/Change All" trick, but it just doesn't seem to work. I
        >>assume there's some problem here with Vim's creator ID, but I don't know
        >>enough about OSX to figure this out (I don't have the developer tools CD,
        >>for example). Without the ability to double-click on a document to bring
        >>it up in Vim, this version of Vim is almost useless for me. Help!
        >
        > I am not sure how to fix this. The last time I tried (a while ago)
        > nothing seemed to work. I should try again some time ... Does anyone
        > have a work-around for this?

        I'll have a play and see what I can figure out...I developed Mac software
        for nine years, before my employer forced me to switch development to
        PC. That was pre-OSX, but I'm keen to learn. I'll have a tinker when I
        have the time...

        >>Secondly, when I do open a file brought across from OS9, by default all
        >>the line endings are mucked up. I create a file using Mac VIM under OS9,
        >>save it, then transfer it to OSX (via Appleshare, which shouldn't muck up
        >>the line endings at all). When I open that file in the OSX version of
        >>Vim (using ":bro e" -- an awfully slow way of opening a file), the entire
        >>file appears on a single line, with the line endings represented by "^M"
        >>within the text. A quick check reveals that "fileformats" is not set to
        >>anything, and changing this (in my .vimrc file) to "mac" causes my files
        >>to be opened correctly. But why the change between the Classic and OSX
        >>versions of MacVim? Shouldn't there be a note about this in a FAQ somewhere?
        >
        >See item #3 on the bugs list:
        >http://macvim.swdev.org/OSX/#Bugs
        >Since I do not see the problem reported there, I may again distribute a
        >system vimrc file with the line
        >
        >:set ffs+=mac
        >
        >included.

        Thanks. Even a note about the fileformat problem on your web page would be
        a great help.

        >>The last problem I've found is rather annoying: it seems that
        >>auto-completion isn't supported in this version of Vim! To see what I
        >>mean, try typing ":bro" and pressing the <tab> key. Under Classic, and
        >>on the PC and in Linux as well, Vim happily supports command
        >>auto-completion -- it replaces the "bro" with "browse", or beeps if the
        >>command isn't unique. Similarly, you can use filename-completion to
        >>quickly home in on a desired file -- for example, I'd expect that typing:
        >> :e ~/novel/intr <tab>
        >>would open a file called "introduction.txt" in the "novel" folder in my
        >>home directory. Unfortunately, pressing the tab key while typing a
        >>command into the OSX version of MacVim just causes "^I" to be inserted
        >>into the command line. Strangely enough, typing ":version" shows that
        >>the "cmdline_compl" compile-time variable has been set, but it still
        >>isn't working for some reason. Any clues?
        >
        > Read the "Important" instructions near the top of the page
        >http://macvim.swdev.org/OSX
        >or in the vim/Readme file and also
        >
        >:help 'compatible'

        Oops! You're right (and someone else suggested I try the same
        thing). That was definitely the problem. I'd assumed I must have already
        'set nocp' in the .vimrc I was using under Classic, but the defaults must
        have changed between the Classic version and the OSX version of Vim --
        under Classic, it seems that 'set nocp' is the default, unlike the OSX version.

        One suggestion: would you like me to write up a quick "Migrating from
        Classic to the OSX version of Vim" note, describing the things that someone
        needs to do to get up and running? At present, you page talks about a
        fresh installation of Vim from the point of view of someone who hasn't used
        Vim on the Mac before. It'd be great to have a summary of what's
        different between the two versions, so that previous Mac Vim users won't
        get caught out like I was. I'd be happy to knock something like this
        together for you for inclusion on your web page -- I suspect it may help
        smooth the transition for other "Classic to OSX switchers"...

        >HTH

        It sure does!

        Thanks,

        - Erik.
      • Rain Dog
        ... Benji, have you tried this? It worked for me, though I can t be certain that I haven t made other changes that addressed the problem. Try changing line
        Message 3 of 12 , Mar 20, 2003
        • 0 Attachment
          On Wednesday, March 19, 2003, at 04:36 AM, Erik Westra wrote:

          > none of the text files I brought across from OS9 are associated with
          > Vim, so double-clicking on the files brings up the standard TextEdit
          > application (urgh) rather than Vim. I've tried using the "Get
          > Info/Open With/Other/Vim/Change All" trick, but it just doesn't seem
          > to work. I assume there's some problem here with Vim's creator ID...

          I wrote:

          > The file Vim.app/Contents/PkgInfo, which is generated by the makefile,
          > contains the
          > type and creator codes (currently "APPL????", should be "APPLVIM!").
          > It's necessary,
          > but probably not sufficient, to change this file to get the behavior
          > you want.
          > Other things you might try are creating a Finder copy of the modified
          > Vim.app/
          > and then restarting the Finder or logging out and back in again.

          Benji, have you tried this? It worked for me, though I can't be
          certain that I haven't
          made other changes that addressed the problem.

          Try changing line 175 of Make_osx.mak from '@echo -n "APPL????" > $@' to
          '@echo -n "APPLVIM!" > $@' (preserving the leading tab character), and
          then rebuild
          Vim. To test the change (and, again, you might need to create a Finder
          copy of Vim
          or log out and back in), use the /Developer/Tools/SetFile command to
          set the type
          and creator codes of a text file (SetFile -c 'VIM!' -t 'TEXT'
          myfile.txt).
          You should then be able to double-click myfile.txt to open it in Vim.
          This should also address the OzTeX issue.

          Peter
        • Benji Fisher
          ... [snip] ... Help is always welcome! Personally, I bear no resemblance to a Mac developer... ... Er, doesn t an item in the list of known bugs count as a
          Message 4 of 12 , Mar 20, 2003
          • 0 Attachment
            Erik Westra wrote:
            > Hi Benji,
            >
            [snip]
            > I'll have a play and see what I can figure out...I developed Mac
            > software for nine years, before my employer forced me to switch
            > development to PC. That was pre-OSX, but I'm keen to learn. I'll have
            > a tinker when I have the time...

            Help is always welcome! Personally, I bear no resemblance to a Mac
            developer...

            >> See item #3 on the bugs list:
            >> http://macvim.swdev.org/OSX/#Bugs
            >> Since I do not see the problem reported there, I may again distribute
            >> a system vimrc file with the line
            >>
            >> :set ffs+=mac
            >>
            >> included.
            >
            >
            > Thanks. Even a note about the fileformat problem on your web page would
            > be a great help.

            Er, doesn't an item in the list of known bugs count as a note on my web page?

            > Oops! You're right (and someone else suggested I try the same thing).
            > That was definitely the problem. I'd assumed I must have already 'set
            > nocp' in the .vimrc I was using under Classic, but the defaults must
            > have changed between the Classic version and the OSX version of Vim --
            > under Classic, it seems that 'set nocp' is the default, unlike the OSX
            > version.

            If you have a vimrc file, then 'nocompatible' should be set, according to
            :help 'compatible' . Did you have a file .vimrc in your home directory, and
            still get 'compatible' behavior?

            > One suggestion: would you like me to write up a quick "Migrating from
            > Classic to the OSX version of Vim" note, describing the things that
            > someone needs to do to get up and running? At present, you page talks
            > about a fresh installation of Vim from the point of view of someone who
            > hasn't used Vim on the Mac before. It'd be great to have a summary of
            > what's different between the two versions, so that previous Mac Vim
            > users won't get caught out like I was. I'd be happy to knock something
            > like this together for you for inclusion on your web page -- I suspect
            > it may help smooth the transition for other "Classic to OSX switchers"...

            If you write it, I will post it. You may have to pester me a bit, though...

            --Benji Fisher
          • Erik Westra
            Hi Benji, ... That s great. I ll have a more serious look when I get a chance, but I did have some success in tinkering with Vim s creator codes last night.
            Message 5 of 12 , Mar 20, 2003
            • 0 Attachment
              Hi Benji,

              >>I'll have a play and see what I can figure out...I developed Mac software
              >>for nine years, before my employer forced me to switch development to
              >>PC. That was pre-OSX, but I'm keen to learn. I'll have a tinker when I
              >>have the time...
              >
              > Help is always welcome! Personally, I bear no resemblance to a Mac
              > developer...

              That's great. I'll have a more serious look when I get a chance, but I did
              have some success in tinkering with Vim's creator codes last night. See my
              next E-Mail...

              >>Thanks. Even a note about the fileformat problem on your web page would
              >>be a great help.
              >
              > Er, doesn't an item in the list of known bugs count as a note on my
              > web page?

              Well, it would do, if it related to this particular problem! To quote from
              your web page:

              >The binary for OSX 10.2 (Jaguar) is reported to have trouble reading files
              >with Unix-style line endings if the 'fileformats' option includes "mac".
              >(The version I distribut has a system vimrc file that sets this option. If
              >you have this problem, you can remove the "set ffs+=mac" line from vim/vimrc.)

              The problem I've encountered is that Mac Vim can't interpret Mac-style line
              endings unless you explicitly set 'fileformats' to include "mac" -- which
              is quite different to what you've said here. Remember: lots of existing
              Mac Vim users already have a .vimrc file, and will use that in favour of
              the default you supply. So any differences between Vim under Classic and
              OSX will show upp, even if you've set the default .vimrc file to "hide"
              some of these differences...

              Don't worry about adding a separate item to your page for this, though --
              I'll include it in my note...

              >If you have a vimrc file, then 'nocompatible' should be set, according to
              >:help 'compatible' . Did you have a file .vimrc in your home directory,
              >and still get 'compatible' behavior?

              I've never put a .vimrc file in my home directory -- mine lives in the main
              Vim folder. That's how I did it under Classic, and so I moved the same
              .vimrc file to the Vim folder under OSX, expecting (foolishly, it turns
              out) that it would work. Oh well, another item for the "migrating" note...

              >>One suggestion: would you like me to write up a quick "Migrating from
              >>Classic to the OSX version of Vim" note, describing the things that
              >>someone needs to do to get up and running? At present, you page talks
              >>about a fresh installation of Vim from the point of view of someone who
              >>hasn't used Vim on the Mac before. It'd be great to have a summary of
              >>what's different between the two versions, so that previous Mac Vim users
              >>won't get caught out like I was. I'd be happy to knock something like
              >>this together for you for inclusion on your web page -- I suspect it may
              >>help smooth the transition for other "Classic to OSX switchers"...
              >
              > If you write it, I will post it. You may have to pester me a bit,
              > though...

              Roger.

              Thanks again,

              - Erik.
            • Erik Westra
              Hi guys, ... I had a play with this last night. It seems that this provides a good start to solving the problem, but as you say by itself it isn t sufficient.
              Message 6 of 12 , Mar 20, 2003
              • 0 Attachment
                Hi guys,

                >Rain Dog wrote:
                >
                >>The file Vim.app/Contents/PkgInfo, which is generated by the makefile,
                >>contains the
                >>type and creator codes (currently "APPL????", should be "APPLVIM!").
                >>It's necessary,
                >>but probably not sufficient, to change this file to get the behavior you
                >>want.
                >>Other things you might try are creating a Finder copy of the modified
                >>Vim.app/
                >>and then restarting the Finder or logging out and back in again.
                >
                >Benji, have you tried this? It worked for me, though I can't be certain
                >that I haven't
                >made other changes that addressed the problem.

                I had a play with this last night. It seems that this provides a good
                start to solving the problem, but as you say by itself it isn't
                sufficient. I poked around a bit more, and found that the "info.plist"
                file also contains an entry that needs to be changed. Here's a quick HOWTO
                (aimed at non-developers) detailing the steps needed to fix the creator
                code on a particular copy of Vim:

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

                1. Open the "Vim" application's package by control-clicking on the app and
                choosing "Show Package Contents" from the pop-up menu. Inside the
                "Contents" folder are two files that need to be edited: "Info.plist" and
                "PkgInfo".

                2. Control-click on PkgInfo and choose "Open with...Other". Then select
                your favour text editor (another copy of Vim will do) and change the file's
                contents from "APPL????" to "APPLVIM!". Save the changes, and close the file.

                3. Control-click on Info.plist, and again choose "Open with...Other" to
                edit it in a text editor. On about line 14 of the file, you'll see an
                entry which looks like this:

                <key>CFBundleSignature</key>
                <string>????</string>

                Again, change the "????" to "VIM!", save the file, and close the folders
                you opened.

                4. Finally, try making a copy of the Vim application and log out and log
                back in again to force OSX to recognise Vim's new creator code.

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

                With this done, Vim behaves as it should -- files created by Vim open in
                Vim when you double-click on them, and you can make *all* text files open
                in Vim by selecting any ".txt" file, getting info on the file and selecting
                Vim as the default application to use for that file. Then, by clicking on
                "Change All...", all text files from that time on will be opened using
                Vim. Hurray!

                Note: I did *not* need to use the "set backupcopy=yes" command suggested in
                the FAQ to make this work -- as soon as the file's creator code has been
                set correctly, it appears that "set backupcopy=yes" is no longer necessary...

                >Try changing line 175 of Make_osx.mak from '@echo -n "APPL????" > $@' to
                >'@echo -n "APPLVIM!" > $@' (preserving the leading tab character), and
                >then rebuild
                >Vim. To test the change (and, again, you might need to create a Finder
                >copy of Vim
                >or log out and back in), use the /Developer/Tools/SetFile command to set
                >the type
                >and creator codes of a text file (SetFile -c 'VIM!' -t 'TEXT' myfile.txt).
                >You should then be able to double-click myfile.txt to open it in Vim.
                >This should also address the OzTeX issue.

                Yup, it'd be great to get this working on Vim right out of the box. I
                don't have the developer tools installed on my OSX machine (yet), so I
                can't test anything, but it seems that the makefile includes commands to
                explicitly build the Info.plist command, so it should be easy to change the
                "????" to "VIM!" there too. That'd make my instructions above
                obsolete...any chance you could try this at some time, Benji?

                Cheers,

                - Erik.
              • Benji Fisher
                ... Thanks for trying this. Since it did not work the last time I tried (something like) this, I was reluctant to spend the time trying again. Now that I
                Message 7 of 12 , Mar 20, 2003
                • 0 Attachment
                  Erik Westra wrote:
                  > Hi guys,
                  >
                  >> Rain Dog wrote:
                  >>
                  >>> The file Vim.app/Contents/PkgInfo, which is generated by the
                  >>> makefile, contains the
                  >>> type and creator codes (currently "APPL????", should be "APPLVIM!").
                  >>> It's necessary,
                  >>> but probably not sufficient, to change this file to get the behavior
                  >>> you want.
                  >>> Other things you might try are creating a Finder copy of the modified
                  >>> Vim.app/
                  >>> and then restarting the Finder or logging out and back in again.
                  >>
                  >>
                  >> Benji, have you tried this? It worked for me, though I can't be
                  >> certain that I haven't
                  >> made other changes that addressed the problem.
                  >
                  >
                  > I had a play with this last night. It seems that this provides a good
                  > start to solving the problem, but as you say by itself it isn't
                  > sufficient. I poked around a bit more, and found that the "info.plist"
                  > file also contains an entry that needs to be changed. Here's a quick
                  > HOWTO (aimed at non-developers) detailing the steps needed to fix the
                  > creator code on a particular copy of Vim:

                  Thanks for trying this. Since it did not work the last time I tried
                  (something like) this, I was reluctant to spend the time trying again. Now that
                  I have a report that it works, it is a different story.

                  > -------------------------------------------------------------------------------
                  >
                  >
                  > 1. Open the "Vim" application's package by control-clicking on the app
                  > and choosing "Show Package Contents" from the pop-up menu. Inside the
                  > "Contents" folder are two files that need to be edited: "Info.plist" and
                  > "PkgInfo".
                  >
                  > 2. Control-click on PkgInfo and choose "Open with...Other". Then select
                  > your favour text editor (another copy of Vim will do) and change the
                  > file's contents from "APPL????" to "APPLVIM!". Save the changes, and
                  > close the file.

                  How about starting Vim and

                  :e $VIM/Vim.app/Contents/Info.plist

                  (with generous use of command-line completion, now that you have :set nocp)? I
                  would be surprised if using Vim.app to modify its own property list and package
                  info will create a problem, provided that you then make a copy with the Finder.

                  > 3. Control-click on Info.plist, and again choose "Open with...Other" to
                  > edit it in a text editor. On about line 14 of the file, you'll see an
                  > entry which looks like this:
                  >
                  > <key>CFBundleSignature</key>
                  > <string>????</string>
                  >
                  > Again, change the "????" to "VIM!", save the file, and close the folders
                  > you opened.
                  >
                  > 4. Finally, try making a copy of the Vim application and log out and log
                  > back in again to force OSX to recognise Vim's new creator code.
                  >
                  > -------------------------------------------------------------------------------
                  >
                  >
                  > With this done, Vim behaves as it should -- files created by Vim open in
                  > Vim when you double-click on them, and you can make *all* text files
                  > open in Vim by selecting any ".txt" file, getting info on the file and
                  > selecting Vim as the default application to use for that file. Then, by
                  > clicking on "Change All...", all text files from that time on will be
                  > opened using Vim. Hurray!
                  >
                  > Note: I did *not* need to use the "set backupcopy=yes" command suggested
                  > in the FAQ to make this work -- as soon as the file's creator code has
                  > been set correctly, it appears that "set backupcopy=yes" is no longer
                  > necessary...

                  What happens if you use Vim.app to edit a file that already has the
                  creator code from some other program? Not only what happens, but what do you
                  want/expect to happen? (I do not use any old-style Mac programs, so this is
                  pretty much terra incognita for me.)

                  >> Try changing line 175 of Make_osx.mak from '@echo -n "APPL????" > $@' to
                  >> '@echo -n "APPLVIM!" > $@' (preserving the leading tab character), and
                  >> then rebuild
                  >> Vim. To test the change (and, again, you might need to create a
                  >> Finder copy of Vim
                  >> or log out and back in), use the /Developer/Tools/SetFile command to
                  >> set the type
                  >> and creator codes of a text file (SetFile -c 'VIM!' -t 'TEXT'
                  >> myfile.txt).
                  >> You should then be able to double-click myfile.txt to open it in Vim.
                  >> This should also address the OzTeX issue.
                  >
                  >
                  > Yup, it'd be great to get this working on Vim right out of the box. I
                  > don't have the developer tools installed on my OSX machine (yet), so I
                  > can't test anything, but it seems that the makefile includes commands to
                  > explicitly build the Info.plist command, so it should be easy to change
                  > the "????" to "VIM!" there too. That'd make my instructions above
                  > obsolete...any chance you could try this at some time, Benji?

                  Maybe tomorrow. I have one question. Andrew Trevorrow (of OzTeX fame)
                  suggested using something other than VIM! for the Carbon version, to avoid
                  conflicts with the other (Classic) version of vim. Is he right? I am inclined
                  to stick with VIM! unless someone talks me out of it.

                  --Benji Fisher
                • Rain Dog
                  ... Indeed, my copy of Make_osx.mak creates an Info.plist with the CFBundleSignature set to VIM! . I must have made that change some time ago. Thanks for
                  Message 8 of 12 , Mar 20, 2003
                  • 0 Attachment
                    Erik Westra wrote:
                    > I don't have the developer tools installed on my OSX machine (yet), so
                    > I can't test anything, but it seems that the makefile includes
                    > commands to explicitly build the Info.plist command, so it should be
                    > easy to change the "????" to "VIM!" there too.

                    Indeed, my copy of Make_osx.mak creates an Info.plist with the
                    CFBundleSignature
                    set to 'VIM!'. I must have made that change some time ago. Thanks for
                    the correction!

                    Benji Fisher wrote:
                    > Andrew Trevorrow (of OzTeX fame) suggested using something other than
                    > VIM! for the Carbon version, to avoid conflicts with the other
                    > (Classic) version of vim. Is he right? I am inclined to stick with
                    > VIM! unless someone talks me out of it.

                    My advice would be to use 'VIM!' for the Carbon version, so that
                    existing files open
                    with that version. If you have reason to keep the Classic version
                    around, change
                    its creator code instead.

                    Peter
                  • Erik Westra
                    Hi Benji, ... Great! ... That works fine, too. Thanks -- I hadn t thought of doing that. ... Okay, I did some playing around, and here s what happens. If you
                    Message 9 of 12 , Mar 21, 2003
                    • 0 Attachment
                      Hi Benji,

                      > Thanks for trying this. Since it did not work the last time I tried
                      > (something like) this, I was reluctant to spend the time trying
                      > again. Now that I have a report that it works, it is a different story.

                      Great!

                      >>2. Control-click on PkgInfo and choose "Open with...Other". Then select
                      >>your favour text editor (another copy of Vim will do) and change the
                      >>file's contents from "APPL????" to "APPLVIM!". Save the changes, and
                      >>close the file.
                      >
                      > How about starting Vim and
                      >
                      >:e $VIM/Vim.app/Contents/Info.plist
                      >
                      >(with generous use of command-line completion, now that you have :set
                      >nocp)? I would be surprised if using Vim.app to modify its own property
                      >list and package info will create a problem, provided that you then make a
                      >copy with the Finder.

                      That works fine, too. Thanks -- I hadn't thought of doing that.

                      >>Note: I did *not* need to use the "set backupcopy=yes" command suggested
                      >>in the FAQ to make this work -- as soon as the file's creator code has
                      >>been set correctly, it appears that "set backupcopy=yes" is no longer
                      >>necessary...
                      >
                      > What happens if you use Vim.app to edit a file that already has the
                      > creator code from some other program? Not only what happens, but what do
                      > you want/expect to happen? (I do not use any old-style Mac programs, so
                      > this is pretty much terra incognita for me.)

                      Okay, I did some playing around, and here's what happens. If you set
                      'backupcopy=yes' and then edit a file created by some other application,
                      that other application stays as the creator for that file, even though it
                      was edited and saved within Vim. If 'backupcopy' is not set beforehand (or
                      set to 'no'), editing a file created by another app and saving it causes
                      Vim to become the file's creator, so that double-clicking on the document
                      will open Vim instead of the other app.

                      Personally, I prefer the second option -- it makes it easier to switch an
                      existing file to open again in Vim. If you wanted to be absolutely
                      "correct" as far as the Mac's user interface standards go, then I guess
                      you'd have to modify your gvimrc file so that the "Save..." menu command
                      behaves as if 'backupcopy' was set to 'yes', but the "Save As..." command
                      behaves as if 'backupcopy' was set to 'no'. That way, simply saving a
                      document (with "Save") wouldn't affect the file's creator (because you're
                      saving the file in place), but choosing "Save As..." would set Vim as the
                      document's creator (because you're creating a new file, and Vim is the app
                      creating that file). Even if you "Save As..." and overwrite the old file,
                      the creator should still be set.

                      As I say, that's how an "absolutely correct" app would behave, but it's
                      probably more work than it would be worth. I personally almost never use
                      the standard "Open", "Save" or "Save As" commands from the menu, and even
                      if I did I wouldn't be too fussed if the file's creator was changed to
                      Vim. Now that the creator code is correct, I really don't see much value
                      in having 'backupcopy' set at all...

                      >>Yup, it'd be great to get this working on Vim right out of the box. I
                      >>don't have the developer tools installed on my OSX machine (yet), so I
                      >>can't test anything, but it seems that the makefile includes commands to
                      >>explicitly build the Info.plist command, so it should be easy to change
                      >>the "????" to "VIM!" there too. That'd make my instructions above
                      >>obsolete...any chance you could try this at some time, Benji?
                      >
                      > Maybe tomorrow. I have one question. Andrew Trevorrow (of OzTeX
                      > fame) suggested using something other than VIM! for the Carbon version,
                      > to avoid conflicts with the other (Classic) version of vim. Is he
                      > right? I am inclined to stick with VIM! unless someone talks me out of it.

                      I'd also vote to keep the creator as "VIM!". There really isn't a problem
                      with having more than one version of an app (with the same creator code) on
                      the same hard disk. Apple's developer docs (at:
                      http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/Finder/chapter_10_section_13.html)
                      give the details of how the Finder selects which application to use to open
                      a particular file. The rules are quite complicated, but the following is
                      the relevant bit for us:

                      <<<...The Finder gives preference to native applications over Classic
                      applications. It also gives preference to later versions of an application
                      and to applications with a later modification date...if there is an
                      application with the same creator type already running, select that
                      application instead.>>>

                      In other words, Mac OSX should happily handle both classic and OSX versions
                      of Vim co-existing, both with the same creator code. I actually think it's
                      important that we keep the creator code set to "VIM!", so that files
                      created with Vim stay associated with Vim even if they're shifted from one
                      machine to the other.

                      Anyway, just my $0.02 worth...

                      Cheers,

                      - Erik.
                    • Benji Fisher
                      ... I do not think I will change the defaults, but maybe I can update the FAQ, now that I understand it a bit better. ... I would not be that hard ... ...
                      Message 10 of 12 , Mar 21, 2003
                      • 0 Attachment
                        Erik Westra wrote:
                        > Hi Benji,
                        >
                        >> What happens if you use Vim.app to edit a file that already has
                        >> the creator code from some other program? Not only what happens, but
                        >> what do you want/expect to happen? (I do not use any old-style Mac
                        >> programs, so this is pretty much terra incognita for me.)
                        >
                        >
                        > Okay, I did some playing around, and here's what happens. If you set
                        > 'backupcopy=yes' and then edit a file created by some other application,
                        > that other application stays as the creator for that file, even though
                        > it was edited and saved within Vim. If 'backupcopy' is not set
                        > beforehand (or set to 'no'), editing a file created by another app and
                        > saving it causes Vim to become the file's creator, so that
                        > double-clicking on the document will open Vim instead of the other app.

                        I do not think I will change the defaults, but maybe I can update the FAQ,
                        now that I understand it a bit better.

                        > Personally, I prefer the second option -- it makes it easier to switch
                        > an existing file to open again in Vim. If you wanted to be absolutely
                        > "correct" as far as the Mac's user interface standards go, then I guess
                        > you'd have to modify your gvimrc file so that the "Save..." menu command
                        > behaves as if 'backupcopy' was set to 'yes', but the "Save As..."
                        > command behaves as if 'backupcopy' was set to 'no'. That way, simply
                        > saving a document (with "Save") wouldn't affect the file's creator
                        > (because you're saving the file in place), but choosing "Save As..."
                        > would set Vim as the document's creator (because you're creating a new
                        > file, and Vim is the app creating that file). Even if you "Save As..."
                        > and overwrite the old file, the creator should still be set.
                        >
                        > As I say, that's how an "absolutely correct" app would behave, but it's
                        > probably more work than it would be worth. I personally almost never
                        > use the standard "Open", "Save" or "Save As" commands from the menu, and
                        > even if I did I wouldn't be too fussed if the file's creator was changed
                        > to Vim. Now that the creator code is correct, I really don't see much
                        > value in having 'backupcopy' set at all...

                        I would not be that hard ...

                        >>> Yup, it'd be great to get this working on Vim right out of the box.
                        >>> I don't have the developer tools installed on my OSX machine (yet),
                        >>> so I can't test anything, but it seems that the makefile includes
                        >>> commands to explicitly build the Info.plist command, so it should be
                        >>> easy to change the "????" to "VIM!" there too. That'd make my
                        >>> instructions above obsolete...any chance you could try this at some
                        >>> time, Benji?
                        >>
                        >> Maybe tomorrow. I have one question. Andrew Trevorrow (of OzTeX
                        >> fame) suggested using something other than VIM! for the Carbon
                        >> version, to avoid conflicts with the other (Classic) version of vim.
                        >> Is he right? I am inclined to stick with VIM! unless someone talks me
                        >> out of it.
                        >
                        > I'd also vote to keep the creator as "VIM!". There really isn't a
                        > problem with having more than one version of an app (with the same
                        > creator code) on the same hard disk. Apple's developer docs (at:
                        > http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/Finder/chapter_10_section_13.html)
                        > give the details of how the Finder selects which application to use to
                        > open a particular file. The rules are quite complicated, but the
                        > following is the relevant bit for us:
                        >
                        > <<<...The Finder gives preference to native applications over Classic
                        > applications. It also gives preference to later versions of an
                        > application and to applications with a later modification date...if
                        > there is an application with the same creator type already running,
                        > select that application instead.>>>
                        >
                        > In other words, Mac OSX should happily handle both classic and OSX
                        > versions of Vim co-existing, both with the same creator code. I
                        > actually think it's important that we keep the creator code set to
                        > "VIM!", so that files created with Vim stay associated with Vim even if
                        > they're shifted from one machine to the other.

                        Unfortunately, it does not work for me.

                        1. If I change the creator code to VIM!, either by editing Info.plist and
                        PkgInfo or by recompiling (and letting the Makefile fo it for me), then nothing
                        I can do (re-launch Finder, log out, reboot) will convince my Mac that VIM!
                        means this version of Vim. If I use

                        % /Developer/Tools/SetFile -c 'VIM!' ~/temp/temp.txt

                        (as suggested by Peter), then the OS starts up the Classic environment to run my
                        old version of Vim. Does anyone else have a copy of Vim on his OS 9 partition?

                        2. If I change the creator code to something new, like 'VimX', and use SetFile
                        to give temp.txt the same creator code, then Vim starts up as expected. But
                        files I create with Vim do not get a creator code, no matter what I try.

                        Even if it is not working for me, I am glad that it is starting to work
                        for others. If we (some of us) are getting documents associated with Vim, we
                        should use Douglas Stebila's icons from http://theorem.ca/~dstebila/code/vim/ .
                        I assume I should include the .icns file (or files) in
                        Vim.app/Contents/Resources and modify Info.plist accordingly. Do we want to use
                        both of the document icons? If so, how do we fix Info.plist to use doc.icns or
                        doc-text.icns as appropriate. If not, which of the two icons should I use?

                        --Benji Fisher
                      Your message has been successfully submitted and would be delivered to recipients shortly.