Monday, July 14, 2014

Re: How did cygwin compile vim to enable clipboard support while without gui and x

On 2014-07-12, 邹俊洋 wrote:
> Note that vim 7.4 in cygwin has clipboard support enabled, which I
> find is greatly convenient for me to exchange text between windows
> and the terminal. And in my server with Fedora installed, I just
> want to compile a vim with the same clipboard support. According
> to materials I searched, seems that only with gui enabled can the
> clipboard support do. So, is it possible and if it is, how?

In Fedora, or any other "Unix", the clipboard that Vim interacts
with is the X clipboard. To use the clipboard, Vim has to be built
with components that support that interaction, which includes +X11
and apparently a GUI.

In cygwin, the clipboard that Vim interacts with is the Windows
clipboard. The mechanism for interacting with the Windows clipboard
has nothing to do with X, so there is no need for X or GUI support.

You don't need to use the GUI to use Vim with the clipboard on
Fedora. There are a number of ways to do that.

1. Run vim as "gvim -v".
2. If you have Fedora's gvim installed, you probably have vimx
installed as well. Run that.
3. If you have a ~/bin directory, create the following symlink.
ln /usr/bin/gvim ~/bin/vim

Some Linux distributions, including Fedora, ship a different
binaries for vim and gvim. That vim usually does not support X.
That leads newcomers to believe that the GUI version of Vim must be
a different binary that the CLI or terminal version, but that's not
true.

If you're building your own vim anyway, note that the "make install"
step creates the following files in your /usr/local/bin directory.

lrwxrwxrwx ... 3 Aug 12 2013 eview -> vim
lrwxrwxrwx ... 3 Aug 12 2013 evim -> vim
lrwxrwxrwx ... 3 Aug 12 2013 ex -> vim
lrwxrwxrwx ... 3 Aug 12 2013 gview -> vim
lrwxrwxrwx ... 3 Aug 12 2013 gvim -> vim
lrwxrwxrwx ... 3 Aug 12 2013 gvimdiff -> vim
-rwxr-xr-x ... 143 Jul 10 16:02 gvimtutor
lrwxrwxrwx ... 3 Aug 12 2013 rgview -> vim
lrwxrwxrwx ... 3 Aug 12 2013 rgvim -> vim
lrwxrwxrwx ... 3 Aug 12 2013 rview -> vim
lrwxrwxrwx ... 3 Aug 12 2013 rvim -> vim
lrwxrwxrwx ... 3 Aug 12 2013 view -> vim
-rwxr-xr-x ... 2732848 Jul 10 16:02 vim
lrwxrwxrwx ... 3 Aug 12 2013 vimdiff -> vim
-rwxr-xr-x ... 2084 Jul 10 16:02 vimtutor
-rwxr-xr-x ... 15472 Jul 10 16:02 xxd

Note that almost all of those programs are symbolic links to "vim".
On Unix (and unlike on Windows), all the various forms of the Vim
program can use the same binary--Vim runs differently depending on
the name used to invoke it.

If you have the proper dependencies installed and you just build Vim
as

./configure
make
sudo make install

you will get a vim program that uses the clipboard.

HTH,
Gary

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: