cannot run gvim on windows

5,268 views
Skip to first unread message

David Shen

unread,
Mar 7, 2009, 11:50:57 AM3/7/09
to vim...@googlegroups.com
Hi,

I installed cygwin on my vista sp1 system. then I install gvim in
cygwin. I can run vim in cygwin. But when I run gvim, it exits with
error "e233: cannot open display". Does anyone how to fix this?


--
Best Regards,
David Shen

Tom

unread,
Mar 7, 2009, 12:25:38 PM3/7/09
to vim_use
> I can run vim in cygwin. But when I run gvim, it exits with
> error "e233: cannot open display". Does anyone how to fix this?

You're probably trying to run the x windows version but have no x
server running. You could either run x windows or use the native
windows gui version.

tom.

Tony Mechelynck

unread,
Mar 7, 2009, 12:28:48 PM3/7/09
to vim...@googlegroups.com
On 07/03/09 17:50, David Shen wrote:
> Hi,
>
> I installed cygwin on my vista sp1 system. then I install gvim in
> cygwin. I can run vim in cygwin. But when I run gvim, it exits with
> error "e233: cannot open display". Does anyone how to fix this?
>
>

The Cygwin version of gvim requires a Cygwin X server to be running
prior to loading gvim. However, what's wrong with running native-Windows
versions of Vim and gvim, such as those from
https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721
? (Click the clipboard-like icon to see what was compiled-in.)


Best regards,
Tony.
--
When someone says "I want a programming language in which I need only
say what I wish done," give him a lollipop.

Gary Johnson

unread,
Mar 7, 2009, 12:29:13 PM3/7/09
to vim...@googlegroups.com
On 2009-03-08, David Shen wrote:
> Hi,
>
> I installed cygwin on my vista sp1 system. then I install gvim in
> cygwin. I can run vim in cygwin. But when I run gvim, it exits with
> error "e233: cannot open display". Does anyone how to fix this?

gvim on Cygwin does not run as a native Windows application, it
requires an X server to be running. You'll need to install
Cygwin-X or some other X server for Windows to use Cygwin's gvim.

What I do is use Cygwin's vim and Windows' gvim.

Regards,
Gary


Gary Johnson

unread,
Mar 7, 2009, 12:46:53 PM3/7/09
to vim...@googlegroups.com
On 2009-03-07, Tony Mechelynck wrote:

> However, what's wrong with running native-Windows
> versions of Vim and gvim, such as those from
> https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721
> ? (Click the clipboard-like icon to see what was compiled-in.)

The advantages to using Cygwin's vim rather than Windows' vim (not
gvim) is that Cygwin terminals such as rxvt are more versatile than
the Windows console (although you can get third-party Windows
consoles, too) and that from Cygwin's vim you have access to a
Unix-like environment any time vim needs the OS or a shell.

I tried for a while to use Windows' gvim with Cygwin's shell but
found too many cases where it just didn't work quite right. For
example, some Cygwin commands will return the full path names of
files such as

/usr/local/src/foo
/cygdrive/c/bar

and native-Windows gvim can't find them.

Regards,
Gary


Tony Mechelynck

unread,
Mar 7, 2009, 1:07:44 PM3/7/09
to vim...@googlegroups.com

To pass a Cygwin-like path to a Windows-like application, you have to
process it first via cygpath (see "man cygpath"). That's what the
vim72/src/make_cyg.mak does to compile (with Windows Perl) the
if_perl.xs module required by the Perl interface.

What I recommend if you want to run Vim within Cygwin but don't want the
trouble of running an X-server on top of Windows, is to use the Console
version of Cygwin vim. When I was on Windows, I used Cygwin a lot, but
not exclusively, and I used Cygwin vim (started from Cygwin bash),
Windows vim (started from cmd.exe) and Windows gvim (started from
cmd.exe or from a desktop shortcut), as the need arose.


Best regards,
Tony.
--
Crash programs fail because they are based on the theory that, with
nine women pregnant, you can get a baby a month.
-- Wernher von Braun

Gary Johnson

unread,
Mar 7, 2009, 1:19:43 PM3/7/09
to vim...@googlegroups.com
On 2009-03-07, Tony Mechelynck wrote:
> On 07/03/09 18:46, Gary Johnson wrote:
> > On 2009-03-07, Tony Mechelynck wrote:
> >
> >> However, what's wrong with running native-Windows
> >> versions of Vim and gvim, such as those from
> >> https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721
> >> ? (Click the clipboard-like icon to see what was compiled-in.)
> > The advantages to using Cygwin's vim rather than Windows' vim (not
> > gvim) is that Cygwin terminals such as rxvt are more versatile than
> > the Windows console (although you can get third-party Windows
> > consoles, too) and that from Cygwin's vim you have access to a
> > Unix-like environment any time vim needs the OS or a shell.
> >
> > I tried for a while to use Windows' gvim with Cygwin's shell but
> > found too many cases where it just didn't work quite right. For
> > example, some Cygwin commands will return the full path names of
> > files such as
> >
> > /usr/local/src/foo
> > /cygdrive/c/bar
> >
> > and native-Windows gvim can't find them.

> To pass a Cygwin-like path to a Windows-like application, you have to

> process it first via cygpath (see "man cygpath"). That's what the
> vim72/src/make_cyg.mak does to compile (with Windows Perl) the
> if_perl.xs module required by the Perl interface.

Right, but that's only if you're invoking some Windows-like
application from the command line. That doesn't work from within
a Windows application that access files with some internal
mechanism. One example is vim's gf command. Another is vim's
quickfix list.

> What I recommend if you want to run Vim within Cygwin but don't want the
> trouble of running an X-server on top of Windows, is to use the Console
> version of Cygwin vim. When I was on Windows, I used Cygwin a lot, but
> not exclusively, and I used Cygwin vim (started from Cygwin bash),
> Windows vim (started from cmd.exe) and Windows gvim (started from
> cmd.exe or from a desktop shortcut), as the need arose.

That's what I do and what I wrote before.

Regards,
Gary


david...@googlemail.com

unread,
Mar 8, 2009, 9:29:04 PM3/8/09
to vim_use
yeah, gVim for windows is better than gvim in cygwin.
and about the problem, it is my mistake that i did not install x.

Thanks,
David
Reply all
Reply to author
Forward
0 new messages