On Saturday, November 2, 2013 3:42:14 PM UTC+1, Albert Zeyer wrote:
> On Saturday, November 2, 2013 11:52:19 AM UTC+1, Tony Mechelynck wrote:
> > On Friday, November 1, 2013 9:29:03 PM UTC+1, Albert Zeyer wrote:
> > > Hi,
> > > 
> > > I want to be able to click on URLs I see in MacVim so that it opens the 
> > > URL with the responsible application (e.g. a http link with my default 
> > > browser). How can I do that? Is that possible?
> > > 
> > > Regards,
> > > Albert
> > 
> > A valid URL cannot include spaces (they must be replaced by %20), so if it 
> > is itself between spaces, "+yiW (with the cursor anywhere on it) will yank 
> > it to the clipboard. Similarly "+yi< or "+yi> if it is between <>, etc., 
> > see ":help object-motions". Then you can paste it into your favourite 
> > browser's URL bar.
> > 
> > This question (or at least this answer) applies to vim (compiled with 
> > +clipboard, of course) on any platform, not just on the Mac, so it should 
> > have been asked on the vim_use group.
> > 
> > Best regards,
> > Tony.
> > -- 
> > A "No" uttered from deepest conviction is better and greater than a
> > "Yes" merely uttered to please, or what is worse, to avoid trouble.
> >             -- Mahatma Gandhi
> 
> Thanks for the answer.
> 
> But I really want to click on it with my mouse cursor. Also, it should not be 
> pasted to the clipboard; I want it to open the responsible application right 
> away automatically. As if you click a link in any other application.
> 
> This is MacVim specific, I think.
> 
> Best regards,
> Albert

If Sylvain's answer (below) is not good enough for you, then remember that Vim 
is keyboard-oriented: it was first released to the public 22 years ago, with a 
tradition that already then went back 15 years. At those times, a mouse was 
something rare or even unheard of in a computer room, except maybe as a tiny 
grey mammal that should never have been allowed to get in. So everything that 
Vim can do, it can do with the keyboard, and even with a keyboard lacking arrow 
keys and numeric keypad; if these are present, it can use them; it can also use 
the mouse, but not to do anything.

You can set up mappings for the mouse by using the <> names laid out under 
:help mouse-overview and :help double-click, but only to do things that Vim can 
already do by other means. For instance you could set up

:map <LeftMouse> yiW

to click anywhere and copy that Word (anything between spaces) to the 
"nameless" register but that wouldn't invoke the OS-defined helper application 
for it, and in addition it would obscure the (IMHO more useful) use of a left 
click to position the cursor.

Other than that, I cannot help you here. I just wonder why you are dead set on 
clicking to invoke any possible responsible program for whatever would happen 
to be under the mouse pointer: see among others the last item under :help 
design-not. With Vim, it often happens that best results are obtained by 
keeping an open mind, and accepting solutions that achieve the desired 
(long-term) result, or something close enough to it, by ways totally different 
from one had in mind at the outset.


Best regards,
Tony.
-- 
        THE LESSER-KNOWN PROGRAMMING LANGUAGES #10: SIMPLE

SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming Language
Environment.  This language, developed at the Hanover College for
Technological Misfits, was designed to make it impossible to write code
with errors in it.  The statements are, therefore, confined to BEGIN,
END and STOP.  No matter how you arrange the statements, you can't make
a syntax error.  Programs written in SIMPLE do nothing useful.  Thus
they achieve the results of programs written in other languages without
the tedious, frustrating process of testing and debugging.

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to