命令: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:
标签:redis,替换,conf,net,vim,data,networks
From: https://www.cnblogs.com/yangzhenlong/p/17163960.html