Compiling vim with xterm_clipboard support

6

2

I checked out latest vim7 from cvs repository.

cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout vim7

I tried:

./configure --enable-xterm_clipboard

but I got -

WARNING: unrecognized options --enable-xterm_clipboard

I tried:

./configure --with-x

but I got -

configure: error: unrecognized option: --with_x.

Can someone please tell me the correct way to configure with xterm_clipboard support?

Edit

I tried ./configure --with-feature=normal --with-x --with-gui in the src directory, but got WARNING: unrecognized options --with-feature, --with-gui at the end.

JP19

Posted 2011-01-20T05:28:15.643

Reputation:

See also: https://stackoverflow.com/q/11416069/5951320

– Ash – 2018-08-22T18:05:00.713

Answers

8

by looking at src/feature.h you can see that:

#ifdef FEAT_GUI
# ifndef FEAT_CLIPBOARD
#  define FEAT_CLIPBOARD
#  ifndef FEAT_VISUAL
#   define FEAT_VISUAL
#  endif
# endif
#endif

#if defined(FEAT_NORMAL) && defined(FEAT_VISUAL) \
    && (defined(UNIX) || defined(VMS)) \
    && defined(WANT_X11) && defined(HAVE_X11)
# define FEAT_XCLIPBOARD
# ifndef FEAT_CLIPBOARD
#  define FEAT_CLIPBOARD
# endif
#endif
  • having --with-features=normal
  • having --enable-gui
  • having --with-x

you should get your xterm-clipboard

akira

Posted 2011-01-20T05:28:15.643

Reputation: 52 754

works flawless on my server right now. – akira – 2011-01-20T06:43:00.687

Thanks, this is useful. However as I said, --with-x is giving error at top level, --with-feature, --with-gui are giving error if I run configure in src directory. – None – 2011-01-20T06:43:51.563

are you doing configure at top level? – None – 2011-01-20T06:44:16.913

yes. cvs yada yada; cd vim7; ./configure --with-x – akira – 2011-01-20T06:48:32.583

argh :(. Doesn't work for me. I suppose you checked out same version as me cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout vim7. Thanks for the help though – None – 2011-01-20T07:00:33.407

1did you notice i fixed --with-features and --enable-gui (instead of --with-gui)? – akira – 2011-01-20T07:54:38.533

Indeed I did not :). This works now! – None – 2011-01-20T08:02:53.243

--with-features=normal is default, and doesn't need to be set. Using --with-features=big or --with-features=huge will include all of the "normal" features too. – kristi – 2012-07-02T19:19:40.297

7

To easiest way to get vim working with xterm_clipboard is:

sudo apt-get install vim-gnome

Marcelo

Posted 2011-01-20T05:28:15.643

Reputation: 79

1is this just for Ubuntu? – Eric Brotto – 2012-06-22T11:36:52.543

1This enables support for xterm_clipboard also for the console version of vim (on Ubuntu systems). – Tim – 2013-10-17T16:28:40.560

5

On Ubuntu, the flags above worked for me, but I also had to install the xorg-dev package

sudo apt-get install xorg-dev

./configure --with-x --enable-gui=auto  --with-features=huge

chrismar035

Posted 2011-01-20T05:28:15.643

Reputation: 203

1

It looks like you aren't running configure in the src directory, but rather one level up. If you do chdir src; configure --with-x it should work okay.

But keep in mind two points:

  1. With Vim, the preferred way of modifying configure options is to modify src/Makefile
  2. The default is to enable the GUI, and thus +xterm_clipboard, and as far as I know you can't have +xterm_clipboard without the GUI being compiled in.

Heptite

Posted 2011-01-20T05:28:15.643

Reputation: 16 267

Yes, indeed I was running it at top level as usually thats recommended. I will try in src directory. (and also see the Makefile - I don't know changes there are preferred for vim). – None – 2011-01-20T06:38:36.050

@Heptite: you can have clipboard without the gui, all you need is X. folks working mostly in xterm would be very unhappy otherwise :) – akira – 2011-01-20T06:50:08.793

@akira: I have edited my post to clarify my statement: I believe you must have a GUI compiled in to have the +xterm_clipboard feature available. – Heptite – 2011-01-20T20:05:38.693

1your statement was clear, and i thought mine was clear as well: you do not need --enable-gui to have +xterm_clipboard: here, selfcompiled seconds ago: "VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jan 21 2011 08:17:30) ... Normal version without GUI. ... +xsmp_interact +xterm_clipboard -xterm_save". all thats needed to have +xterm_clipboad is './configure --with-x --with-features=normal' – akira – 2011-01-21T07:20:49.400

Ah, I stand (sit) corrected. It's been a long time since I've bothered to compile Vim without a GUI. – Heptite – 2011-01-21T10:04:01.983

@Heptite: this was the first time ever i compiled vim myself. for such nonsense binary packages exists :) – akira – 2011-01-21T17:09:56.930

0

I use this solution. I like to copy and paste over the clipboard with vim(very nice for copy between two remote vim session) Most distro don't compile vim with clipboard support(slackware for example) but compile gvim with clipboard support(slackware again). So simply use gvim,after edit .vimrc with this line(if you want like me to copy over vim)

set clipboard=unnamedplus

And for console without x or for people who don't like gui?

gvim -v

elbarna

Posted 2011-01-20T05:28:15.643

Reputation: 148