Jump to content

SciTE's Ctrl-D keybind for Visual Studio?


Info
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...