加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何替换除每行之外的每个事件 – VIM

发布时间:2020-12-15 17:02:45 所属栏目:安全 来源:网络整理
导读:我的数据看起来像这样: 母音,vowel 備考,note,remarks,NB 基本形,fundamental form,basic form,basic pattern,basic model,basic type,prototype 受身,the defensive,passive attitude,passivity,passiveness,the passive,passive voice,ukemi (the art of
我的数据看起来像这样:
母音,vowel    
備考,note,remarks,NB    
基本形,fundamental form,basic form,basic pattern,basic model,basic type,prototype    
受身,the defensive,passive attitude,passivity,passiveness,the passive,passive voice,ukemi (the art of falling safely)  
受身形,passive form 
否定,negation,denial,repudiation,NOT operation 
不規則,irregularity,unsteadiness,disorderly

如何替换除每行之外的每个事件?

我希望在每一行上替换除第一次出现之外的每一行.

结果:

母音,noteREPLACED remarksREPLACED NB  
基本形,REPLACEDfundamental formREPLACED basic formREPLACED basic patternREPLACED basic modelREPLACED basic typeREPLACED prototype  
受身,REPLACEDthe defensiveREPLACED passive attitudeREPLACED passivityREPLACED passivenessREPLACED the passiveREPLACED passive voiceREPLACED ukemi (the art of falling safely) 
受身形,passive voiceREPLACED passive form  
否定,negationREPLACED denialREPLACED repudiationREPLACED NOT operation    
不規則,irregularityREPLACED unsteadinessREPLACED disorderly
你可以使用正面的lookbehind:
:%s/m%(,.*)@<=,/REPLACED/g

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读