vim -- 复制到 OpenSuSE 中的系统剪贴板

发布于 2024-09-12 21:35:13 字数 289 浏览 3 评论 0原文

I've tried the methods mentioned at Vim: copy selection to OS X clipboard, but neither the * or + register seem to be working for me. I'm on OpenSuSE 11.3, and have vim and vim-data installed (there is no vim-full package as mentioned in the link in SuSE). I've tried with Klipper enabled and disabled. (edit) I've also tried pasting with ctrl+v and middle click.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

像你 2024-09-19 21:35:13

看看你是否有一个名为 vimx 的东西,它是 vim 的 X 版本。您可以将 vim 别名为该名称,然后使用 * 注册。

这是一个超级用户问题。

See if you have something called vimx, an X enabled version of vim. You can alias vim to that, and then use * register.

This is a superuser question.

迷迭香的记忆 2024-09-19 21:35:13

我假设您正在终端中运行 VIM 并谈论 VIM 的视觉选择,而不是在终端窗口中用鼠标选择。

由于在您的情况下,VIM 不知道 X,因此它显然无法将您的选择传达给 X Window 系统。如果您用鼠标在终端窗口中选择某些内容,那么您不是在 VIM 中选择,而是在终端模拟器中选择,终端模拟器可以识别 X 并将当前选择正确地传递到 X 的剪贴板。

您可以尝试使用 xsel 工具,该工具允许一种从命令行访问 X 剪贴板。您需要覆盖常用的剪贴板快捷方式,不仅将视觉选择的内容放入常用的 VIM 寄存器中,还要将其通过管道传输到 xsel,以便它成为新的 X 选择。 (奇怪的是,我手头的 SLES10 系统上没有安装 xsel。)这显然只有在 (1) 终端在本地运行或 (2) 您连接的远程服务器允许 X 时才有效。转发。如果在编辑文件的服务器上禁用了 X 转发,那么您就没有机会在 VIM 中执行操作:只能在终端窗口中用鼠标进行选择。

I presume that you are running VIM in terminal and talk about VIM's visual selection, not selection with the mouse in terminal window.

Since in your case VIM isn't aware of the X, it obviously cannot communicate your selection to the X Window System. If you select something in terminal window with mouse, then you are selecting not in VIM, but in the terminal emulator which is aware of the X and communicates properly the current selection to X's clipboard.

You can try to play around with xsel tool which allows one to access the X clipboard from command line. You would need to override the usual clipboard shortcuts to not only put the content of the visual selection into the usual VIM register(s), but also to pipe it to the xsel so that it becomes the new X selection. (Strangely enough, I do not have the xsel installed on the SLES10 system I have right now at hand.) That obviously would only work if (1) the terminal is running locally or (2) remote server you are connected to allows the X forwarding. If the X forwarding is disabled on the server where you edit the files, then you have no chance to do in VIM: only selecting with mouse in terminal window would work.

淡淡の花香 2024-09-19 21:35:13
  • 检查剪贴板配置中的同步剪贴板内容和选择
  • 使用鼠标突出显示文本(不适用于 vim 键选择)。
  • 您的选择位于剪辑器中。
  • Check synchronize contents of the clipboard and the selection in the clipper configuration.
  • Highlight text with the mouse (will not work with vim key selections).
  • Your selection is in the clipper.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文