Pasting from the Windows clipboard into a PuTTY vi or vim terminal can sometimes be problematic, particularly with newer vim versions that have mouse mode enabled by default. This can lead to unintended visual mode activation or incorrect pasting.
Here are the primary methods to paste from the clipboard into a PuTTY vi/vimsession:
Shift + Right-Click:
Shift + Insert:
Middle Mouse Button (Wheel Click):
Disable vim Mouse Mode (if applicable): vim Paste Mode:
Note: Ensure vi or vim is in insert mode (by pressing i) before attempting to paste if you want the content to be inserted directly into the file. Otherwise, pasting might be interpreted as vim commands.
For larger pastes,
vim's paste mode can be helpful. Enter insert mode in
vim, then type :set paste and press Enter. Paste your content using one of the methods above, then type
:set nopaste and press Enter to exit paste mode.If you are experiencing issues due to
vim's mouse mode, you can disable it for the current session by typing :set mouse= and pressing Enter while in vim. To make this change permanent, you can add
set mouse= to your ~/.vimrc file. If your mouse has a middle button (often the scroll wheel), clicking it can paste the content.
Shift + Insert:
This keyboard shortcut can also be used to paste the clipboard content.
This is often the most reliable method for pasting in PuTTY, especially when
vim's mouse mode is active. Hold down the Shift key and then right-click in the PuTTY window where you want to paste.
Comments
Post a Comment