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

时间:2015-08-24 12:35:47

标签: vim

我的数据如下:

母音,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 voice, passive form 
否定,negation, denial, repudiation, NOT operation 
不規則,irregularity, unsteadiness, disorderly  

如何更换除每行之外的第一个事件?

除了第一次出现,之外,我想替换每一行上的每个,

结果:

母音,vowel    
備考,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    

1 个答案:

答案 0 :(得分:4)

你可以使用正面的lookbehind:

:%s/\m\%(,.*\)\@<=,/REPLACED/g