How can I do the following?Copy all text from vim and paste it to an external program e.g. mail Outlook?  I tried +y and gg*yG but the paste does not work.
How can I select all copy from vim and paste to other program e.g. mail client?
vim;x11;copy paste
This requires vim to have X11 clipboard integration. You can check this by doing vim --version and looking for +xterm_clipboard (+clipboard is not it, that's for using the GUI, which may actually be what you're after, the question doesn't specify GUI or terminal).If you don't have +xterm_clipboard, you'll need to get a version of vim that does have it (or recompile yourself).If you do have it, then awesome. Lets continue.X11 has 2 clipboards. There's the select buffer, and then the real clipboard. The select buffer is the highlight/middle_click thing. The clipboard is the normal CTRL+C/CTRL+V.To copy the current line into the selection buffer, do *yy. (yes, that's shift+quote shift+8 y y)To copy into the clipboard, do +yy.(you can use other selection specifiers, like +yG, or +y in visual mode)If you want to make one of these the default, so you can just do yy, without the +/* bit, you can add one of the following to your ~/.vimrc:set clipboard=unnamedorset clipboard=unnamedplusYou didn't specify if you were accessing the machine remotely, but if so you can still do this, but you will need X11 forwarding turned on and working in SSH. I will warn you however that it can cause vim to take several seconds to start up.