網(wǎng)站建設(shè)有用嗎貴陽(yáng)網(wǎng)站建設(shè)推廣
我們經(jīng)常是使用SSH工具遠(yuǎn)程連接到Linux服務(wù)器上進(jìn)行工作,有時(shí)候需要將Linux下使用VIM打開(kāi)的文件內(nèi)容復(fù)制到Windows上來(lái),默認(rèn)情況下,可能會(huì)復(fù)制不了,因?yàn)閂IM默認(rèn)情況下是使用的set mouse=a
的設(shè)置,它會(huì)讓鼠標(biāo)選中的時(shí)候進(jìn)入VIM的可視化模式,而不能復(fù)制。使用y
命令也只是VIM內(nèi)部的復(fù)制,不能復(fù)制到外部,所以需要將VIM的鼠標(biāo)模式暫時(shí)關(guān)閉掉,使用set mouse=
關(guān)閉掉即可復(fù)制,復(fù)制完成后,如果想回到原來(lái)的模式,則使用set mouse=a
命令即可恢復(fù)。
VIM的鼠標(biāo)模式可以參見(jiàn)幫助,在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 當(dāng)使用幫助文件時(shí)為所有前面所列模式
- a 所有前面所列模式
- r hit輸入和更多提示