the -c argument

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

the -c argument

Elben Shira
Hi, I want to write a script that opens up macvim and automatically
runs a command. In vim, I run this:

$ /Applications/MacVim.app/Contents/MacOS/Vim -c ":setfiletype
clojure"

Then, I run ":set filetype" and see that "filetype=clojure". So this
works.

But with macvim:

$ /Applications/MacVim.app/Contents/MacOS/MacVim -c ":setfiletype
clojure"

I run ":set filetype" and see "filetype=", meaning it didn't work.

Any ideas?

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: the -c argument

Benjamin Esham
Elben Shira wrote:

> Hi, I want to write a script that opens up macvim and automatically runs a
> command. In vim, I run this:
>
> $ /Applications/MacVim.app/Contents/MacOS/Vim -c ":setfiletype clojure"
>
> Then, I run ":set filetype" and see that "filetype=clojure". So this
> works.
>
> But with macvim:
>
> $ /Applications/MacVim.app/Contents/MacOS/MacVim -c ":setfiletype clojure"
>
> I run ":set filetype" and see "filetype=", meaning it didn't work.
>
> Any ideas?

Hi Elben,

I'm not actually sure of the distinction between running .../Vim and
.../MacVim, but if you invoke .../Vim with the -g flag, e.g.

  $ /Applications/MacVim.app/Contents/MacOS/Vim -gc "se ft=clojure"

you get the desired behavior (i.e. a GUI and the correct filetype).

--
Benjamin D. Esham   |   [hidden email]
“Given that sooner or later we’re all just going to die, what’s
the point of learning about integers?”                  — Calvin

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: the -c argument

Björn Winckler
On 18 July 2010 05:46, Benjamin Esham wrote:

> Elben Shira wrote:
>
>> Hi, I want to write a script that opens up macvim and automatically runs a
>> command. In vim, I run this:
>>
>> $ /Applications/MacVim.app/Contents/MacOS/Vim -c ":setfiletype clojure"
>>
>> Then, I run ":set filetype" and see that "filetype=clojure". So this
>> works.
>>
>> But with macvim:
>>
>> $ /Applications/MacVim.app/Contents/MacOS/MacVim -c ":setfiletype clojure"
>>
>> I run ":set filetype" and see "filetype=", meaning it didn't work.
>>
>> Any ideas?
>
> Hi Elben,
>
> I'm not actually sure of the distinction between running .../Vim and
> .../MacVim, but if you invoke .../Vim with the -g flag, e.g.
>
>  $ /Applications/MacVim.app/Contents/MacOS/Vim -gc "se ft=clojure"
>
> you get the desired behavior (i.e. a GUI and the correct filetype).

Never call the MacVim binary directly!  The correct way to start
MacVim is using the -g flag to Vim as Benjamin points out.  Read up on
":h macvim-start".

Björn

--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php