The only problem I found with the procedure: when you hit enter to move to the next line, the cursor goes back to Column 1, and — unlike in Emacs — "Tab" does not automatically move you to the proper column to continue the block of code you're writing.
I found a way to fix this:
I found a way to fix this:
- Go to Tools → Options → Environment → Keyboard
- In the dialog box labeled, "Show commands containing:", type "breakline". Wait a moment for the search to complete.
- Select Edit.EmacsBreakLineIndent.
- In the "Use new shortcut in:" menu, select "Text Editor". This tells Visual Studio you want the binding we're about to add to be active only while in the text editor.
- Click in the "Press shortcut keys" box, and hit Enter. The word "Enter" should appear.
- Click "Assign."
You'll get a warning that Enter is already assigned to Edit.EmacsBreakLine. You're reassigning it to EmacsBreakLineIndent. Now, when you hit enter, the cursor is automatically positioned at the correct column to continue typing a code block.
To switch back to the old behavior, follow the same procedure as above, except select Edit.EmacsBreakLine instead.
No comments:
Post a Comment