Vim Useful Tricks

Vim Useful Tricks

Hi everyone. Today I want to share a vim trick.
It’s very useful when I was coding every day.
So hope you like it.

Problem

I have those situation every day. I want to change ‘target’. So how can I do?

1
2
3
4
5
6
7
8
foo target boo
foo "target target"
foo 'target target'
foo (target target)
foo {target target}
foo [target target]
foo <target target>
foo <div>target target</div>

This article is very subjective. If you do not feel comfortable viewing it, please close it as soon as possible.
If you think my article can help you, you can subscribe to this site by using RSS.

ci anything

We can use ci combining commands.

When your cursor on ‘target’ this word. We can use

ciw

1
foo target boo

ci"

1
foo "target target"

ci'

1
foo 'target target'

ci(

1
foo (target target)

ci{

1
foo {target target}

ci[

1
foo [target target]

ci<

1
foo <target target>

cit

1
foo <div>target target</div>

Referrals

Photo by Pankaj Patel on Unsplash

Author

Ewan Xiao

Posted on

June 15th 2021

Updated on

September 28th 2023

Licensed under

Comments