问题
After typing something like:
<StackPanel Name="someStackPanel"
the caret is before the end-quotes. The only way I know of transferring the caret to the right of the end-quotes (so I can continue typing) is to press the right (>) button. But that button is rather inconvenient.
(Note that this problem doesn't exist for drop-down options such as Orientation="Horizontal"
Where after selecting Horizontal
from the drop-down menu, the caret is placed after the end-quotes.)
I tried return and tab but both didn't do it. Is there a different way of doing it? Or is there a way to cancel the auto-closing of quotes only for those properties which don't have drop-down menus?
回答1:
Try ctrl + u
.
This keyboard shortcut makes the character after the cursor lower-case , then advances the cursor. However, non-letters like double-quote have no lower-case version, so it's effectively equivalent to hitting the right arrow key--except your fingers don't leave home row. It's a hack, but it works!
回答2:
→ takes you one character right.
Ctrl + → takes you to the end of a word or start of next.
End takes you to the end of the line.
You might consider browsing through the various Edit command keyboard shortcuts.
Keyboard shortcuts for Visual Studio
Default keyboard shortcuts in Visual Studio
You may assign your own shortcut keys to edit commands.
In Visual Studio menu bar Tools > Options.
Choose Environment on the Left to expand it and choose Keyboard.
Find Edit.CharRight
You presumably only want to change this in your XAML editor so choose that from the combobox.
Click the Press shortcut keys textbox thing.
Choose your preferred key chord or key.
( I recommend you consider which one you're choosing carefully. )
来源:https://stackoverflow.com/questions/56207958/how-to-move-the-caret-to-after-the-end-quotes-when-typing-xaml