Sublime text 2 如何只删除评论 [英] Sublime text 2 how to delete comments only

查看:32
本文介绍了Sublime text 2 如何只删除评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 sass 代码中,我有内联注释,我希望在 sublime 文本中删除它们.是否可以单独永久删除所有评论内容?

In my sass code, I have inline comments and I wish to remove these in sublime text. Is it possible to permanently delete all comment content alone?

@function emCalc($values) {
  $emValues: '';
  $max: length($values); //Get the total number of parameters passed
  @for $i from 1 through $max {
    $value: (nth($values, $i)); //Take the individual parameter
    $value: $value / ($value * 0 + 1); //Doing this gets you one unit (1px)
    $value: $value / $em-base * 1em; //Divide the px value by emBase and return the value as em
    $emValues: #{$emValues + $value}; //Append to array
    @if $i < $max {
      $emValues: #{$emValues + " "}; //Adding space between parameters (except last), if there are multiple parameters
    }
  }
  @return $emValues; //Call emCalc like so emCalc(10, 20, 30, 40) it should return margin: 0.625em 1.25em 1.875em 2.5em
}

推荐答案

如果你没有其他可能,你可以选择每一个 // (Select first // thenCtrlD 如果我没记错的话还有评论).

If you have no other possibility, you could select every // (Select first // then CtrlD while there's comments left if my memory is correct).

然后按 ShiftEnd 选择带有 //Del 的每一行结尾!:)

Then press ShiftEnd to select every end of line with a // and Del ! :)

(可能有一个插件,但这是我认为最简单的方法.当然,这表明您所有的 // 都指的是评论的开头)

(There's probably a plugin for that, but this is the simplest method I think. This suggest that all your // refers to the beginning of a comment, of course)

这篇关于Sublime text 2 如何只删除评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆