does Visual Studio 2010 not have a “join lines” keyboard shortcut?

Spread the love

Question Description

does Visual Studio 2010 not have a “join lines” keyboard shortcut?

EDIT – That is when on line X anywhere, I hit a shortcut key once, and then line X+1 joins to line X (eliminating CR between them so to speak)

Practice As Follows

As I far as I know it does not.

However, you can create and save a new VS macro using the following code:

Sub JoinLines()
    DTE.ActiveDocument.Selection.EndOfLine()
    DTE.ExecuteCommand("Edit.Delete")
    DTE.ActiveDocument.Selection.EndOfLine()
End Sub

and assign a keyboard shortcut to it (like CTRL + j)

This code will join the current line with the one right below it.

You may be interested in these books.

#CommissionsEarned

As an Amazon Associate I earn from qualifying purchases.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.