Re: Interacting with a Ruby program

2010-03-25 Thread Chris Eidhof
I'm not sure if it helps, but you could do it the other way around. MacVim 
implements the client part of the ODB editor suite [1]. So you could have a 
MacRuby program that implements the server part and then call MacVim.

Alternatively, it shouldn't be to hard to patch MacVim to implement the server 
part of the ODB Editor Suite as well. Then the MacRuby program has to implement 
the client part.

-chris

[1]: http://www.barebones.com/support/develop/odbsuite.html

On 24 mrt 2010, at 22:32, björn wrote:

> On 23 March 2010 14:09, Andrew Stewart wrote:
>> 
>> I'd like to get MacVim to give focus to a MacRuby program, which
>> accepts some input from the user via a GUI and then returns the input
>> (and focus) back to MacVim.
>> 
>> Right now I can get MacVim to execute a non-interactive Ruby program,
>> though when I try a console-based interactive Ruby program it simply
>> blocks MacVim indefinitely.  I think this is because the Ruby is
>> trying to interact with the user via stdin, and there's no console as
>> such when the program is launched via MacVim.  However I don't want to
>> get bogged down with this because my real aim is to interact with the
>> user via a MacRuby GUI.
>> 
>> So I just wanted to ask, before I embark on this, is it feasible?  If
>> so, what's the recommended way to launch another program and wait for
>> it to return something to MacVim?
> 
> To open some other GUI program you could use (from within MacVim):
> 
> :!open -a ProgramName filename
> 
> Maybe that's enough for your needs.  As far as I know there is no
> universal way on Mac OS X to wait for a GUI app to finish (let alone
> return focus to the calling program).
> 
> 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
> 
> To unsubscribe from this group, send email to 
> vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
> "REMOVE ME" as the subject.

-- 
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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Interacting with a Ruby program

2010-03-25 Thread björn
On 25 March 2010 19:10, Peter Palmreuther wrote:
> Am 24.03.10 22:32, schrieb björn:
>> To open some other GUI program you could use (from within MacVim):
>>
>> :!open -a ProgramName filename
>>
>> Maybe that's enough for your needs.  As far as I know there is no
>> universal way on Mac OS X to wait for a GUI app to finish (let alone
>> return focus to the calling program).
>
> I don't know about OS X < 10.6, but over here 'man open' gives
>
> [...]
>     -W  Causes open to wait until the applications it opens
>         (or that were already open) have exited. [...]
>
> And 'open -a MacVim -W file.txt' in fact gives focus to running MacVim
> instance and opens 'file.txt' in a new tab. After quitting MacVim terminal
> (iTerm) prompt returns to 'input state'.

Thanks Peter for pointing that out -- I was not aware of this flag.

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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Interacting with a Ruby program

2010-03-25 Thread Peter Palmreuther
Am 24.03.10 22:32, schrieb björn:
> To open some other GUI program you could use (from within MacVim):
> 
> :!open -a ProgramName filename
> 
> Maybe that's enough for your needs.  As far as I know there is no
> universal way on Mac OS X to wait for a GUI app to finish (let alone
> return focus to the calling program).

I don't know about OS X < 10.6, but over here 'man open' gives

[...]
 -W  Causes open to wait until the applications it opens
 (or that were already open) have exited. [...]

And 'open -a MacVim -W file.txt' in fact gives focus to running MacVim
instance and opens 'file.txt' in a new tab. After quitting MacVim terminal
(iTerm) prompt returns to 'input state'.

That's not making any statement about "focus returning", sure.

Having MacVim opened ':!open -a TextEdit -W %' opens current file in TextEdit
and waits until TextEdit is closed. Sure, this example is quiet silly, but for
demonstration purposes it seemed to be good enough to me :-)
-- 
Regards,

Peter Palmreuther

-- 
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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: How do I open a file from the Terminal into MacVim's current window?

2010-03-25 Thread Andrew Stewart


On 24 Mar 2010, at 21:30, björn wrote:

In the Terminal:

   $ open "mvim://open?url=file:///path/to/file"

And this respects the MacVim preference.

If there's a more direct way I'd like to hear it...but for now this
will do.


If you have the above preference set it is enough to simply use:

open -a MacVim.app filename1 filename2

etc.


Oh yes, so it does.

So to summarise, given a MacVim instance in the background, and focus  
in the Terminal:


* `open -a MacVim.app filename1` will open filename1 in the existing  
MacVim window.

* `mvim filename1` will open filename1 in a new MacVim window.

Presumably the mvim URL handler opens in the existing (rather than a  
new) MacVim window because it wraps the `open -a` mechanism?




If you have several windows open and want to specify which one to open
a file in you need to use the --remote and --servername arguments to
the "mvim" script (see ":h mvim"), e.g.

mvim --servername VIM --remote filename

(The server name can be gleaned from the window title.)


That's useful to know, thank you.

Cheers,
Andy

---
http://airbladesoftware.com

--
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

To unsubscribe from this group, send email to vim_mac+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: Interacting with a Ruby program

2010-03-25 Thread Andrew Stewart


On 24 Mar 2010, at 21:32, björn wrote:

To open some other GUI program you could use (from within MacVim):

:!open -a ProgramName filename


Thank you, that's perfect.



Maybe that's enough for your needs.  As far as I know there is no
universal way on Mac OS X to wait for a GUI app to finish (let alone
return focus to the calling program).



OK, well knowing that is in itself useful.

Cheers,

Andy Stewart
---
http://airbladesoftware.com

--
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

To unsubscribe from this group, send email to vim_mac+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: FuzzyFinder both works and don't

2010-03-25 Thread björn
On 25 March 2010 17:43, xdanielgs wrote:
>> I have a problem that I can't solve and would really appreciate some
>> assistance. I'm quite new to vim so maybe it's really simple, but I
>> can't figure out were it's going wrong or where I'm doing something
>> wrong.
>>
>> I have installed the latest version (3.3) of the plugin FuzzyFinder
>> http://www.vim.org/scripts/script.php?script_id=1984
>>
>> If I use the version of vim that comes with osx the plugin works fine.
>> If I uses the script mvim that comes with macvim the plugin works
>> fine.
>> If I use my alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -
>> g' the plugin works fine.
>> If I start MacVim using open /Applications/MacVim.app the plugin works
>> fine.
>>
>> But if I start macvim from either Spotlight or Finder the plugin gives
>> me the following error when for example I try to invoke it
>> using :FufFile:
>> Error detected while processing function fuf#onComplete..
>> 11..25..fuf#filterMatchesAndMapToSetRanks..4_setRanks..4_scoreBoundaryMatching:
>> line4:
>> E806: using Float as a String
>>
>> I'm running snapshot 50 of MacVim on SnowLeopard.
>> I have tried to move both .vimrc, .gvimrc and .vim/ and then
>> reinstalling the plugin.
>> I have also tired with the setting "Launch Vim processes in a login
>> shell" both on and off.
>
> I am having the exactly same problem. My setup is:
>
> Mac OS X Snow Leopad 10.6.2
> MacVim Snapshot 52
> FuzzyFinder 3.5

Please contact the plugin author and ask what the error message means
-- I'm guessing the plugin can be fixed to deal with this problem.

I don't know why the plugin would not work when MacVim is launched
from the Finder...most likely some part of it depends on some
environment variable being set, but I don't know which (the plugin
author might).

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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: FuzzyFinder both works and don't

2010-03-25 Thread xdanielgs

I am having the exactly same problem. My setup is:

Mac OS X Snow Leopad 10.6.2
MacVim Snapshot 52
FuzzyFinder 3.5


Wraul wrote:
> 
> 
> Hi
> I have a problem that I can't solve and would really appreciate some
> assistance. I'm quite new to vim so maybe it's really simple, but I
> can't figure out were it's going wrong or where I'm doing something
> wrong.
> 
> I have installed the latest version (3.3) of the plugin FuzzyFinder
> http://www.vim.org/scripts/script.php?script_id=1984
> 
> If I use the version of vim that comes with osx the plugin works fine.
> If I uses the script mvim that comes with macvim the plugin works
> fine.
> If I use my alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -
> g' the plugin works fine.
> If I start MacVim using open /Applications/MacVim.app the plugin works
> fine.
> 
> But if I start macvim from either Spotlight or Finder the plugin gives
> me the following error when for example I try to invoke it
> using :FufFile:
> Error detected while processing function fuf#onComplete..
> 11..25..fuf#filterMatchesAndMapToSetRanks..4_setRanks..4_scoreBoundaryMatching:
> line4:
> E806: using Float as a String
> 
> I'm running snapshot 50 of MacVim on SnowLeopard.
> I have tried to move both .vimrc, .gvimrc and .vim/ and then
> reinstalling the plugin.
> I have also tired with the setting "Launch Vim processes in a login
> shell" both on and off.
> 
> Thanks
> Wraul
> 
> --~--~-~--~~~---~--~~
> You received this message from the "vim_mac" maillist.
> For more information, visit http://www.vim.org/maillist.php
> -~--~~~~--~~--~--~---
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/FuzzyFinder-both-works-and-don%27t-tp25954166p28031631.html
Sent from the Vim - Mac mailing list archive at Nabble.com.

-- 
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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Execute ruby file

2010-03-25 Thread devVim
Yeah thanks bjorn, last night I was able to figure that out, I used
the :h Rubyf filename and it worked out great,.


Regards

On Mar 24, 4:35 pm, björn  wrote:
> On 24 March 2010 11:13, devVim wrote:
>
>
>
> > How do I execute my ruby file in macvim.`Do I have to set anything in
> > echo $PATH? This what it contains
> > /Users/musdev/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/
> > local/mysql/bin:/usr/lib:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin
> > :/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
> > Where exactly can I find this file? Thanks
>
> Have you tried
>
> :rubyfile filename
>
> ?  Check out ":h ruby".
>
> 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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Built from git and can't type an octothorpe

2010-03-25 Thread Craig
On Mar 24, 9:23 pm, björn  wrote:
> On 22 March 2010 09:38, Craig wrote:
>
>
>
> > thanks for helping with this.
> > :se macmeta?
> > does indeed return nomacmeta
> > The superscript 3 appears with both renderers (quit in between
> > changing preferences)
>
> > I ran what you said and you can clearly see in the log below that I
> > ran MacVim and typed i3
> > In fact now that I look in the logs I can see comment about
> > MACMETA :-)
>
> How strange...I've not got any time at the moment to look at this, but
> thanks for the logs...I'll take a look when I get some time.
>
> This may sound silly, but have you tried cleaning the project and
> rebuilding?  It often helps with weird things like this (snapshot 52
> uses exactly the same code as the latest commit in the git repo).
>
> Björn

Hi Björn,

It doesn't sound silly at all, especially because IT WORKED! :D

Thanks for that, you can bet the next time I build form git I'll clean
first. ;-)

Cheers
-C

-- 
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

To unsubscribe from this group, send email to 
vim_mac+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.