Now "Paste As.." in VS.NET with Smart Paster Add-In

I don't know about you guys (and gals), but I often find myself pasting large string literals (SQL queries or dialogs) into code. It started to become quite a hassle to fire up EditPlus, paste, replace line breaks with quote characters, copy, and paste it into Visual Studio. So, I put together an add-in to help with this task and called it Smart Paster.

It works for both VB and C#, and will wordwrap if you'd like it to. Not sure if you'll find it useful, but it's yours for the taking, along with the source code (which is installed in it's Program Files folder). If you'd like, you can grab it here: <removed, get the newer version instead, see below> 

I'd really appreciate some feedback if you find it useful, or if can think of any other features to add. Oh, and if there is already one of these out there, sorry about that. I was more in a Write-An-Add-In mood than a Search-For-An-Add-In mood.

OMISSION: I forgot to give props to Jason Mauss for suggesting the Paste As Region option. Thanks Jason!

EDIT: Version 1.1 is avaiable here: http://weblogs.asp.net/alex_papadimoulis/archive/2004/05/25/Smart-Paster-1.1-Add_2D00_In-_2D00_-StringBuilder-and-Better-C_2300_-Handling.aspx

Published Friday, May 21, 2004 12:43 PM by Alex Papadimoulis
Filed under:

Comments

Friday, May 21, 2004 1:57 PM by Scott Galloway

# re: Now "Paste As.." in VS.NET with Smart Paster Add-In

Very very nice, thanks Alex!
Friday, May 21, 2004 2:55 PM by James Geurts

# re: Now "Paste As.." in VS.NET with Smart Paster Add-In

Sweet! this looks very useful. Any chance of being able to customize the pasting options, in the next version? For example, to dynamically add the option: paste as Html. Or for another example, remove paste as Region, if not needed...
Friday, May 21, 2004 4:14 PM by Addy Santo

# re: Now "Paste As.." in VS.NET with Smart Paster Add-In

Have you submitted this to Royo's VS lugin contest? If not, whatcha waiting for??
Friday, May 21, 2004 4:19 PM by Austin Bain

# re: Now "Paste As.." in VS.NET with Smart Paster Add-In

Great util. I'd like to be able to set up keyboard shortcuts to each of the commands. However I could not find the commands in the keyboard mapping. Also the formatting of the region block was not to my liking I'd like to see auto formatting run on the paste region to clean up the code. Also it would be nice to paste returns as Environment.Newline for C#.

I think you have made a great tool here. Keep it up.
Wednesday, May 26, 2004 12:50 PM by chadbr

# re: Now "Paste As.." in VS.NET with Smart Paster Add-In

??

Why don't you just do you strings like so?

someStr = @"
my
long
string here.
I don't need any quotes
or pluses anywhere
";
Thursday, May 27, 2004 4:41 PM by Alex Papadimoulis

# re: Now "Paste As.." in VS.NET with Smart Paster Add-In

chadbr,

In 1.1, you can configure it to Paste As a line-spanning string literal.

- Alex