Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy from Putty/Vim visual mode to windows clipboard [duplicate]

Tags:

I currently have a vim session open in Putty, and I've selected everything in the file via visual mode. Normally to copy this onto clipboard I would use either "+y or "*y, but neither of those commands are working.

Here's my vimrc:

call pathogen#infect()  set noswapfile  set mouse="  set ts=4 set wildmenu set wildmode=list:longest,full  colorscheme evening  set expandtab set smarttab  " Stuff from github: set ts=4 set wildmenu set wildmode=list:longest,full set number  " This shows what you are typing as a command. I love this! set showcmd  " Who doesn't like autoindent? set autoindent  " Spaces are better than a tab character set expandtab set smarttab  " Who wants an 8 character tab? Not me! set shiftwidth=3 set softtabstop=3  " Ignoring case is a fun trick set ignorecase  " When I close a tab, remove the buffer set hidden  " Set word wrapping set linebreak  " Use filetype specific indentation filetype on filetype plugin on filetype indent on  " Disable auto commenting autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o 
like image 387
user886596 Avatar asked May 24 '13 18:05

user886596


People also ask

Can you copy from vim to clipboard?

How to Copy to System's Clipboard. In Vim, you can copy, cut, and paste texts using the yank commands provided by the y, d, and p keys, respectively. However, by default, vim will store the copied text into an internal register called the unnamed register.

How do I copy text from PuTTY terminal to Notepad?

To copy text from Putty to your Windows clipboard or program, here's what to do. Left-click inside the PuTTY terminal window near the text you want to copy. Holding down the left mouse button, drag your cursor across the text to select it, then release the button to copy it.

How do you copy and paste on Windows PuTTY?

Cutting and Pasting in X-windows, putty and MS Windows In Windows, you must tell the OS when to move selected text to the clipboard by hitting CTRL-C or going to the menu 'Edit | Copy'. In X just highliting it moves it to the clipboard. In MS Windows pasting is done with CTRL-V or the 'Edit | Paste' menu.


2 Answers

with mouse enabled via set mouse=a you simply need to "Hold down shift, and then highlight the text you want to copy using the left mouse button. When you release, the highlighted text should be in the Windows clipboard." See https://stackoverflow.com/a/4313348

like image 91
Brad Denver Avatar answered Sep 21 '22 02:09

Brad Denver


I was facing the same issue I searched everywhere but I didn't find any easy solution without installing some extra software tool. So here is the simplest solution.

  1. exit from vi editor

  2. $cat using above command you will see your all content which is in that file

  3. select the content you want to copy (yes you can scroll on this screen while selecting)

  4. don't click any mouse button because text will get selected automatically

  5. open your text editor on windows and paste it there

  6. Done

like image 32
Saurabh Dange Avatar answered Sep 20 '22 02:09

Saurabh Dange