Vim has such a team, and, fortunately, it is very simple. Just enter y% .
The reason for this is that % is because Vim calls the move command. It moves from one separator to the corresponding separator - in your case, from the opening bracket to the closing one. The y command allocates one line to the Vim buffer if it is called as yy , but the second y not required. Instead, you can create a motion of type % , after which Vim will withstand the text moved. So y% .
source share