raising gvim window to front

17 views
Skip to first unread message

rob

unread,
Jan 13, 2008, 11:34:30 AM1/13/08
to vim_use
Hi,

I'm trying to raise the gvim window to the front/foreground after I
open a file through the '--remote ' switch from the command line.

I've tried the following things, none of which has been helpful (I'm
on cygwin, btw):

:au BufWinEnter * call foreground()
Sounds like foreground() is not supported for me.. " {only in the
Win32, Athena, Motif and GTK GUI versions and the Win32 console
version}

:echo remote_expr('GVIM', "foreground()")
Didn't work. Same reason as above.

Tried to send xterm escape sequence ("\e[5t"), that didn't work
either.

Is there any other way to do this?

Thanks for your help!

Tony Mechelynck

unread,
Jan 13, 2008, 12:54:36 PM1/13/08
to vim...@googlegroups.com
rob wrote:
> Hi,
>
> I'm trying to raise the gvim window to the front/foreground after I
> open a file through the '--remote ' switch from the command line.
>
> I've tried the following things, none of which has been helpful (I'm
> on cygwin, btw):
>
> :au BufWinEnter * call foreground()
> Sounds like foreground() is not supported for me.. " {only in the
> Win32, Athena, Motif and GTK GUI versions and the Win32 console
> version}

Hmm... What GUI version _are_ you using? And on which OS and CPU, by the way?

>
> :echo remote_expr('GVIM', "foreground()")
> Didn't work. Same reason as above.
>
> Tried to send xterm escape sequence ("\e[5t"), that didn't work
> either.
>
> Is there any other way to do this?
>
> Thanks for your help!

Best regards,
Tony.
--
There is a theory that states: "If anyone finds out what the universe
is for it will disappear and be replaced by something more bazaarly
inexplicable."

There is another theory that states: "This has already happened ...."
-- Douglas Adams, "Hitch-Hikers Guide to the Galaxy"

rob

unread,
Jan 14, 2008, 9:53:22 AM1/14/08
to vim_use
- Cygwin on XP

- VIM - Vi IMproved 7.1 (2007 May 12, compiled May 15 2007 20:47:04)
Included patches: 1-2




On Jan 13, 12:54 pm, Tony Mechelynck <antoine.mechely...@gmail.com>
wrote:

Tony Mechelynck

unread,
Jan 15, 2008, 7:45:43 AM1/15/08
to vim...@googlegroups.com

- 7.1.002 is already rather old: there has been 227 additional patches since
then. There is bound to be at least _some_ bugfixes among them that you'd want
to have. The summary of those patches (one line for each) is at
http://ftp.vim.org/pub/vim/patches/7.1/README

- Cygwin X GUI or native-Windows GUI? Hm, probably Cygwin X since you're
implying you're not using Win32 Vim. For the latter, see
https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721
; for Cygwin X, I guess you would have to compile Vim yourself if you want a
more recent version -- unless you switch to the above-mentioned native-Windows
distro. And if you do compile it yourself, pick a different GUI flavour such
as GTK2 or even Motif. You didn't say, BTW, _which_ flavour of gvim for Cygwin
X you were using: if it is none of Athena, Motif, GTK1 and GTK2, then what is it?

See also:
http://vim.wikia.com/wiki/Running_the_win32-version_of_Vim_from_cygwin
http://vim.wikia.com/wiki/Run_native-Windows_Vim_from_cygwin_without_a_wrapper

Note that these do not address the |clientserver| facility, since Win32 gvim
would, I suppose, not respond to X messages. But why not use
--remote-<something> from the cmd.exe prompt?

- Using a gvim for native-Win32 would also allow you to use the foreground()
function. With GTK2 for Cygwin I'm less sure: it might bring gvim to the front
relatively to other Cygwin apps, but would it work if you had other _Windows_
apps running too?


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
236. You start saving URL's in your digital watch.

rob

unread,
Jan 15, 2008, 10:10:48 AM1/15/08
to vim_use
Thanks! I'll play around some more.
Reply all
Reply to author
Forward
0 new messages