Was ist die Tastenkombination, um in Notepad++ alles zwischen geschweiften Klammern auszuwählen?

Was ist die Tastenkombination, um in Notepad++ alles zwischen geschweiften Klammern auszuwählen?

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.

Antwort1

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

Antwort2

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...'

Im letzten Schritt besteht die Möglichkeit, diesem Makro eine Tastenkombination zuzuweisen.

verwandte Informationen