Python 如何在原子编辑器中隐藏 *pyc 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24079976/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 03:55:48  来源:igfitidea点击:

How to hide *pyc files in atom editor

pythonatom-editor

提问by andilabs

Started using Atomfor Python/Django development and would like to hide all the *.pycfiles from sidebar.

开始使用Atom进行 Python/Django 开发,并希望*.pyc从侧边栏中隐藏所有文件。

How to configure it?

如何配置它?

采纳答案by Lee

The method for hiding files that you do not want showing up in the Tree View (which is what most people mean when they ask this question) depends on whether or not you've added the files to your .gitignore. If you have, then all you have to do is:

隐藏您不想在树视图中显示的文件的方法(这是大多数人问这个问题时的意思)取决于您是否已将文件添加到.gitignore. 如果你有,那么你所要做的就是:

  1. Open Settings
  2. Scroll down the list on the left to find the Tree Viewpackage
  3. Click on it to bring up the package-specific settings
  4. Ensure Hide Vcs Ignored Filesis checked
  1. 打开设置
  2. 向下滚动左侧的列表以找到Tree View包裹
  3. 单击它以显示特定于包的设置
  4. 确保Hide Vcs Ignored Files被检查

If you want to hide certain files in the Tree View whether you have a Git project open or not:

如果您想在树视图中隐藏某些文件,无论您是否打开了 Git 项目:

  1. Open Settings
  2. Add the file mask to the comma-separated list under Ignored Names(add *.pycin your case)
  3. Scroll down the list on the left to find the Tree Viewpackage
  4. Click on it to bring up the package-specific settings
  5. Ensure Hide Ignored Namesis checked
  1. 打开设置
  2. 将文件掩码添加到Ignored Names*.pyc在您的情况下添加)下的逗号分隔列表
  3. 向下滚动左侧的列表以找到Tree View包裹
  4. 单击它以显示特定于包的设置
  5. 确保Hide Ignored Names被检查

Also note that when you add a file mask to the list of Ignored Names that files matching that mask will not show up in other parts of Atom like the fuzzy-finder:find-file(Cmd+Ton OS X and Ctrl+Ton Windows/Linux by default) command.

另请注意,当您将文件掩码添加到 Ignored Names 列表时,匹配该掩码的文件将不会显示在 Atom 的其他部分,如fuzzy-finder:find-fileCmd+T在 OS X 和Ctrl+TWindows/Linux 上默认)命令。

回答by andilabs

I found thiswhere it is said that you can toggle that in Preferences->Tree View->Hide Ignored Namesand Hide Vcs Ignored Files.

我发现了这个,据说你可以在Preferences-> Tree View->Hide Ignored NamesHide Vcs Ignored Files.

Edit:The files to hide you have to specify first in Preferences->Settings->Core Settings->Ignored Names. This was described here.

编辑:要隐藏的文件必须首先在Preferences-> Settings-> Core Settings-> 中指定Ignored Names。这是描述here

Let me know if it works.

让我知道它是否有效。

回答by Kanan Rahimov

In Atom 1.25.0 on Ubuntu I found this setting Hide Vcs Ignored Filesunder packages configuration: Preferences -> Packages -> Tree View -> Settings.

在 Ubuntu 上的 Atom 1.25.0 中,我在包配置下找到了这个设置Hide Vcs Ignored Files: Preferences -> Packages -> Tree View -> Settings

Also, pressing Iwhile Tree View activated also works for me (@Suraj Thapar's comment).

此外,I在激活树视图时按下也适用于我(@Suraj Thapar 的评论)。

Please note, you have 2 options here: Ignore file by .gitignoreand ignore files by Hide Ignored Nameswhich refers to Ignored Namescore config settings.

请注意,这里有 2 个选项:通过.gitignore忽略文件和通过Hide Ignored Names忽略文件,它指的是Ignored Names核心配置设置。