7

Is there any shortcut in Notepad++ to select all (highlight) codes between the curly braces (start & end)?

E.g. Code between if-else, nethod definition, while, for loop etc.

Robotnik
  • 2,645

2 Answers2

6

Ctrl+Alt+B does that (shows in “Search” drop down also).

denpick
  • 61
3

I don't know of any shortcut in Notepad++ that could do what you are trying to achieve but you could record a macro and assign a keyboard shortcut to it:

  1. in the 'Macro' menu click 'Start Recording'
  2. press CTRL + F
  3. in 'Find what' give the following Regular Expression: (?<=\{)[^}]+(?=\})
    (this will find and select all text between 2 matching curly brackets)
  4. make sure that you tick 'Regular Expression' under 'Search Mode'
  5. click 'Find Next'
  6. in the 'Macro' menu click 'Stop Recording', then 'Save Current Recorded Macro...'

During the last step there is the option to assign a keyboard shortcut for this macro.

Andreas
  • 324
  • 6
  • 17