Skip to content

Tip 5.31: You can create keyboard shortcuts to navigate among the various Task List categories (by using View.NextTask and View.PreviousTask)

May 16, 2014

“Visual Studio Tips, 251 ways to improve your Productivity in Visual Studio“, courtesy of ‘Sara Ford’

Sara Ford’s Blog

F8 and Shift+F8 are bound to the commands Edit.GoToNextLocation and Edit. GoToPreviousLocation. When the Task List is visible, these keyboard shortcuts navigate throughout all the tasks listed in a given category.

However, if you want to navigate at any time among your various TODO comments or other tasks, regardless of whether the Task List is open, the Task List comes with two commands for doing this: View.NextTask and View.PreviousTask.

Because we’ve already explored more than you ever wanted to know about the Task List, you now know that the Task List has several categories: User Tasks, Comments, and Shortcuts. These commands navigate only among items of a given category, so you won’t jump from Shortcuts to User Tasks.

Note that these commands are not bound to a keyboard shortcut by default in the General Development Settings, so you may need to bind them yourself, depending on your development settings.

VSTip5310

Go to Tools–Options–Environment–Keyboard, and in the Show Commands Containing edit box, type the command View.NextTask.

Do a sanity check for whether the settings you are using already have the command bound to a keyboard shortcut. If a command is already bound to a keyboard shortcut, you’ll see it in the Shortcut Currently Used By read-only combo box, which you can see in the preceding screen shot.

If the command is not bound to a shortcut, in the Press Shortcut Keys edit box, type your preferred shortcut and click Assign. If you want this command to work only in the editor and not anywhere else in the IDE, use the Text Editor scope under the Use New Shortcut In drop-down list.

Rinse and repeat for the View.PreviousTask command. For her, she used Ctrl+Alt+N, only because it wasn’t bound to anything in the General Development Settings. For the previous action, she highly recommends just adding the Shift key to whatever key combination you come up with for View.NextTask, since the standard convention for any backward navigation is to include Shift.

Also, something else to note, because she had to test for it, is that the Visual Studio status bar will update with the name of the comment when you use View.NextTask or View.PreviousTask.

VSTip5310a

Happy Programming! =)

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: