You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修改Sublime Text 3默认注释符号?SQL文件注释替换为#

Hey there! Let's walk through your two Sublime Text 3 questions step by step—super straightforward once you know where to look.

1. How to modify default comment symbols in Sublime Text 3

The core idea here is targeting the syntax-specific configuration for the language you're working with. Every language in Sublime has its own settings that define things like comment markers. Here's the general workflow:

  • Open a file of the target language (like your .sql file for the second question)
  • Go to Preferences > Settings - Syntax Specific—this opens the dedicated settings file for that language
  • In the right-hand pane (your custom user settings), add or modify the comment-related keys. The most common ones are:
    • line_comment: The string used for single-line comments
    • block_comment: A list defining the start and end of block comments (e.g., ["/*", "*/"] for SQL)
2. Changing SQL single-line comment from -- note here to #notes here

For your .sql file scenario, here's exactly what to do:

  1. Open any .sql file in Sublime Text 3
  2. Navigate to Preferences > Settings - Syntax Specific—this will open SQL.sublime-settings (User)
  3. Paste the following valid JSON configuration into the file:
{
    "line_comment": "#notes here ",
    // Optional: Keep default block comments or adjust them here
    "block_comment": ["/*", "*/"]
}
  1. Save the file, then close and reopen your .sql file to apply the changes
  2. Now when you hit Ctrl + /, it'll automatically insert #notes here at the start of the line, with your cursor ready to add more text.

If you just want the # marker without the default "notes here" text, you can set "line_comment": "#" instead—Sublime will place your cursor right after the # for you to type your note.

内容的提问来源于stack exchange,提问作者kittygirl

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:23:42