I have a list of files:./a.temp.txt     ./a.temp.txt./a/b.temp.txt   ./a/b.temp.txt./a/b/c.temp.txt ./a/b/c.temp.txtAnd I want to remove the temp. on each line, but only the second occurence, thus, the file should look like:./a.temp.txt     ./a.txt./a/b.temp.txt   ./a/b.txt./a/b/c.temp.txt ./a/b/c.txtHow should I do this?
Substitute second occurence on line
regular expression;substitute
In general you can match the Nth occurrence of somethingusing \zs and \{N}. There's an example given at :help \zs.In your case the command would be::%s/\(.\{-}\zstemp\.\)\{2}//