This article is based on the public release of Ghidra 11.0.1.
Described as the best thing since sliced bread by numerous people, this tip is worth its weight in gold, especially if you are using Ghidra on a laptop. When left-clicking on a register, value, or variable in the disassembly listing or decompiler, the background colour of the selected item changes. The default selection background colour is yellow, as can be seen in the screenshot below, where one variable, named ppuVar3, is selected.
Non-default behaviour is the fact that other items with the same name are not highlighted upon left-clicking. In this tip, the default behaviour will be changed to highlight all items with the same name upon left clicking.
By default, the value for this behaviour is the middle mouse button, which is clicking with the mouse’s scroll wheel, or a the middle button on laptops which have three mouse buttons below the touchpad. To add to that: some laptops do not have a middle mouse button.
To enable this behaviour, open the code browser, click on the Edit menu strip item, followed by Tool Options, as can be seen in the screenshot below.
Next, one should open the Listing Fields folder on the left hand side tree structure, and select Cursor Text Highlight. Alternatively, one can search for the latter in the bottom left filter, and then select the item, as can be seen below.
The Mouse Button To Activate options is where one can change the preferred button. The default value is MIDDLE. Change it to LEFT, click OK, and click on a given item to see the result. The image below shows the difference between the behaviour of a left-click before and after the settings change.
Note how all occurrences of ppuVar3 are highlighted, as opposed to only the selected occurrence.
To contact me, you can e-mail me at [info][at][maxkersten][dot][nl], or DM me on Twitter @Libranalysis.