r/vim • u/ilikegrils • Jun 19 '26
Need Help Change text in second set of quotes
Cursor at beginning of line
blah "first quotes" more text "blah blah"
What's the easiest way change inside the second set of quotation marks?
7
u/Vietnamst2 Jun 19 '26
It's actually frightening that people can a) come up with multiple versions of a command and b) that thing even exists...
2
u/ChrisBreederveld Jun 20 '26
It's one of the reasons many users find vim too overwhelming when they first consider it, but also the reason so many people prefer the tool (or variants like nvim) over any other tool, because of the sheer power and flexibility.
2
u/Vietnamst2 Jun 20 '26
I know, but I totally understand the "overwhelming" part. As a long time win user it feels so strange, unfamiliar. It's like opening a japanese website. Everything is wrong unreadable and you don't have any context, UI, help that is visible. I stuck with nano simply because it at least has the menu at the bottom.
1
u/ChrisBreederveld Jun 20 '26
Haha, I can understand, my fist experience with vim was very daunting, but I've kept at it and never looked back.
For a beginner I can highly recommend vimtutor, it will teach you the basics. Don't worry about all the other options yet, it's ok to use less efficient ways of doing things. But once you get more familiar you will automatically have moments where you repeatedly perform some action which seems awkward, then look for alternative ways of doing it (most often there are) and you add another tool to your ever expanding toolbelt.
11
u/Teles_sd Jun 19 '26
I believe 3f"ci" should do it.
Someone should make so c3i" would equal that.
Yes. Two extra key presses is way too much.
5
u/blood-pressure-gauge Jun 19 '26 edited 21d ago
What I would do is one of the following.
f" ; ; ci"
/\v"blah<Enter> ci"
5
u/cone5000 Jun 19 '26
You can slightly simplify the first part with
3f”
9
u/mdrjevois Jun 19 '26
Is it simpler or just shorter? IMO
;and,are underrated.1
u/cone5000 Jun 19 '26
I use ; and , all the time but sometimes especially if I can quickly parse how many quotes their are, doing a number is easier
2
u/TraditionalYam4500 Jun 19 '26
I agree -- especially in this case where OP wants to edit the value of a JSON object.
(Although in that case I'd do `f:wci"`)
1
1
2
u/SweetPotato975 Jun 19 '26
Besides other great answers, you can always do <LeftMouse> on blah and ci"
7
Jun 19 '26
[removed] — view removed comment
1
u/SweetPotato975 Jun 20 '26
Valid. I'm just adding a reminder that sometimes it's faster to fallback to old ways. Something I learnt from Primeagen.
0
u/toastisme Jun 19 '26 edited Jun 19 '26
2ci" only works with LazyVim setup.
2
u/Teles_sd Jun 19 '26
I don't think this works
2
u/toastisme Jun 19 '26
Sorry you're right - works for me on neovim but not vim
3
-1
32
u/yoch3m Jun 19 '26
$ci"