【问题标题】:Copying from gvim does not work, copying to does从 gvim 复制无效,复制到有效
【发布时间】:2013-08-30 10:26:23
【问题描述】:

我首先提到我已经阅读了一些关于此的建议,包括How to make vim paste from (and copy to) system's clipboard?https://superuser.com/questions/187537/copy-to-system-clipboard-instead-of-vim-bufferhttps://askubuntu.com/questions/172265/how-to-use-a-common-clipboard-for-vim-and-unityhttp://vim.wikia.com/wiki/Accessing_the_system_clipboard,但我一直无法找到解决方案。

所以,我的问题是通过 X11 剪贴板复制到 gvim,但无论如何我都无法从 gvim 复制到工作。我已经验证我的版本已经编译了 x11 剪贴板支持。目前我在 .vimrc 中添加了以下内容:

set clipboard=unnamedplus,autoselect
set guioptions+=a
set paste
set go+=a

简单的拉动不起作用,“+y”或“*y”也不起作用。我已经用 xclip 验证剪贴板中没有任何内容。我也尝试了其他几个参数变化,包括

我正在使用 Ubuntu 12.04 和 gvim --version 说

$ VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May  4 2012 04:22:36)
Included patches: 1-429
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2-GNOME 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_gui +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_sysmouse +mouse_xterm +mouse_urxvt +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 

所以这可能是别的东西吗?有任何想法吗?这让我发疯,没关系让我感到愚蠢,因为如果我需要将某些内容复制到例如,我必须在 gedit 中打开文件。一封电子邮件。

【问题讨论】:

    标签: vim ubuntu-12.04 clipboard x11


    【解决方案1】:

    set guioptions+=aset go+=a 相同:保留第一个,删除另一个。

    set paste 是一个可憎的东西,它会在你的~/.vimrc 中默认设置太多其他选项。阅读:help 'paste',删除该行并阅读:help 'pastetoggle'

    "+y"*y 最终出现在不同的剪贴板中。您使用什么命令进行拉取以及如何粘贴到其他程序中? Ctrl+v?中键?

    【讨论】:

    • 我试过用 "+p, "*p, yy 拉动,用可视模式标记并使用鼠标。我尝试使用中键单击和 Ctrl+v 进行粘贴。但正如我所说,我用 xclip 进行了检查,剪贴板中没有任何内容,所以后者甚至无关紧要。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-11
    • 1970-01-01
    • 1970-01-01
    • 2016-09-18
    • 2020-06-17
    相关资源
    最近更新 更多