>Let's say I open up a webpage, select some text and paste it into vim. Then >all I see in vim is the text I see on the browser. While this is OK most of >the times, sometimes I wish there is a way to paste the actual HTML code >directly into the vim.
>Selecting "view source of the webpage" and then copy pasting into vim will >work. But it is very cumbersome and time consuming. So this is not an >option for me. Wouldn't think so. That's a function of the browser (what yanks the text into the buffer to begin with), and not 'vim' (which only gets what's handed to it). Were you to put the yanked text to 'notepad', 'textpad', etc., it'd be the same thing, just the plain unadorned text. GIGO (garbage in, garbage out). Fwiw, just use shortcuts to get to the source, whether <alt><v><s></alt>, <^S>, <^U>, whatever your particular browser needs to get there. Can quite often be done in literally just 1 keystroke, so I'm not sure why you say "this is not an option for me". Finding the section of the source you want to c&p *might* be more difficult if there be a lot of repetitive words/phrases and you have a hard time isolating the section, but a simple find-text (<^F>, etc.) should do the job fairly well. No? And don't forget, quite a lot of times what's displayed by the c/p text is incomplete, as you'd likely need the stylesheet (.css file) to make sense of different classes, etc. That's why I usually just pig the whole page and all associated files, and *then* worry about narrowing it down to the text I need.