Visual Studio f2 refactor.rename, file.rename

I am trying to get Visual Studio to rename a file when I am in the solution browser with the selected file or directory, and I pressed the F2 key. However, I also want Visual Studio to refactor the refactoring when I press F2 and I enter the editor window with my pointer to the variable. I know that this is related to setting the context of each (Global, TextEditor, etc.). However, I can not find the right combination. Context "Solution Explorer" is missing

Thanks Jerome

+8
visual-studio-2010 keyboard-shortcuts
source share
2 answers

Here is what I did in Visual Studio (2013) to get F2 working in the editor and in the solution explorer:

  • Go to the Tools / Options menu and select Environment / Keyboard
  • In "Show Commands Containing" put File.Rename
  • In "Use New Shortcut In", select Solution Explorer
  • In "Press Keyboard Shortcuts" press F2 and click "Assign"
  • In "Show Commands Containing" put Refactor.Rename
  • In "Use New Shortcut In", select Text Editor.
  • In "Press Keyboard Shortcuts" press F2 and click "Assign"

I could not get him to work with Global. It seems strange to me that this is not the default behavior, given the ubiquity of using F2 to rename Microsoft products, but at least flexible enough for you to customize it.

+13
source share

I used Global for a solution developer and a text editor for a text editor ... so good

+1
source share

All Articles