ReSharper in Detail: CamelHumps
CamelHumps is a feature that identifies parts of compound names composed according to CamelCase, where each part starts with a capital letter (“hump”).
By default, it works in four navigation commands, namely Go To Type, Go To File, Go To File Member, and Go To Symbol, like this:
However, you should take an additional step to activate CamelHumps for the Extend/Shrink Selection (Ctrl + (Shift) + W, or Ctrl + Alt + Right/Left in the Visual Studio keyboard layout) and Next/Previous Word (Ctrl + Left/Right) navigation actions. To do that, choose ReSharper | Options | Environment | Editor and select Use CamelHumps.
From now on, CamelHumps is switched on, and jumping to next/previous word works in a slightly different manner. Specifically, when you press Ctrl + Left/Right, the caret moves to the next/previous uppercase character in the current word, and only after that, it moves on to the next/previous word.
Extend/Shrink Selection commands are also affected by CamelHumps. Suppose that the caret is in the middle of a compound word with several parts that begin with uppercase letters:
If CamelHumps is switched on, pressing Ctrl + W for the first time selects the current part of the word:
It’s only after pressing this keystroke for the second time that you can select the whole word:
All subsequent keystokes are processed as usual.
In addition, ReSharper provides four actions for using CamelHumps locally when the global option (Use CamelHumps) is switched off:
- ReSharper_HumpNext – move caret to next hump/word
- ReSharper_HumpPrev – move caret to previous hump/word
- ReSharper_HumpNextExtend – expand selection to next hump
- ReSharper_HumpPrevExtend – expand selection to previous hump
Of course, you can assign individual shortcuts to these actions in the Visual Studio Options dialog box (Tools | Options | Environment | Keyboard).
Note that both HumpNextExtend and HumpPrevExtend only work in a linear fashion, without additional functionality of Extend/Shrink Selection.
Subscribe to Blog updates
Thanks, we've got you!
Eager, Lazy and Explicit Loading with Entity Framework Core
Entity Framework Core (EF Core) supports a number of ways to load related data. There’s eager loading, lazy loading, and explicit loading. Each of these approaches have their own advantages and drawbacks. In this post, let’s have a quick look at each of these ways to load data for navigational prope…
OSS Power-Ups: bUnit – Webinar Recording
The recording of our webinar, OSS Power-Ups: bUnit, with Egil Hansen and Steven Giesel, is available. This was the twelfth episode of our OSS Power-Ups series, where we put a spotlight on open-source .NET projects. Subscribe to our community newsletter to receive notifications about future webi…
Accelerating Your Testing Workflow with Unit Test Creation and Navigation
Unit tests play an important role in our daily development workflow. They help us ensure our codebase's correctness when writing new functionality or performing refactorings to improve readability and maintainability. In the process, we often create new test files that accompany the p…
Introducing Predictive Debugging: A Game-Changing Look into the Future
With the introduction of debugging tools, software developers were empowered to interactively investigate the control flow of software programs to find bugs in live environments. At JetBrains, we've always strived to improve the art of debugging. Besides the more standard things you expect from a de…