Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

SciTE's Ctrl-D keybind for Visual Studio?


  • Please log in to reply
10 replies to this topic

#1 Info

Info

    :D

  • Active Members
  • PipPipPipPipPipPip
  • 730 posts

Posted 11 July 2012 - 05:37 PM

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?







#2 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 11 July 2012 - 05:49 PM

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.

#3 funkey

funkey

    New Dad

  • Active Members
  • PipPipPipPipPipPip
  • 667 posts

Posted 11 July 2012 - 06:33 PM

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.


#4 Info

Info

    :D

  • Active Members
  • PipPipPipPipPipPip
  • 730 posts

Posted 11 July 2012 - 06:44 PM

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, 11 July 2012 - 06:45 PM.


#5 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 11 July 2012 - 07:34 PM

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.

#6 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 5,066 posts

Posted 11 July 2012 - 08:36 PM

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.

#7 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 11 July 2012 - 09:07 PM

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, 11 July 2012 - 09:10 PM.

*GERMAN* Posted Image [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

#8 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 11 July 2012 - 09:36 PM

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.

#9 Info

Info

    :D

  • Active Members
  • PipPipPipPipPipPip
  • 730 posts

Posted 11 July 2012 - 11:17 PM

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

#10 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 12 July 2012 - 12:42 AM

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

#11 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,328 posts

Posted 12 July 2012 - 12:54 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users