当前位置: 代码迷 >> 综合 >> sublime text 批量删除空白行
  详细解决方案

sublime text 批量删除空白行

热度:74   发布时间:2023-09-14 14:43:58.0

方法:1

  • CTRL+H打开replace功能,勾选上左侧的regular expression,并填写

  • find what栏 : \s+$ (正则表达式)

  • replace with栏 : (这行留空)

  • 接着点replace all即可

方法:2

  • 点击菜单栏上的“Preferences”,找到“Setting-Default”,搜索“trim_trailing_white_space_on_save” 然后将false改为true,这里已经说明了,如果设为true时,将在保存的时候去除行尾的空格。
// Set to true to removing trailing white space on save 
"trim_trailing_white_space_on_save": false
  相关解决方案