Vim& Mac:如何在没有pbcopy的情况下复制到剪贴板 [英] Vim & Mac: How to copy to clipboard without pbcopy

查看:233
本文介绍了Vim& Mac:如何在没有pbcopy的情况下复制到剪贴板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个既支持剪贴板又支持xterm_clipboard的vim版本.但是,"*y"+y不会复制到系统剪贴板.我知道我可以使用:w !pbcopy(甚至为其创建快捷方式),但是我真的想要标准方法.我也看到了fakeclip,但希望找到一个非假的解决方案...

I have a version of vim with both clipboard and xterm_clipboard support. However, "*y or "+y don't copy to the system clipboard. I know I can use :w !pbcopy (and even create a shortcut for it), but I really want the standard way. I saw fakeclip also, but wish to find a solution that is not fake...

此外,我希望不需要使用"*"+,而只需使用y

Moreover, I wish to not need to use "* or "+ and just use y

更新:

我刚刚使用:reg命令进行了检查.我在另一个应用程序中复制了一些文本,然后在vim中运行了:reg命令.文本不在那里.然后,我运行MacVim,并且:reg显示"*具有复制的文本.所以我的vim出了点问题?

I just checked using the :reg command. I copied some text In another application then in vim ran the :reg command. The text is not there. I then ran MacVim and :reg showed that "* has the copied text. So something wrong with my vim?

这是vim --version:

Here's vim --version:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Nov 21 2013 07:13:18)
MacOS X (unix) version
Included patches: 1-244, 246-762
Compiled by idror@tlv-mp3u2
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv -cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
+mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_sgr -mouse_sysmouse
+mouse_urxvt +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg
+path_extra -perl +persistent_undo +postscript +printer +profile -python
-python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
 -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset -xim
+xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "/opt/local/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/opt/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -I/opt/local/include -DMACOS_X_UNIX -no-cpp-precomp  -pipe -O2 -arch x86_64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1   -I/opt/local/include
Linking: /usr/bin/clang  -L/opt/local/lib   -L/opt/local/lib -arch x86_64 -L/usr/local/lib -o vim    -lXt -lX11 -lSM -lICE -lm  -lncurses -liconv -lintl -framework Cocoa

推荐答案

+xterm_clipboard在Mac上毫无用处:它根本无法帮助您获得剪贴板支持.

+xterm_clipboard is useless on a Mac: it won't help you get clipboard support at all.

您已经安装了MacVim,为什么不直接使用它,因为它具有剪贴板支持?太容易了吗?

You have MacVim installed, why don't you simply use it since it has clipboard support? Too easy?

此外,:set clipboard^=unnamed从理论上讲是个好主意,但它可以很快破坏剪贴板的历史记录,因此……请尝试一段时间以查看它是否对您有用.

Also, :set clipboard^=unnamed is a good idea in theory but it can clobber your clipboard history pretty quickly so… try it for a while to see if it works with you.

这篇关于Vim& Mac:如何在没有pbcopy的情况下复制到剪贴板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆