user652038
user652038

Reputation:

How do you in/outdent a line without selecting it in Visual Studio?

Whether the cursor is in front of the text, where Tab and Shift-Tab work, or anywhere else, I mean. MonoDevelop uses Ctrl+Alt+Home or Ctrl+Alt+End for this functionality, and you can easily find the commands in its Edit->Format menu.

Learning how to operate the keyboard is harder for Visual Studio than any other program I have used.

Upvotes: 1

Views: 1000

Answers (1)

Drew Noakes
Drew Noakes

Reputation: 310907

Visual Studio is very flexible when it comes the the keyboard, even if it's not super friendly.

  1. Go to Tools -> Options
  2. Type dent into the Show commands containing text box
  3. Find Edit.DecreaseLineIndent
  4. Focus the Press shortcut keys text box
  5. Type your preferred keys, eg: Ctrl+Alt+Home
  6. Check where those keys are currently used. Notice that there are many scopes to which keystrokes apply. You probably want to select Text Editor from the Use new shortcut in dropdown
  7. If you want to apply this shortcut, click Assign
  8. Do the same for Edit.IncreaseLineIndent

It's not a bad idea to make a backup of your settings once you have them the way you like them.

Upvotes: 2

Related Questions