91

I'm attempting to use the Ctrl+R, Ctrl+R command within Visual Studio 2008 to rename a variable. I get an error message at the bottom saying that

"The key combination (Ctrl+R, Ctrl+R) is bound to command (&Rename...) which is not currently available."

I am not running it or anything I can think of which might prohibit modifications of the file and the F2 command allows a rename to happen. Anyone know how to fix this?

EDIT: I do have Resharper installed but was previously able to do this with the same setup, I recently migrated computers.

Jainendra
  • 24,713
  • 30
  • 122
  • 169
mwright
  • 4,099
  • 7
  • 30
  • 40

18 Answers18

84

I was able to fix this by doing the following:

  1. Go to ResharperOptions menu commmand
  2. Select EnvironmentKeyboard & Menus
  3. Select the Visual Studio option under Keyboard Shortcuts
  4. Click Apply Scheme and Save

This will cause Ctrl+R, Ctrl+R to do a rename. (Select ReSharper options in the dialog box that pops up then.)

However, it made F2 no longer able to preform a rename. I was able to fix that by doing the following:

  1. Go to ReSharperOptions menu command
  2. Select EnvironmentGeneral
  3. Select the ReSharper 2.x or IntelliJ IDEA under Restore ReSharper keyboard shortcuts
  4. Click Apply or OK

This allows both F2 and Ctrl+R, Ctrl+R commands to work for renaming a variable.

This seems to be specific to ReSharper being installed with Visual Studio, I don't know what the solution would be to fix this if ReSharper weren't installed.

ReSharper Options Menu

Cœur
  • 37,241
  • 25
  • 195
  • 267
mwright
  • 4,099
  • 7
  • 30
  • 40
  • 2
    It appears I don't have ReSharper so I'm still looking for a solution to this problem. – Chucky Mar 07 '13 at 12:49
  • 2
    @Chucky you can map the keyboard shortcut in Visual Studio by going to Tools -> Options -> Environment -> Keyboard, looking up Refactor.Rename under the "Show commands containing:" field, and setting it to CTLR + R, CTRL + R under "Press shortcut keys:" – Boyan Aug 13 '13 at 17:28
  • 2
    I found it under 1. resharper->options 2. Keyboard & menus 3. Select Visual studio and press "Apply scheme", 4. Click Save – Anders Lindén Sep 19 '14 at 11:13
  • Just to add sometimes you need to restart Visual Studio for this to take effect. Certainly I did in VS2013 – garryp May 01 '15 at 14:11
  • 1
    If it doesn't work, try to uncheck "Hide overridden Visual Studio menu items". It worked for me. – Umut Özel Jun 08 '15 at 15:04
18

For Resharper 6

You should:

  • Select menu "Resharper" - "Options..."
  • Select "Visual Studio Integration"
  • Choose "Visual Studio" in both places
  • Click "Apply Scheme"

It will either works or you will have a selection to do (Visual Studio or Resharper), if it is so, then choose Resharper.

Eric Ouellet
  • 10,996
  • 11
  • 84
  • 119
  • Thanks! It helped. Resetting to Visual Studio lets you choose Resharper then (when shortcut conflicts arise). – Anatoly Mironov Nov 17 '11 at 10:26
  • 2
    I never thought setting to visual studio would allow me to use resharper commands.. Strange how that works... – JakeJ May 18 '12 at 11:15
5

In my case the problem was solved by clearing the ReSharper cache. This can be done in the options menu under Environment > General here:

Screenshot of options menu

4

resharper has multiple default shortcut bindings that is chosen the first time you start visual studio after instalation. My guess is you picked a different one this time.

Andrey
  • 1,247
  • 11
  • 30
  • This was helpful in fixing the problem. – mwright Mar 30 '10 at 19:34
  • @mwright - be sure to mark a solution if it helped you solve the issue. – CrimsonX Mar 30 '10 at 20:40
  • @CrimsonX - while helpful it wasn't actually the solution, I guess what's protocol on that? You mark it as solution and then update your post to include the steps for the solution or create your own answer? – mwright Mar 30 '10 at 21:40
  • @mwright. A good question. If I were in your situation, and found a detailed answer with the help of myself, I'd answer my own question, mark it as the answer, and thank (and upvote) people that helped you find the solution. Its a judgment call... – CrimsonX Mar 30 '10 at 22:27
3

Using version 8 of ReSharper in Visual Studio 2013, I had to

  1. Go to the RESHARPER menu -> Options
  2. Expand Environment
  3. Select Keyboard & Menus
  4. Choose Visual Studio as the ReSharper keyboard scheme
  5. Click Apply Scheme...Save & close dialog box.

The next time I executed a keyboard shortcut it prompted me to choose which keyboard shortcut I wanted to use.

enter image description here

Mark
  • 1,455
  • 3
  • 28
  • 51
2

This happened to me once. I had to reinstall Resharper (repair from Add/Remove programs probably) to get it to work. But that was with VS2005 though.

Bala R
  • 107,317
  • 23
  • 199
  • 210
2

I'm guessing very few people will be in my situation but FWIW I was in this situation too where Refactor.Rename (Ctrl+R,Ctrl+R) was NOT working in Visual Studio 2019/Win 10, after reboots/restarts plus I did not have Resharper installed. In my case Refactor.Rename wasn't working because my project was in FOLDER mode not SOLUTION mode (OMFG). Soon as I used the solution tool to "Switch Views" and went into SOLUTION mode Refactor.Rename started working again. In hindsight this makes sense of course but some kind of error message/warning would have been nice to help me realize what the issue was!

Christopher
  • 1,639
  • 19
  • 22
1

All the answers above are well and good but this error also comes up in one more instance.


You start debugging your test script written for the project , the project stops at breakpoint .

If at this point , you try any operation on code , you will get the error similar to : "The key combination (Ctrl+R, Ctrl+R) is bound to command (&Rename...) which is not currently available."

Mwiza
  • 7,780
  • 3
  • 46
  • 42
user3251882
  • 922
  • 1
  • 11
  • 21
1

Nothing has worked for me until I have tried upgrading my Resharper! :O

Ashkan S
  • 10,464
  • 6
  • 51
  • 80
1

For me, the issue was I hadn't started the Resharper evaluation which wasn't obvious because all of the Resharper extension options were accessible, but the clue was under:

Extensions -> Resharper -> Why Resharper Is Disabled.

Click "Start Evaluation" (in the same location as "Pause Evaluation" in the screenprint)

enter image description here

I expected the evaluation to start when I clicked "OK", but clearly it doesn't.

0

For DevExpress:

  • Open the Options screen (Ctrl+Alt+Shift+O)
  • Go to CoreFeatures
  • Set Default to Visual Studio shortcuts
stakx - no longer contributing
  • 83,039
  • 20
  • 168
  • 268
Steve Cooper
  • 20,542
  • 15
  • 71
  • 88
0

This is usually the shortcut used by Resharper. Is there any chance Resharper is not running?

Alternatively, you can change the name, hit Ctrl+. and then use Rename.

stakx - no longer contributing
  • 83,039
  • 20
  • 168
  • 268
Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
0

You get this behaviour in Visual Studio (without R# installed) if the editor window does not have focus when you issue the shortcut. I've just tried it with R# installed and it does the same thing.

Give the editor focus (ie. by clicking in it) and try again.

adrianbanks
  • 81,306
  • 22
  • 176
  • 206
0

For me, this problem was caused by me not clicking 'Accept" on the terms and conditions page, but closing it. I did not realize it was the terms and conditions, and thought it was just a notice, or a 'readme' being displayed.

Bertus van Zyl
  • 582
  • 5
  • 17
0

Restart Visual Studio.

Worked for me.

armstb01
  • 623
  • 8
  • 11
0

None of the above worked for me. I had to reset my resharper settings in the end.

  1. Go to Resharper -> Manage Options
  2. Click the "Reset All Settings" button
gtestasker
  • 61
  • 7
0

In my case (Visual Studio 2022 17.4.0 with Resharper 2022.2.2), I had to

  1. disable Resharper
  2. restart Visual Studio to make the change effective
  3. enable Resharper
  4. restart Visual Studio to make the change effective
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • "to make the change effective" ...what change specifically did you make that resulted in this solution working for you? – Collin Barrett Oct 06 '22 at 18:57
  • 1
    @CollinBarrett: Disable R# and restart Visual Studio so that it is disabled. Enable R# and restart Visual Studio so that it became enabled again. – Thomas Weller Oct 06 '22 at 19:58
0
  1. Select the text, Next press Ctrl key and then press R key twice.
  2. release Ctrl key.
  3. Now type the new text and then to apply press Enter.