vim 替换
命令:substitude
:s/{from}/{to}
其中
s
为substitude
:s/{from}/{to}
当前行的第一个 from 替换为 to:s/{from}/{to}/g
将当前行中的 from 替换为 to:s/{from}/{to}/gc
将当前行中的 from 替换为 to,并在执行前进行确认询问:%s/{from}/{to}/g
将所有行中的 from 替换为 to
version: '3'
services:
example-redis:
image: redis:5.0.5
container_name: example-redis
restart: always
ports:
- 63791:6379
volumes:
- ./data:/data
- ./conf/redis.conf:/etc/redis/redis.conf
networks:
- redis-net
networks:
redis-net:
将上面的 example-redis
替换为 redis
:%s/example-redis/redis/g
version: '3'
services:
redis:
image: redis:5.0.5
container_name: redis
restart: always
ports:
- 63791:6379
volumes:
- ./data:/data
- ./conf/redis.conf:/etc/redis/redis.conf
networks:
- redis-net
networks:
redis-net:
逃避不一定躲得过,面对不一定最难过