Visual Studio 2010: How Can I remap F2 to Rename File rather than Open Object Browser

岁酱吖の 提交于 2020-01-02 00:13:19

问题


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?


回答1:


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



回答2:


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:


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


来源:https://stackoverflow.com/questions/3375444/visual-studio-2010-how-can-i-remap-f2-to-rename-file-rather-than-open-object-br

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