(g)vim as default application under OSX Tiger

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

(g)vim as default application under OSX Tiger

Daniele Venzano
I'm having big troubles trying to set Vim (from macvim.org) as default
editor for any file type (in particular I tried with .txt and .py).
I can set Vim as editor in a per file basis, but when I try to set the
default it reverts back to Apple's TextEdit, without errors or messages
of any kind.

I find this behaviour of Tiger quite disturbing, as it refuses to do a
really simple operation. I tried playing with the info.plist file,
managing to get Vim in the 'open with' menu, but still no success on
the default setting.

Any idea ?

Thanks.
--
Daniele Venzano
http://www.brownhat.org

Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Chris Devers
On Wed, 25 May 2005, Daniele Venzano wrote:

> I'm having big troubles trying to set Vim (from macvim.org) as default
> editor for any file type (in particular I tried with .txt and .py).

RCDefaultApp may help you:

    RCDefaultApp is a Mac OS X 10.2 or higher preference pane that
    allows a user to set the default application used for various
    URL schemes, file extensions, file types, and MIME types. MacOS
    X uses the extension and file type settings to choose the
    application when opening a file in Finder, while Safari and
    other applications use the URL and MIME type settings at other
    times for content not related to a file (such as an unknown URL
    protocol, or a media stream).

    Finder's Get Info panel can be used to set the default application
    for file extensions and file types, but it's not intuitive.
    Apple's Internet preference pane in MacOS X 10.0 through 10.2
    (Jaguar) allowed you to set the Web and Email applications, but
    no other URL handlers. In MacOS X 10.3 (Panther), these settings
    have moved to Safari's and Mail's preferences -- meaning you
    have to run those applications if you want to choose to not use
    them. RCDefaultApp allows the setting of all of this information,
    and ties everything together in one preference pane.

    RCDefaultApp also allows entries to be disabled, such as URL
    schemes that have security issues ;-)

<http://www.rubicode.com/Software/RCDefaultApp/>



--
Chris Devers
Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Stephen Riehm
Hi Chris,

On 26 May 2005, at 6:41, Chris Devers wrote:

> On Wed, 25 May 2005, Daniele Venzano wrote:
>
>> I'm having big troubles trying to set Vim (from macvim.org) as  
>> default
>> editor for any file type (in particular I tried with .txt and .py).
>>
>
> RCDefaultApp may help you:
> <http://www.rubicode.com/Software/RCDefaultApp/>

OK, so it may have little to do with vim, but it's a great tip!
Thanks!

Steve

Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Daniele Venzano
In reply to this post by Chris Devers
On 25/mag/05, at 22:41, Chris Devers wrote:
> On Wed, 25 May 2005, Daniele Venzano wrote:
>
>> I'm having big troubles trying to set Vim (from macvim.org) as default
>> editor for any file type (in particular I tried with .txt and .py).
>
> RCDefaultApp may help you:

It behaves in the exact same way. I select Vim and it sets TextEdit.
This happens with both Vim 6.3 and 7.0.

Does anyone have a working 'vim as default .txt editor' setting under
Tiger ?

Thanks.
--
Daniele Venzano
http://www.brownhat.org

Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Daniele Venzano
In reply to this post by Daniele Venzano
I succeeded in setting Vim as default by modifying the info.plist  
file. The distributed info.plist is missing a CFBundleIdentifier  
node, setting it to some unique value permits to OSX to identify Vim  
and refer to it in the preference files.
Attached you find my info.plist file that also publishes Vim as  
Editor for the following extensions:
.txt .text .py .tex .bib .c .cpp .h .html .htm .php

Bye.

--
Daniele Venzano
http://www.brownhat.org


Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Stephen Riehm
Hi Daniele,

Sadly... all attachments are stripped on this mailing list.
Could you send it again, maybe as part of the test (ie: copy/paste it  
into your message instead of attaching?)

Thanks (on behalf of all here :-),

Steve

On 27 May 2005, at 20:51, Daniele Venzano wrote:

> I succeeded in setting Vim as default by modifying the info.plist  
> file. The distributed info.plist is missing a CFBundleIdentifier  
> node, setting it to some unique value permits to OSX to identify  
> Vim and refer to it in the preference files.
> Attached you find my info.plist file that also publishes Vim as  
> Editor for the following extensions:
> .txt .text .py .tex .bib .c .cpp .h .html .htm .php
>
> Bye.
>
> --
> Daniele Venzano
> http://www.brownhat.org
>
>

Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Daniele Venzano
On 28/mag/05, at 03:49, Stephen Riehm wrote:
> Sadly... all attachments are stripped on this mailing list.
> Could you send it again, maybe as part of the test (ie: copy/paste it
> into your message instead of attaching?)

I've uploaded it to:
http://www.brownhat.org/rlieh/Info.plist

The icons I used are not provided as I've taken them from various
sources (mainly art.gnome.org and kde-look.org) and I'm not sure on the
different licences that should be applied for redistribution.

Bye.
--
Daniele Venzano
http://www.brownhat.org

Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Antti Holvikari
On May 28, 2005, at 11:32 PM, Daniele Venzano wrote:
> I've uploaded it to:
> http://www.brownhat.org/rlieh/Info.plist

Which Info.plist is this? Where should I put it?
Reply | Threaded
Open this post in threaded view
|

Re: (g)vim as default application under OSX Tiger

Stephen Riehm

On 30 May 2005, at 1:06, Antti Holvikari wrote:

> On May 28, 2005, at 11:32 PM, Daniele Venzano wrote:
>
>> I've uploaded it to:
>> http://www.brownhat.org/rlieh/Info.plist
>
> Which Info.plist is this? Where should I put it?

It goes in /Applications/Vim.app/Contents/info.plist.
BUT KEEP THE ORIGINAL!

At first when I tried it it seemed to work just fine, then I found  
that when I started gvim from the command line, it would run, but I  
couldn't get the focus into the vim window. vim also didn't show up  
when I tried to switch to it via apple-tab.

I compared my old and new info.plist's and discovered a few  
differences. When I returned these values to their original values,  
vim worked again as it used to.

Here's the output from diff -u to fix Daniele's Info.plist:

--- Info.plist.ckpt     2005-05-29 06:28:48.000000000 +1000
+++ Info.plist  2005-06-01 16:12:29.000000000 +1000
@@ -134,15 +134,15 @@
                 </dict>
         </array>
         <key>CFBundleExecutable</key>
-       <string>gvim</string>
+       <string>Vim</string>
         <key>CFBundleIconFile</key>
-       <string>appIcon.icns</string>
+       <string>gui_mac.icns</string>
         <key>CFBundleIdentifier</key>
         <string>com.macvim.gvim</string>
         <key>CFBundleInfoDictionaryVersion</key>
         <string>6.0</string>
         <key>CFBundleName</key>
-       <string>gvim</string>
+       <string>Vim</string>
         <key>CFBundlePackageType</key>
         <string>APPL</string>
         <key>CFBundleShortVersionString</key>

I also noticed that Daniele put entries in there for python scripts  
etc... you may like to also add entries for perl or other file types  
that you may need personally ;-)

Either way, thanks Daniele!

Steve