Copy from Putty/Vim visual mode to windows clipboard

user886596 picture user886596 · May 24, 2013 · Viewed 52k times · Source

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

Answer

Brad Denver picture Brad Denver · Nov 21, 2013

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