Visual Studio 2010: How Can I remap F2 to Rename F

2019-04-18 09:26发布

In Visual Studio 2010 Solution Explorer tree view, how can I remap the F2 key to Rename the Selected File rather than open Object Browser?

3条回答
虎瘦雄心在
2楼-- · 2019-04-18 09:46

I don't know about you, but in my copy of VS2010, F2 in the Solution Explorer DOES rename the file. What exactly do you have selected when you hit F2?

查看更多
时光不老,我们不散
3楼-- · 2019-04-18 10:05

Do the following

  • Tools -> Options
  • Expand Environment and select Keyboard
  • Type "File.Rename" into the text box
  • Put the Focus on the "Press Shortcut keys" box and hit F2
  • Click Assign
查看更多
叛逆
4楼-- · 2019-04-18 10:09

To enable the renaming of an identifier or method, etc. using the F2 key (i.e a variable or a method name), do the following:

  • Tools -> Options
  • Expand Environment and select Keyboard
  • Type "Refactor.Rename" into the text box that says 'Show commands containing'
  • Put the Focus on the "Press Shortcut keys" box and hit F2
  • Click Assign
查看更多
登录 后发表回答