how to copy text from remote VIM into system clipboard from iterm2 on mac os x

519 views
Skip to first unread message

Li Xue

unread,
Mar 15, 2014, 9:42:09 PM3/15/14
to vim...@googlegroups.com
Hello all,

I am using ssh (with -X option) from mac (Marvericks) into a linux machine (Ubuntu 12.04.3 LTS). I use vim 7.4 to open files on the linux machine and had hoped to copy into the system
clipboard on my local mac machine. However, both "+yy and "*yy do not work for me. I tried both xquarz and iterm2.

Do you happen to have any idea how to make it work? Many thanks.

Here is what I got after typing :version inside vim:

Huge version with GTK2 GUI. Features included (+) or not (-):

+arabic +cmdline_info -ebcdic +fork() +listcmds +mouse_netterm +persistent_undo +signs +terminfo +vreplace

+autocmd +comments +emacs_tags +gettext +localmap +mouse_sgr +postscript +smartindent +termresponse +wildignore

+balloon_eval +conceal +eval -hangul_input +lua -mouse_sysmouse +printer -sniff +textobjects +wildmenu

+browse +cryptv +ex_extra +iconv +menu +mouse_urxvt +profile +startuptime +title +windows

++builtin_terms +cscope +extra_search +insert_expand +mksession +mouse_xterm +python +statusline +toolbar +writebackup

+byte_offset +cursorbind +farsi +jumplist +modify_fname +multi_byte -python3 -sun_workshop +user_commands +X11

+cindent +cursorshape +file_in_path +keymap +mouse +multi_lang +quickfix +syntax +vertsplit -xfontset

+clientserver +dialog_con_gui +find_in_path +langmap +mouseshape -mzscheme +reltime +tag_binary +virtualedit +xim

+clipboard +diff +float +libcall +mouse_dec +netbeans_intg +rightleft +tag_old_static +visual +xsmp_interact

+cmdline_compl +digraphs +folding +linebreak +mouse_gpm +path_extra +ruby -tag_any_white +visualextra +xterm_clipboard

+cmdline_hist +dnd -footer +lispindent -mouse_jsbterm +perl +scrollbind +tcl +viminfo -xterm_save

Li Xue

unread,
Mar 15, 2014, 10:01:28 PM3/15/14
to vim...@googlegroups.com
Sorry to bother you again. Here is some update.

I do not know why but copying from remote vim to system clipboard suddenly worked for me. Here is what I did:

1. start xquartz and open a terminal inside xquartz
2. from this terminal, type ssh -X remote_host_name
3. for the remote vim I set ":set clipboard=unnamedplus,unnamed,autoselect,exclude:cons\|linux"
4. use vim open a file from the remote_host_name
5. inside vim, type yy to yank a line into system clipboard, and I can paste that line into a text editor on my local mac machine.

As long as I start xquartz before iterm2, I can use either the terminal inside xquartz or iterm2 to yank lines from remote vim into clipboard on my local mac machine.

Is it possible that I do not have to launch xquartz before using iterm2 for this task?

Many thanks.

Li




--
--
You received this message from the "vim_mac" 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 a topic in the Google Groups "vim_mac" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_mac/916h3JDVjUc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_mac+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




Li Xue

unread,
Mar 15, 2014, 10:59:47 PM3/15/14
to vim...@googlegroups.com
Another update: 

After I log off from my mac and then log back in, my steps do not work any more.

Li
Reply all
Reply to author
Forward
0 new messages