This is useful for text objects ( :help text-objects ). To get the content you are looking for ( Foobar, cool \"string\" ), you can simply do:
yi" y = yank i" = the text object "inner quoted string"
The yank command uses an unnamed case by default ( "" , see :help registers ), so you can programmatically access available content using the getreg() function or the transcript @{register-name} :
:echo 'String last yanked was:' getreg('"') :echo 'String last yanked was:' @"
Or you can load the contents into a different register:
"qyi"
stores the internal string with quotes in the register "q , so it does not conflict with the standard use of the register (and may be available as the variable @q ).
source share