In my local PC I use p in Vim command mode for pasting and it works fine and the :echo has('clipboard') returns 1.
But, in the cluster I am working p in command mode, which just inserts a 0 instead of pasting and echo has('clipboard') returns 0.
I suppose I have to modify my .vimrc file.
I tried:
nnoremap p "0p"
and:
"*p
but with no result.
:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08)
Included patches: 1-207, 209-629
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI. Features included (+) or not (-):
+acl +cscope +folding +menu +netbeans_intg -sniff +virtualedit
+arabic +cursorbind -footer +mksession +path_extra +startuptime +visual
+autocmd +cursorshape +fork() +modify_fname +perl +statusline +visualextra
-balloon_eval +dialog_con +gettext +mouse +persistent_undo -sun_workshop +viminfo
-browse +diff -hangul_input -mouseshape +postscript +syntax +vreplace
++builtin_terms +digraphs +iconv +mouse_dec +printer +tag_binary +wildignore
+byte_offset -dnd +insert_expand +mouse_gpm +profile +tag_old_static +wildmenu
+cindent -ebcdic +jumplist -mouse_jsbterm +python/dyn -tag_any_white +windows
-clientserver +emacs_tags +keymap +mouse_netterm -python3 -tcl +writebackup
-clipboard +eval +langmap +mouse_sgr +quickfix +terminfo -X11
+cmdline_compl +ex_extra +libcall -mouse_sysmouse +reltime +termresponse -xfontset
+cmdline_hist +extra_search +linebreak +mouse_urxvt +rightleft +textobjects -xim
+cmdline_info +farsi +lispindent +mouse_xterm +ruby/dyn +title -xsmp
+comments +file_in_path +listcmds +multi_byte +scrollbind -toolbar -xterm_clipboard
+conceal +find_in_path +localmap +multi_lang +signs +user_commands -xterm_save
+cryptv +float -lua -mzscheme +smartindent +vertsplit -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=s
sp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D__linux__ -D_REENT
RANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-rpath,/usr
/lib64/perl5/CORE -Wl,-z,relro -L/usr/local/lib -Wl,--as-needed -o vim -lm -lnsl -lselinux -lncurses -lacl
-lattr -lgpm -ldl -Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE -fstack-protector -L/usr/lib64/perl5/COR
E -lperl -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
I modified my .vimrc file as follows according to the comments:
set number
set shiftwidth=4
set clipboard=unnamed
nnoremap p "*p nnoremap p <cmd>r !xclip -o -selection clipboard<CR>
But, now p does nothing. I want p to paste.
:versionto your question. Theclipboardfeature is something that's compiled in - or not. My guess is your cluster has a minimal version of Vim installed. – Friedrich Dec 29 '23 at 15:52ssh -Xor similar). However I suppose your actual problem is getting your system clipboard accessible from within your cluster. That is not a Vim problem however. – Christian Brabandt Dec 29 '23 at 15:57-clipboardand "HUGE version without GUI". I'd try and install a GUI version. On your local PC, you probably have a GUI version with+clipboard. On a side note: 7.4 from ten years ago? We're using Vim 9 these days. – Friedrich Dec 29 '23 at 16:50