Sign in to follow this  
Followers 0

SciTE's Ctrl-D keybind for Visual Studio?

11 posts in this topic

#1 ·  Posted

Is there a keybind for Microsoft's Visual Studio (Express version if it matters) that copies the selected line in the text editor and pastes it in the next new line, just like the ctrl-d keybind in scite?

Share this post


Link to post
Share on other sites



#2 ·  Posted

What purpose does duplicating a line serve? I've never understood why the feature was in SciTE. If something (in source code at least) needs to appear multiple times then it should be stored in a variable, called in a loop, et cetera.

Anyway, no, I don't think Visual Studio has a duplicate command. Does the Express edition allow macros? If so then It should be trivial to write a macro and bind that macro to a hotkey.

Share this post


Link to post
Share on other sites

#3 ·  Posted

I like this feature of SciTE!

I somethimes duplicate a line with Ctrl+d, change the new line with something from the clipboard (because I didn't loose it because Ctrl+d) and comment the other line out.

BTW: You can also mark something in the line and duplicate it.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If something (in source code at least) needs to appear multiple times then it should be stored in a variable, called in a loop, et cetera.

That's not true. From the libraries I've been using lately, you can't loop many functions like glEnable and glLight*(). (well you can, it just won't be efficient)

These functions just need to appear one by one in the source code.

Correct me if I'm wrong.

BTW: You can also mark something in the line and duplicate it.

cool, didn't know that :idiot: Edited by Info

Share this post


Link to post
Share on other sites

#5 ·  Posted

That's not true. From the libraries I've been using lately, you can't loop many functions like glEnable and glLight*(). (well you can, it just won't be efficient)

These functions just need to appear one by one in the source code.

Correct me if I'm wrong.

How can I correct you when all we have to go on is your word? I don't know what libraries you are using nor what the code you've written looks like. Maybe you are right and you have to duplicate line after line. That would be strange to me, though, and is either a sign of a problem either in your code or understanding of the library, or it's a problem with the library itself.

Share this post


Link to post
Share on other sites

#6 ·  Posted

That's not true. From the libraries I've been using lately, you can't loop many functions like glEnable and glLight*(). (well you can, it just won't be efficient)

These functions just need to appear one by one in the source code.

Correct me if I'm wrong.

Any compiler worth its salt will unroll short loops. And it will probably find some way to make it more efficient in the process.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

It can be really useful if you are trying to do some changes in a line while keeping a backup of the original line. I also found me using it when adding data in a 2D-array. Write the variable and the brackets, then duplicate the line and fill in the data.

Here are some shortcuts for common editors and a macro for VS: http://stackoverflow.com/questions/2279000/visual-studio-short-cut-key-duplicate-line

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#8 ·  Posted

It can be really useful if you are trying to do some changes in a line while keeping a backup of the original line. I also found me using it when adding data in a 2D-array. Write the variable and the brackets, then duplicate the line and fill in the data.

I guess. I don't see where it's much better than traditional copy and paste, though. Yes, it saves a couple keystrokes since you don't have to copy the data. I guess it doesn't alter the clipboard, either, which might, in theory, be useful sometimes.

Still though, I'm not seeing a compelling reason for using it. I don't even have it bound in SciTE, I use Ctrl+D for something else.

Share this post


Link to post
Share on other sites

#9 ·  Posted

How can I correct you when all we have to go on is your word? I don't know what libraries you are using nor what the code you've written looks like. Maybe you are right and you have to duplicate line after line. That would be strange to me, though, and is either a sign of a problem either in your code or understanding of the library, or it's a problem with the library itself.

you could correct me if you knew the library I was talking about.

Thanks ProgAndy

Share this post


Link to post
Share on other sites

#10 ·  Posted

For somebody who has the display name "Info" you sure aren't providing very much of it.

Share this post


Link to post
Share on other sites

#11 ·  Posted

Highlight the entire line, right click drag it down one line, select copy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0