每隔一段时间,我就会打开Sublime Text,我的CPU会开始变得疯狂,温度会上升,而Sublime Text右下角的这个百分比会慢慢更新。我试过谷歌搜索答案但无济于事。有谁知道百分比代表什么?它是索引我的文件还是什么?如何更新此设置?
答案 0 :(得分:6)
是的,百分比是索引状态。这可以从Help menu -> Indexing Status...
更详细地查看。此菜单项已在构建3125中添加。
有各种控制索引的设置,所有这些都必须放在用户首选项中 - 它们目前在项目设置中不起作用。 相关问题:
// File indexing parses all files in the side bar, and builds an index of
// their symbols. This is required for Goto Definition to work.
"index_files": true,
// Set the number threads to use for indexing. A value of 0 will make
// Sublime Text guess based on the number of cores. Use the index_files
// setting to disable all workers.
"index_workers": 0,
// index_exclude_patterns indicate which files won't be indexed.
"index_exclude_patterns": ["*.log"],
// These files will still show up in the side bar, but won't be included in
// Goto Anything or Find in Files
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
由于node_modules
文件夹往往很大,这可能是您的索引需要一段时间并使用大量系统资源的原因。但是,目前index_exclude_patterns
only applies to file names,所以如果您想阻止对node_modules
文件夹建立索引,则需要将其添加到binary_file_patterns
,尽管它的名称,它也可以在文件夹。
示例:
"binary_file_patterns": ["node_modules/", "*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"]