DISQUS

Tech-Recipes: Cut and paste text in vi or vim | UNIX | Tech-Recipes

  • steven hildenburg · 9 months ago
    Does this work for external text?
    Say, i want to copy from my pc notpad file into an SSH window that is running VIM - do i select my text in notepad, press CTRL+V , then put my cursor in VIM and press p (in command mode).

    I only ever use linux from a distance to manage my website's config files - so i always feel quite lost.
  • steven hildenburg · 9 months ago
    oops typo...i meant ..."press CTRL+C" - in notepad
  • Mikael Gunnarsson · 7 months ago
    No, the text you copy in windows isn't automagically put into VI's buffer.

    To copy text from windows to the remote host you need to go into insert mode in VI and then use your SSH client's paste function.
  • Anonymous · 7 months ago
    For example (with PuTTY), you would press Control+C on the text you want to copy, then switch to PuTTY, press i to insert text, then right click to have PuTTY paste the text in.