在vim中交换两个单词:
:%s/\(\<man\>\|\<god\>\)/\={"man":"god","god":"man"}[submatch(1)]/g
替换数字加一:
:%s/\d/\=submatch(0)+1/g
参考Pricatical Vim.
在vim中交换两个单词:
:%s/\(\<man\>\|\<god\>\)/\={"man":"god","god":"man"}[submatch(1)]/g
替换数字加一:
:%s/\d/\=submatch(0)+1/g
参考Pricatical Vim.