青岛百度整站优化服务,浙江银安建设有限公司网站,杭州网站建设索q479185700,微商城网站开发制作我们经常是使用SSH工具远程连接到Linux服务器上进行工作#xff0c;有时候需要将Linux下使用VIM打开的文件内容复制到Windows上来#xff0c;默认情况下#xff0c;可能会复制不了#xff0c;因为VIM默认情况下是使用的set mousea的设置#xff0c;它会让鼠标选中的时候进…我们经常是使用SSH工具远程连接到Linux服务器上进行工作有时候需要将Linux下使用VIM打开的文件内容复制到Windows上来默认情况下可能会复制不了因为VIM默认情况下是使用的set mousea的设置它会让鼠标选中的时候进入VIM的可视化模式而不能复制。使用y命令也只是VIM内部的复制不能复制到外部所以需要将VIM的鼠标模式暂时关闭掉使用set mouse关闭掉即可复制复制完成后如果想回到原来的模式则使用set mousea命令即可恢复。
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 mouseaIf your terminal cant overrule the mouse events going to theapplication, use::set mousenviThen 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 matchingxterm.When the mouse is not enabled, the GUI will still use the mouse formodeless selection. This doesnt 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输入和更多提示