git Atom 从搜索中排除 node_modules 文件夹
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38101462/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Atom exclude node_modules folder from search
提问by Ville Miekk-oja
How to exclude node_modules folder from Atom searches "Find in project" after you have put node_modules inside your .gitignore file? Does atom require that the project actually has a git repository, or should the .gitignore be enough for Atom to exclude the folder?
将 node_modules 放入 .gitignore 文件后,如何从 Atom 搜索“在项目中查找”中排除 node_modules 文件夹?atom 是否要求项目实际上有一个 git 存储库,或者 .gitignore 是否足以让 Atom 排除该文件夹?
My .gitignore looks like this:
我的 .gitignore 看起来像这样:
.DS_STORE
*.log
node_modules
dist
coverage
回答by ASmater.Me
Steps
脚步
- Launch atom
- From the menu: edit > preferences (atom > prefernces on Mac)
- From the side menu, click the button "Open Config Folder"
- 发射原子
- 从菜单中:编辑 > 首选项(Mac 上的原子 >首选项)
- 从侧面菜单中,单击“打开配置文件夹”按钮
Now a new atom IDE should open.
现在应该打开一个新的 atom IDE。
- Open the file "config.cson"
- Add
ignoredNames: ["node_modules"]
undercore
- 打开文件“config.cson”
- 添加
ignoredNames: ["node_modules"]
在core
Example of a config.cson
一个例子 config.cson
"*":
core:
ignoredNames: [
".git"
"node_modules"
]
editor: {}
minimap:
plugins:
"highlight-selected": true
"highlight-selectedDecorationsZIndex": 0
welcome:
showOnStartup: false
Hope this helps
希望这可以帮助
回答by Rodrigo Pinto
回答by Reggie Pinkham
If your .gitignore file sits higher in the directory than where you are performing a Search in Directoryyour node_modules will not be excluded from Atom's search.
如果您的 .gitignore 文件在目录中的位置高于您在目录中执行搜索的位置,则您的 node_modules 将不会从 Atom 的搜索中排除。
For that reason I recommend adding node_modulesto the Ignored Names list in the Core Settings.
出于这个原因,我建议将node_modules添加到核心设置中的忽略名称列表中。
回答by Fab313
回答by Strider
For new versions of Atom (I am using 1.28.2 on Windows) I accessed config.cson via File > Config...
对于 Atom 的新版本(我在 Windows 上使用 1.28.2),我通过访问 config.cson File > Config...
Then, as mentioned in this previous answer, ignoredNames: ["node_modules"]
must be added under the core
section:
然后,如上一个答案中所述, ignoredNames: ["node_modules"]
必须在该core
部分下添加:
"*":
core:
telemetryConsent: "no"
themes: [
"one-light-ui"
"one-light-syntax"
]
ignoredNames: ["node_modules"]