You can assign everything inside { to register a using
"ayi{
Breakdown
"a - select register a y - yank i{ - everything inside {}
It is suitable for matching braces
If you later need to access the contents of a, you can do this in several ways depending on the context - I think the ways
"ap : paste register a in normal mode <Cr>a : paste register a into command line @a : access register in script
It is worth noting that the regular expression is not powerful enough to make the corresponding curly braces. (I think there are extensions that can make it powerful enough, but I'm not sure if vim supports any of them)
source share