如何在 RStudio 中查找并替换为换行符(不是换行符)?

How to find and replace with a new line (not a new line character) in RStudio?

假设我们在脚本窗格中有以下内容

size = 1, minSize = 0, gridSize = 0, fontFamily = "Segoe UI", 
fontWeight = "bold", color = "random-dark", backgroundColor = "white"

我们想要 cmd + f 并找到所有 , - 即逗号后跟 space(技术上也可以是逗号后跟行尾),并用简单的新行替换它们(即相当于按回车键),所以我们最终得到类似

size = 1
minSize = 0
gridSize = 0
fontFamily = "Segoe UI" 
fontWeight = "bold"
color = "random-dark"
backgroundColor = "white"

这是怎么做到的?

注意:(不需要换行)

给你,

  1. 如下图所示:

  1. 按"All"按钮。完成,结果如下: