how to paste to vim when using putty

你离开我真会死。 提交于 2019-12-02 16:05:33
markcial

Try with Ctrl + Shift + V or with middle click with a 3 button mouse

EDIT

What about? Shift + Ins

Source : https://superuser.com/questions/180043/paste-the-windows-clipboard-into-my-putty-session-using-only-the-keyboard

You can insert text from your host’s clipboard by pressing the right mouse button (default setting) or by pressing Shift + Ins. Note that this has the same effect as entering every character manually. So if you are using auto indentation in vim, this will very likely screw up your code.

To fix that, you can do the following:

  1. Before pasting into vim, enable paste mode by entering :set paste.
  2. Press I to enter insert mode. The status bar should say -- INSERT (paste) -- now.
  3. Press the right mouse button to paste in your stuff. The auto indentation of vim should not happen.
  4. Press Esc to leave insert mode, and disable paste mode using :set nopaste again.

You can change which mouse button is used to paste in PuTTY in the Window/Selection configuration page.

In Windows Subsystem for Linux it appears that you have to:

  1. i = to enter -- INSERT -- mode
  2. Shift-right-mouse-click = to paste

If you just right-mouse-click (i.e. without shift) then annoyingly all that happens is that the mode changes to -- (insert) VISUAL -- i.e. it doesn't paste anything.

To clarify the other answers, there are a couple ways to do this, depending on if Vim is running with mouse support. Lets assume its via some sort of terminal/Putty:

  • When not using mouse in remote Vim, right clicking will paste from local clipboard via Putty into remote Vim.
  • With mouse enabled in remote Vim, Shift + Ins will paste from local clipboard via putty into remote vim.
  • Ctrl + Shift + v will paste from local clipboard via native/*nixish/xterm into remote vim.
  • With mouse enabled in remote Vim, middle clicking will paste from remote clipboard into remote Vim.

Copy&Paste between Windows&PuTTY:

To copy from Windows and paste into PuTTY, highlight the text in Windows, press "Ctrl-C," select the PuTTY window, and press the right mouse button to paste. To copy from PuTTy and paste into Windows, highlight the information in PuTTY and press "Ctrl-V" in the Windows application to paste it.

Copy&Past between two vim in separate PuTTY:

highlight the information in the source PuTTY, and then press the right mouse button in the target PuTTY to paste.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!