For instance, if the cursor position is right after one of the two commas:
var strains = ["omicron", "delta","alpha"];
the ci"
command deletes the content of ", ".
I want this command to only take care of the corresponding "
pairs.
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityFor instance, if the cursor position is right after one of the two commas:
var strains = ["omicron", "delta","alpha"];
the ci"
command deletes the content of ", ".
I want this command to only take care of the corresponding "
pairs.
You might want to install plug-in wellle/targets.vim.
Among quite a few useful new mappings (you might want to learn about those), it modifies the behavior of i"
to recognize pairs of quotes and reliably select the strings inside them.
See this section of the introduction:
Quote Text Objects
These text objects are similar to the built in text objects such as
i'
.These quote text objects try to be smarter than the default ones. They count the quotation marks from the beginning of the line to decide which of these are the beginning of a quote and which ones are the end.
"
around your current cursor position.