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
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.
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.
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.
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
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.
exit from vi editor
$cat using above command you will see your all content which is in that file
select the content you want to copy (yes you can scroll on this screen while selecting)
don't click any mouse button because text will get selected automatically
open your text editor on windows and paste it there
Done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With