17

It seems to me that neither "+p nor "*p works for me. How can I know if my Vim is installed and set up properly to make them available? And if it's not set up, what can I do to set it up?

I'm running Fedora 20 with Mate 18.1. I've installed the vim-enhanced and vim-x11 packages.

And my Vim version:

$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 13 2014 08:56:57)
Included patches: 1-207, 209-475
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         +gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
-clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python/dyn      +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      +lua/dyn         +rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        +mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags  -Wl,-z,relro  -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl  -lselinux  -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags  -fstack-protector  -L/usr/lib64/perl5/CORE -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc       
  • possible duplicate of How can I copy text to the system clipboard from Vim? – derobert Feb 20 '15 at 17:37
  • @Carpetsmoker in that case, VtC'ing as "duplicate". That'll give us the "This question already has an answer here (link to your question)" message, which is now fully accurate. – derobert Feb 20 '15 at 17:38
  • @yo' I don't think closed as duplicate get auto-deleted. They shouldn't! Just in case, upvoted so it'll have a positive score. – derobert Feb 20 '15 at 17:40
  • @yo' BTW: meta.stackexchange.com/a/177675/27727 confirms that closed as duplicate don't get auto-deleted. Not sure if there is really much more detailed information to provide (e.g., how to actually install a package using yum/rpm/etc. is probably better asked on Unix & Linux.) – derobert Feb 20 '15 at 17:43
  • (Tried to move to chat, but that just popped up an error. Oh well). @yo' I guess if there is really more to say other than "you need to install vim-x11 and run vimx" ... go ahead and answer it here and I'll retract my close vote. – derobert Feb 20 '15 at 17:47
25

So, installing vim-enhanced and vim-X11 is enough, but is not at the same time. To enable the system funtcions like +clipboard, you moreover need to use the vimx executable rather than vim or vi (even though they are probably identical, the name changes the behaviour).

One way how to do that permanently is by adding aliases in your .bashrc file:

alias vi='vimx'
alias vim='vimx'

The complete list of features that get enabled this way is: +balloon_eval, +browse, +clientserver, +clipboard, +dnd, +mouseshape, +toolbar, +X11, +xim, +xsmp_interact, +xterm_clipboard, +xpm.

However, some of them are probably irrelevant for the terminal version of vimx and only do something for GVim.

Information on how to use the +clipboard feature is in How can I copy text to the system clipboard from Vim?

  • I might recommend using "gvim -v" instead of vimx as it's a bit more portable. It works on SuSE Linux where regular vim lacks X11 support and it also won't break on Debian/Ubuntu if used across systems. – penguin359 Jul 16 '18 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.