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

Re: new Vim binary for Mac OS X

Expand Messages
  • Benji Fisher
    ... [snip Info.plist] I tried copying the TextEdit icon, as you did, and using your version of Vim.app/Contents/Resources/txt.icns and I logged out and in
    Message 1 of 18 , Dec 3, 2001
      On Sunday, December 2, 2001, at 07:48 PM, raindog@... wrote:

      > On Sunday, December 2, 2001, at 06:20 AM, Benji Fisher wrote:
      >
      > > > Bill Tschumy wrote:
      > > > 3. I notice this VIM can't automatically open a file that has been
      > > > double-clicked. Any thoughts on how hard this would be?
      > >
      > > Did you tell OS X that some files are supposed to be opened by
      > > Vim.app? Choose a file in the Finder, type Cmd-I (or choose File.Get\
      > > Information or whatever) and choose the "Open With Application" tab.
      >
      > It would also be nice to be able to drag and drop text files (or any
      > kind
      > of file, for that matter) onto Vim. Has this issue been addressed yet?
      > If not, the way to do it is to add certain keys to Vim.app's Info.plist
      > file
      > that indicate to the Finder which file types Vim is able to edit.
      > Attached is a copy of Info.plist with the necessary changes to allow Vim
      > to open any kind of file. To make it work, though, you need to supply a
      > document icon (not being an artist, I lamely typed 'cp
      > /Applications/TextEdit.app/Contents/Resources/txt.icns
      > /Applications/vim/Vim.app/Contents/Resources/' and solved that problem)
      > and then restart the Finder (or log out and back in again or make a copy
      > of Vim.app).
      >
      > Now if only I could figure out how to get 'gvim -o' behavior when
      > dragging
      > and dropping multiple files (':sball', perhaps?), and how to avoid that
      > "Hit Enter..." prompt at the beginning.

      [snip Info.plist]

      I tried copying the TextEdit icon, as you did, and using your
      version of Vim.app/Contents/Resources/txt.icns and I logged out and in
      again, and it did not work. Did you leave out a step, or am I making a
      mistake?

      Somehow, the binary I uploaded on Friday is not the version I get
      from http://homepage.mac.com/fisherbb/index.html . I do get the version
      I want when I download from my i-disk. (This is getting to be very
      annoying!) If I can get the drag-and-drop to work, I will (try to!)
      post a new version. In the mean time, I would like testers for this
      gvimrc file. (Comment out the "finish" line before testing.)

      --Benji Fisher

      --------8<--------8<--------8<--------8<--------

      " System gvimrc file for Mac OS X
      " Author: Benji Fisher <benji@...>
      " Last modified: 30 November 2001

      " If you want to get more Mac-like behavior, comment the following line
      so
      " that the rest of the file will not be ignored.

      finish

      " Define mac-standard menu items and keyboard shortcuts.

      aunmenu &File.&New
      amenu 10.325 &File.&New\ (Cmd-n) <D-n>
      nmap <D-n> :confirm enew<CR>
      vmap <D-n> <Esc><D-n>gv
      imap <D-n> <C-O><D-n>
      cmap <D-n> <C-C><D-n>
      omap <D-n> <Esc><D-n>
      aunmenu &File.&Open\.\.\.
      amenu 10.310 &File.&Open\.\.\.\ (Cmd-o) <D-o>
      nmap <D-o> :browse confirm e<CR>
      vmap <D-o> <Esc><D-o>gv
      imap <D-o> <C-O><D-o>
      cmap <D-o> <C-C><D-o>
      omap <D-o> <Esc><D-o>
      aunmenu &File.&Close
      amenu 10.330 &File.&Close\ (Cmd-w) <D-w>
      nmap <silent> <D-w> :if winheight(2) < 0 <Bar>
      \ confirm enew <Bar>
      \ else <Bar>
      \ confirm close <Bar>
      \ endif<CR>
      vmap <D-w> <Esc><D-w>gv
      imap <D-w> <C-O><D-w>
      cmap <D-w> <C-C><D-w>
      omap <D-w> <Esc><D-w>
      aunmenu &File.&Save
      amenu 10.340 &File.&Save\ (Cmd-s) <D-s>
      nmap <silent> <D-s> :if expand("%") == ""<Bar>browse confirm w<Bar>
      \ else<Bar>confirm w<Bar>endif<CR>
      vmap <D-s> <Esc><D-s>gv
      imap <D-s> <C-O><D-s>
      cmap <D-s> <C-C><D-s>
      omap <D-s> <Esc><D-s>
      aunmenu &File.Save\ &As\.\.\.
      amenu 10.350 &File.Save\ &As\.\.\.\ (Cmd-S) <D-S-s>
      nmap <D-S-s> :browse confirm saveas<CR>
      vmap <D-S-s> <Esc><D-s>gv
      imap <D-S-s> <C-O><D-s>
      cmap <D-S-s> <C-C><D-s>
      omap <D-S-s> <Esc><D-s>
      " map <D-p> ??
      " <D-q> is handled by the OS.
      "amenu File.Quit\ (Cmd-q) <D-q>
      "nmap <D-q> :confirm qall<CR>
      "vmap <D-q> <Esc><D-q>gv
      "imap <D-q> <C-O><D-q>
      "cmap <D-q> <C-C><D-q>
      "omap <D-q> <Esc><D-q>
      " From the Edit menu of SimpleText:
      aunmenu &Edit.&Undo
      amenu 20.310 &Edit.&Undo\ (Cmd-z) <D-z>
      nmap <D-z> u
      vmap <D-z> <Esc><D-z>gv
      imap <D-z> <C-O><D-z>
      cmap <D-z> <C-C><D-z>
      omap <D-z> <Esc><D-z>
      vunmenu &Edit.Cu&t
      vmenu 20.340 &Edit.Cu&t\ (Cmd-x) <D-x>
      vmap <D-x> "+x
      vunmenu &Edit.&Copy
      vmenu 20.350 &Edit.&Copy\ (Cmd-c) <D-c>
      vmap <D-c> "+y
      cunmenu &Edit.&Copy
      cmenu 20.350 &Edit.&Copy\ (Cmd-v) <D-c>
      cmap <D-c> <C-Y>
      aunmenu &Edit.&Paste
      nmenu 20.360 &Edit.&Paste\ (Cmd-v) <D-v>
      nmap <D-v> "+gP
      cmenu &Edit.&Paste\ (Cmd-v) <D-v>
      cmap <D-v> <C-R>+
      vmenu &Edit.&Paste\ (Cmd-v) <D-v>
      imenu &Edit.&Paste\ (Cmd-v) <D-v>
      if has("virtualedit")
      vmap <D-v> "-c<Esc><SID>Paste
      imap <D-v> <Esc><SID>Pastegi
      else
      vmap <D-v> "-c<Esc>gix<Esc><SID>Paste"_x
      imap <D-v> x<Esc><SID>Paste"_s
      endif
      aunmenu &Edit.&Select\ all
      amenu 20.400 &Edit.Select\ &All\ (Cmd-a) <D-a>
      nmap <silent> <D-a> :if &slm != ""<Bar>exe ":norm gggH<C-O>G"<Bar>
      \ else<Bar>exe ":norm ggVG"<Bar>endif<CR>
      vmap <D-a> <Esc><D-a>
      imap <D-a> <Esc><D-a>
      cmap <D-a> <C-C><D-a>
      omap <D-a> <Esc><D-a>
      aunmenu &Edit.&Find
      amenu 20.410 &Edit.&Find\ (Cmd-f) <D-f>
      nmap <D-f> /
      vmap <D-f> <Esc><D-f>
      imap <D-f> <Esc><D-f>
      cmap <D-f> <C-C><D-f>
      omap <D-f> <Esc><D-f>
      amenu 20.420 &Edit.&Next\ (Cmd-g) <D-g>
      nmap <D-g> n
      vmap <D-g> <Esc><D-g>
      imap <D-g> <C-O><D-g>
      cmap <D-g> <C-C><D-g>
      omap <D-g> <Esc><D-g>
      vmenu <silent> 20.420 &Edit.Find\ &Selection "9y/<C-R>9<CR>
      \:if strlen(@9) > 1 <Bar>
      \ exe 'norm!v/' . @9 . '/e' . "<Bslash><lt>CR>"<Bar>
      \ else <Bar> exe "norm!v" <Bar> endif<CR>
    • Bill Tschumy
      Benji, Thanks for the updated gvimrc. Menu commands seem to be working well now. I m always a bit unsure whether to use these platform specific (or gui
      Message 2 of 18 , Dec 3, 2001
        Benji,

        Thanks for the updated gvimrc. Menu commands seem to be working
        well now.

        I'm always a bit unsure whether to use these platform specific (or
        gui specific) features. I worry that I will lose my muscle memory
        for using standard Vim. I'll see how it goes.
        --
        Bill Tschumy
        Otherwise -- Austin, TX
        bill@...
      • Benji Fisher
        ... That is up to you. My goal is to give you the option of doing it however you want. I guess there is one thing you lose by using my modified menus: the
        Message 3 of 18 , Dec 3, 2001
          On Monday, December 3, 2001, at 11:42 AM, Bill Tschumy wrote:

          > Benji,
          >
          > Thanks for the updated gvimrc. Menu commands seem to be working well
          > now.
          >
          > I'm always a bit unsure whether to use these platform specific (or gui
          > specific) features. I worry that I will lose my muscle memory for
          > using standard Vim. I'll see how it goes.

          That is up to you. My goal is to give you the option of doing it
          however you want. I guess there is one thing you lose by using my
          modified menus: the menus no longer remind you of the standard vim
          keyboard alternatives, they only remind you of the Mac keyboard
          alternatives.

          --Benji Fisher
        • raindog@mediaone.net
          ... kind ... yet? ... Info.plist file ... of ... I did the following just now: 1. downloaded the disk image from homepage.mac.com/fisherbb, mounted it, and
          Message 4 of 18 , Dec 3, 2001
            > On Monday, December 3, 2001, at 07:50 AM, Benji Fisher wrote:
            >
            > > On Sunday, December 2, 2001, at 07:48 PM, raindog@... wrote:
            > >
            > > It would also be nice to be able to drag and drop text files (or any
            kind
            > > of file, for that matter) onto Vim. Has this issue been addressed
            yet?
            > > If not, the way to do it is to add certain keys to Vim.app's
            Info.plist file
            > > that indicate to the Finder which file types Vim is able to edit.
            > > ...
            >
            > I tried copying the TextEdit icon, as you did, and using your version
            of
            > Vim.app/Contents/Resources/txt.icns and I logged out and in again, and
            > it did not work. Did you leave out a step, or am I making a mistake?

            I did the following just now:

            1. downloaded the disk image from homepage.mac.com/fisherbb, mounted it,
            and copied the vim/ folder to a writeable volume

            2. issued these commands from a terminal (NewInfo.plist is the file
            that was attached to the previous message):

            cp NewInfo.plist vim/Vim.app/Contents/Info.plist

            cp /Applications/TextEdit.app/Contents/Resources/txt.icns
            vim/Vim.app/Contents/Resources/

            3. dragged Vim.app out of the vim/ folder, then option-dragged it back in
            to make a new copy.

            I was then able to drag and drop files onto the new copy of Vim.

            Give this procedure a shot--perhaps (3) is a necessary step, and logging
            out
            and back in again isn't sufficient after all (apologies for the
            confusion!).

            RD
          • Benji Fisher
            ... Yes, Step 3 seems to be necessary. It works like a charm, now! I feel much better about distributing a Carbon binary that allows drag-and-drop; thanks!
            Message 5 of 18 , Dec 4, 2001
              On Tuesday, December 4, 2001, at 01:11 AM, raindog@... wrote:
              >
              > I did the following just now:
              >
              > 1. downloaded the disk image from homepage.mac.com/fisherbb, mounted it,
              > and copied the vim/ folder to a writeable volume
              >
              > 2. issued these commands from a terminal (NewInfo.plist is the file
              > that was attached to the previous message):
              >
              > cp NewInfo.plist vim/Vim.app/Contents/Info.plist
              >
              > cp /Applications/TextEdit.app/Contents/Resources/txt.icns
              > vim/Vim.app/Contents/Resources/
              >
              > 3. dragged Vim.app out of the vim/ folder, then option-dragged it back
              > in
              > to make a new copy.
              >
              > I was then able to drag and drop files onto the new copy of Vim.
              >
              > Give this procedure a shot--perhaps (3) is a necessary step, and
              > logging out
              > and back in again isn't sufficient after all (apologies for the
              > confusion!).
              >
              > RD

              Yes, Step 3 seems to be necessary. It works like a charm, now! I
              feel much better about distributing a Carbon binary that allows
              drag-and-drop; thanks!

              How is txt.icns used? I am afraid there might be copyright issues
              if I distribute Vim.app with the version we borrowed from TextEdit.app;
              maybe Douglas Stebila or someone else would be willing to design a new
              icon for us?

              As long as I am editing property lists by hand, maybe I can do
              more. I would like to move the runtime files (vim60/) inside Vim.app,
              and put the executable (Vim.app/Contents/MacOS/Vim) inside the runtime
              folder. That way, I could distribute Vim.app by itself, rather than
              inside a vim/ folder, and whatever folder contained vim60/ would become
              $VIM by default. I tried this a while ago, editing the
              CFBundleExecutable entry in Info.plist, but could not get it to work.
              Does anyone know enough about how this works to help out? (Maybe I did
              not think to try Step 3...)

              --Benji Fisher
            • Douglas Stebila
              ... As per Benji s request above, I have created some document icons for Vim. I have created a plain document icon and one for txt files; icons for other file
              Message 6 of 18 , Dec 4, 2001
                > How is txt.icns used? I am afraid there might be copyright issues
                > if I distribute Vim.app with the version we borrowed from TextEdit.app;
                > maybe Douglas Stebila or someone else would be willing to design a new
                > icon for us?

                As per Benji's request above, I have created some document icons for
                Vim. I have created a plain document icon and one for txt files; icons
                for other file types can easily be created. I have also updated the
                application icon (brightened it up, improved the smaller-sized icons).

                You can download tarballs of the icons (GIMP source, PNGs, and .icns
                files) from my webpage at
                http://mac.douglas.stebila.ca/code/vim/

                If you want other icons or have any suggestions, please let me know.

                ---

                Douglas Stebila
                Email: stebilad@...
              • Dany St-Amant
                ... Nice work, but I think that the V is a bit thin (and thus look weak), in all the Vim icon supplied in the distribution the V is bolder, meaner (showing the
                Message 7 of 18 , Dec 4, 2001
                  Le Mardi 4 décembre 2001, à 08:01 , Douglas Stebila a écrit :

                  >> How is txt.icns used? I am afraid there might be copyright
                  >> issues if I distribute Vim.app with the version we borrowed from
                  >> TextEdit.app; maybe Douglas Stebila or someone else would be willing
                  >> to design a new icon for us?
                  >
                  > As per Benji's request above, I have created some document icons for
                  > Vim. I have created a plain document icon and one for txt files; icons
                  > for other file types can easily be created. I have also updated the
                  > application icon (brightened it up, improved the smaller-sized icons).
                  >
                  > You can download tarballs of the icons (GIMP source, PNGs, and .icns
                  > files) from my webpage at
                  > http://mac.douglas.stebila.ca/code/vim/
                  >
                  > If you want other icons or have any suggestions, please let me know.

                  Nice work, but I think that the V is a bit thin (and thus look weak), in
                  all the Vim icon supplied in the distribution the V is bolder, meaner
                  (showing the power of Vim ;).
                  I also think the 'im' should be also present.

                  I tried to modified your icon (at the same time as I tried Iconographer),
                  You can check the result at:
                  http://www3.sympatico.ca/dany.stamant/vim/appDany.icns.gz

                  I didn't try to use anti-aliasing or any fancy stuff as I don't have the
                  tool and
                  the skill to fully finetuned the icon. For the 'im' I used Apple
                  Chancery, 56 point,
                  italic, bloc, shadow.

                  The document icon fit nicely with the MacOS X various document icons.
                  An alternative for the document icon, would be a big V in the middle,
                  with a green tag in the upper left corner mentioning "TXT" à la Acrobat,
                  or
                  Stuffit

                  Dany,
                • raindog@mediaone.net
                  ... In theory, this is the icon with which documents that were created with Vim are displayed (also documents created with other apps that you subsequently set
                  Message 8 of 18 , Dec 4, 2001
                    On Tuesday, December 4, 2001, at 07:30 AM, Benji Fisher wrote:
                    >
                    > How is txt.icns used?

                    In theory, this is the icon with which documents that were created with
                    Vim
                    are displayed (also documents created with other apps that you
                    subsequently
                    set to "Open with application" Vim from the Finder). In practice, as you
                    probably noticed, this doesn't happen, possibly in part because
                    CFBundleSignature, the "creator code" that's supposed to uniquely
                    identify
                    Vim to the Finder, isn't set. Unfortunately, just setting the creator
                    code in Info.plist and in PkgInfo doesn't solve the problem (not even
                    after a reapplication of the venerable Step 3). You might have to set
                    these from Project Builder, under "Application Settings".

                    Incidentally, here's a tech note that describes some of the settings in
                    Info.plist:
                    <http://developer.apple.com/techpubs/macosx/ReleaseNotes/InfoPlist.html>,
                    and here's more than you probably want to know about the subject:
                    <http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/SoftwareConfig/
                    Information_perty_Lists.html>.

                    > I would like to move the runtime files (vim60/) inside Vim.app, and
                    > put the executable (Vim.app/Contents/MacOS/Vim) inside the runtime
                    > folder. That way, I could distribute Vim.app by itself, rather than
                    > inside a vim/ folder, and whatever folder contained vim60/ would
                    > become $VIM by default.

                    I'm not sure it's wise to tinker with the directory structure of an
                    application. The right place for vim60/ would be inside
                    Vim.app/Contents/Resources/ (or possibly SharedSupport/), but, as you
                    probably realize, that entails modifying the code to point $VIMRUNTIME to
                    that directory. I tried this once before with some success; I might be
                    able to supply a patch, if anyone's interested.

                    RD
                  • Douglas Stebila
                    ... You re right - I knew that it wasn t quite right, but couldn t put my finger on it. ... I tried that out, but problems arise with image resizing. When you
                    Message 9 of 18 , Dec 5, 2001
                      On Tuesday, December 4, 2001, at 11:03 PM, Dany St-Amant wrote:
                      > Nice work, but I think that the V is a bit thin (and thus look weak),
                      > in all the Vim icon supplied in the distribution the V is bolder,
                      > meaner (showing the power of Vim ;).

                      You're right - I knew that it wasn't quite right, but couldn't put my
                      finger on it.

                      > I also think the 'im' should be also present.

                      I tried that out, but problems arise with image resizing. When you put
                      the icon in the dock, it could be sized anywhere from 16x16 to 128x128,
                      and only the thumbnail part of the icon is actually used in the
                      scaling. At 16x16 or even medium sizes like 48x48, the "im" appears
                      like a blob.

                      A lot of other icons that have text in them (Mozilla's M, Internet
                      Explorer's e, Address Books' @, XDarwin's X) all have only one letter
                      and they look okay.

                      > The document icon fit nicely with the MacOS X various document icons.
                      > An alternative for the document icon, would be a big V in the middle,
                      > with a green tag in the upper left corner mentioning "TXT" à la
                      > Acrobat, or
                      > Stuffit

                      There are now two versions of the document icon: the traditional style
                      with the file type below the icon, and the Acrobat style, with the
                      filetype on a tag in the top left. I think the Acrobat style looks much
                      better, but you can decide for yourself. Note that these icon's aren't
                      "finished" as I haven't made the smaller versions of them. I will do
                      that once I get feedback on which is preferred. Also please let me know
                      what filetypes you want icons for.

                      All of the icons are available at
                      http://mac.douglas.stebila.ca/code/vim/

                      Thoughts?

                      ---

                      Douglas Stebila
                      Email: stebilad@...
                    • Ken Scott
                      ... The updated V with the thicker bar looks nice. ... I really, really like the icon with the tag at the top. However, the matching version, without the
                      Message 10 of 18 , Dec 5, 2001
                        On Wed, 5 Dec 2001, Douglas Stebila wrote:

                        > On Tuesday, December 4, 2001, at 11:03 PM, Dany St-Amant wrote:
                        > > Nice work, but I think that the V is a bit thin (and thus look weak),
                        > > in all the Vim icon supplied in the distribution the V is bolder,
                        > > meaner (showing the power of Vim ;).
                        >
                        > You're right - I knew that it wasn't quite right, but couldn't put my
                        > finger on it.
                        >
                        > > I also think the 'im' should be also present.
                        >
                        > I tried that out, but problems arise with image resizing. When you put
                        > the icon in the dock, it could be sized anywhere from 16x16 to 128x128,
                        > and only the thumbnail part of the icon is actually used in the
                        > scaling. At 16x16 or even medium sizes like 48x48, the "im" appears
                        > like a blob.
                        >
                        > A lot of other icons that have text in them (Mozilla's M, Internet
                        > Explorer's e, Address Books' @, XDarwin's X) all have only one letter
                        > and they look okay.
                        >

                        The updated "V" with the thicker bar looks nice.

                        > > The document icon fit nicely with the MacOS X various document icons.
                        > > An alternative for the document icon, would be a big V in the middle,
                        > > with a green tag in the upper left corner mentioning "TXT" à la
                        > > Acrobat, or
                        > > Stuffit
                        >
                        > There are now two versions of the document icon: the traditional style
                        > with the file type below the icon, and the Acrobat style, with the
                        > filetype on a tag in the top left. I think the Acrobat style looks much
                        > better, but you can decide for yourself. Note that these icon's aren't
                        > "finished" as I haven't made the smaller versions of them. I will do
                        > that once I get feedback on which is preferred. Also please let me know
                        > what filetypes you want icons for.
                        >

                        I really, really like the icon with the tag at the top. However, the
                        matching version, without the tag, looks unbalanced (the icon is too low).
                        Is that particular version supposed to be used, or is it just a template
                        for further expansion of file types?

                        As far as filetypes, VIM is guaranteed. I would think that we could
                        potentially need an icon for every filetype that Vim understands syntax
                        for. I'm not sure just how much work that is, or if it would be practical
                        to have Vim registered to be the editor for all those filetypes.

                        Even if the filetypes aren't registered, it might be nice to have the
                        icons available to be used on a file-by-file basis.

                        Thanks for the great work!

                        Ken


                        --
                        ><> Ken Scott kscott@... http://www.pcisys.net/~kscott

                        This is the day that the Lord has made;
                        I will rejoice and be glad in it! -- Psalm 118:24
                      • Benji Fisher
                        ... I agree on all points. Now, why doesn t it work for me? I already edited Vim.app/Contents/Info.plist and I just installed a new txt.icns . When I % open
                        Message 11 of 18 , Dec 5, 2001
                          On Wednesday, December 5, 2001, at 12:49 PM, Ken Scott wrote:

                          > [snip]
                          > The updated "V" with the thicker bar looks nice.
                          > [snip]
                          > I really, really like the icon with the tag at the top. However, the
                          > matching version, without the tag, looks unbalanced (the icon is too
                          > low).
                          > Is that particular version supposed to be used, or is it just a template
                          > for further expansion of file types?
                          >
                          > As far as filetypes, VIM is guaranteed. I would think that we could
                          > potentially need an icon for every filetype that Vim understands syntax
                          > for. I'm not sure just how much work that is, or if it would be
                          > practical
                          > to have Vim registered to be the editor for all those filetypes.
                          >
                          > Even if the filetypes aren't registered, it might be nice to have the
                          > icons available to be used on a file-by-file basis.
                          >
                          > Thanks for the great work!

                          I agree on all points. Now, why doesn't it work for me? I already
                          edited Vim.app/Contents/Info.plist and I just installed a new
                          txt.icns . When I

                          % open txt.icns

                          the new icon comes up in Preview.app, so it looks as though I did not
                          make a mistake there. I tried moving and copying Vim.app, and I tried
                          restarting the Finder. (I did not yet try logging out and in again.) I
                          made a new file foo.txt with Vim.app, but it still has the old icon.

                          --Benji Fisher

                          P.S. I may post a new binary tomorrow, with drag-and-drop enabled.
                          Dany, is there any chance of addressing the problem with :browse real
                          soon?
                        Your message has been successfully submitted and would be delivered to recipients shortly.