这是两个片段
"Remove leading whitespace": {
"body": [
"${TM_SELECTED_TEXT/^(\\s+)//gm}"
],
"description": "Remove leading whitespace"
},
"Replace non-empty lines with 'xyz'": {
"body": [
"${TM_SELECTED_TEXT/^.+$/xyz/gm}"
],
"description": "Replace non-empty lines with 'xyz'"
}
第一个删除前导空格(但也删除表情行),另一个将非空行替换为“xyz”。
我希望代码片段删除非空行的前导空格(保留非空行,如用“xyz”替换非空行中所示)。所以我想转换以下文本
Working towards
long-term goals or aspirations
can provide motivation
challenges and obstacles
到
Working towards
long-term goals or aspirations
can provide motivation
challenges and obstacles
我怎样才能做到这一点?