原文本: public static final int GODU_CMD_PORT = 1234; public static final int GODU_MONITOR_PORT = 5678; public static final int GODU_SUBSCRIBE_PORT = 6789; public static final String LOGIN = "login:"; public static final String LOGIN_PASSWORD = "password:"; public static final String GODU_PROMPT = "[GODU-CMD]"; public static final String GODU_OPT_START = "BOCOGODUACKSTART"; public static final String GODU_OPT_END = "BOCOGODUACKEND"; public static final String NE_OPT_START = "BOCOGODUCMDSTART"; public static final String NE_OPT_END = "BOCOGODUCMDEND"; 目标文本: godu.cmd.port = 1234 godu.monitor.port = 5678 godu.subscribe.port = 6789 login = login: login.password = password: godu.prompt = [GODU-CMD] godu.opt.start = BOCOGODUACKSTART godu.opt.end = BOCOGODUACKEND ne.opt.start = BOCOGODUCMDSTART ne.opt.end = BOCOGODUCMDEND 操作过程: 1. 删除前导空格::%s/^\s*//g 1. 删除每行的前4个单词,将第5个单词转化为小写(使用宏): qad4wguwjq 9@a 1. 将下划线改为点号::%s/_/./g 1. 删除行尾分号::%s/;$//g 1. 删除双引号::%s/”//g