Keyboard shortcut to move cursor to last edit position in Visual Studio

眉间皱痕 提交于 2019-12-04 00:12:38

In my VS I can use CTRL + -. I am not sure if this Works in all Versions and With different keyboard layout.

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.

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

Steve Retz

I always use Ctrl+Shift+Backspace.

Additionally you can use Ctrl + Shift + - (View.NavigateForward) shortcut.

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/

There is a free extension for Visual Studio 2015, 2017, 2019 that includes it : Hot Commands

Edit.GoToLastEditLocation

Takes the caret back to the last place an edit occurred during that session.

The default Keyboard shortcut is : Ctrl + Shift + Backspace

This can be changed any time under Tools - Options - Environment - Keyboard - Edit.GoToLastEditLocation

Edit: Extension now also support VS2019

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

Many of the answers mention VisualStudio 2017 or a plugin to VisualStudio 2015.

I found the following shortcuts in VisualStudio 2015.

View.NavigateBackward
View.ForwardBackward

Map nicely to pycharm's

Last Edit Location
Next Edit Location
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!