Keyboard shortcut to move cursor to last edit posi

2020-06-07 06:51发布

In Visual Studio, is there a keyboard shortcut to navigate (move cursor) to the last edited position (like PyCharm's Ctrl+Shift+Backspace)?

The CTRL + - shourtcut moves to the last position (not the last edited position), which is less useful for me.

10条回答
再贱就再见
2楼-- · 2020-06-07 07:21

The correct answer is ALT & to go backwards and ALT & . Tested on version 1.8.1

查看更多
smile是对你的礼貌
3楼-- · 2020-06-07 07:24

You can use Ctrl + - (View.NavigateBackward) shortcut.

查看更多
冷血范
4楼-- · 2020-06-07 07:26

You can do Ctrl + z, Ctrl + y.

This does an undo/redo, so your code will not be affected, but your code window will be moved to the last edit location.

I have Visual Studio 2010, and this does the trick for me.

查看更多
Evening l夕情丶
5楼-- · 2020-06-07 07:28

This shortcut was added in VS2017 version 15.8:

Ctrl + Shift + Backspace

It's near impossible to find via google, I just stumbled across it when reading the VS news and release notes.

Go To Last Edited Location

We all know the feeling of starting to write a feature and then realizing we need some more information from elsewhere in the solution. So, we open another file from Solution Explorer or Go to Definition in a few places and suddenly, we’re far off from where we started with no easy way back unless you remember the name of file you were working in originally. In Visual Studio 2017 version 15.8, you can now go back to your last edited location via Edit > Go To > Go To Last Edit Location (Ctrl + Shift + Backspace).

https://blogs.msdn.microsoft.com/visualstudio/2018/08/30/improving-your-productivity-in-the-visual-studio-editor/

查看更多
登录 后发表回答