当前位置: 首页 > news >正文

复制远程连接到Linux使用VIM打开的内容到Windows

我们经常是使用SSH工具远程连接到Linux服务器上进行工作,有时候需要将Linux下使用VIM打开的文件内容复制到Windows上来,默认情况下,可能会复制不了,因为VIM默认情况下是使用的set mouse=a的设置,它会让鼠标选中的时候进入VIM的可视化模式,而不能复制。使用y命令也只是VIM内部的复制,不能复制到外部,所以需要将VIM的鼠标模式暂时关闭掉,使用set mouse=关闭掉即可复制,复制完成后,如果想回到原来的模式,则使用set mouse=a命令即可恢复。

VIM的鼠标模式可以参见帮助,在VIM中输入命令help mouse即可查看:

'mouse'                 string  (default "", "a" for GUI and Win32,set to "a" or "nvi" in defaults.vim)globalEnable the use of the mouse.  Works for most terminals (xterm, Win32win32-mouse, QNX pterm, *BSD console with sysmouse and Linux consolewith gpm).  For using the mouse in the GUI, see gui-mouse.  Themouse can be enabled for different modes:n       Normal mode and Terminal modesv       Visual modei       Insert modec       Command-line modeh       all previous modes when editing a help filea       all previous modesr       for hit-enter and more-prompt promptNormally you would enable the mouse in all five modes with::set mouse=aIf your terminal can't overrule the mouse events going to theapplication, use::set mouse=nviThen you can press ":", select text for the system, and press Esc to goback to Vim using the mouse events.In defaults.vim "nvi" is used if the 'term' option is not matching"xterm".When the mouse is not enabled, the GUI will still use the mouse formodeless selection.  This doesn't move the text cursor.See mouse-using.  Also see 'clipboard'.Note: When enabling the mouse in a terminal, copy/paste will use the"* register if there is access to an X-server.  The xterm handling ofthe mouse buttons can still be used by keeping the shift key pressed.Also see the 'clipboard' option.

即:

  • n 普通模式和终端模式
  • v 可视模式
  • i 插入模式
  • c 命令行模式
  • h 当使用帮助文件时为所有前面所列模式
  • a 所有前面所列模式
  • r hit输入和更多提示
http://www.lryc.cn/news/169913.html

相关文章:

  • 左神算法之中级提升班(9)
  • SmartNews 基于 Flink 的 Iceberg 实时数据湖实践
  • websocket请求通过IteratorAggregate实现流式输出
  • 《C和指针》笔记28:可变参数和stdarg宏
  • Matlab论文插图绘制模板第114期—带图形标记的图
  • Python:用于有效对象管理的单例模式
  • 【TCP】滑动窗口、流量控制 以及拥塞控制
  • Xilinx FPGA管脚约束语法规则(UCF和XDC文件)
  • 服务网格和CI/CD集成:讨论服务网格在持续集成和持续交付中的应用。
  • 代码随想录训练营第56天|583.两个字符串的删除操作,72.编辑距离
  • 【JDK 8-Lambda】3.1 Java高级核心玩转 JDK8 Lambda 表达式
  • 【C#】XML的基础知识以及读取XML文件
  • Immutable.js简介
  • C语言进阶教程(位操作和进制数的表示)
  • Loguru:功能强大、简单易用的Python日志库
  • idea之maven的安装与配置
  • 【最新面试问题记录持续更新,java,kotlin,android,flutter】
  • 面试:经典问题解决思路
  • CG MAGIC分享3ds Max卡顿未保存处理方法有哪些?
  • [python 刷题] 238 Product of Array Except Self
  • UG NX二次开发(C#)-计算直线到各个坐标系轴向的投影角度
  • C# ComboBox 和 枚举类型(Enum)相互关联
  • Linux CentOS7 tree命令
  • 软件设计模式系列之九——桥接模式
  • 构造函数的调用规则
  • 第十章:枚举类与注解
  • ChatGPT:字符串操作问题——提取包含括号的字符串中的题干内容
  • jvm中对象创建、内存布局以及访问定位
  • C基础-操作符详解
  • 时序预测 | MATLAB实现BO-BiGRU贝叶斯优化双向门控循环单元时间序列预测