├── README.md ├── main.js └── package.json /README.md: -------------------------------------------------------------------------------- 1 | exclude-folders 2 | =============== 3 | 4 | Brackets extension for excluding folders from the file tree, find in files, and quick open. 5 | 6 | To install: 7 | 8 | 1. Launch Brackets 9 | 2. Select _File > Extension Manager..._ or click the Lego icon in the toolbar 10 | 3. Click the "Install from URL..." button 11 | 4. Paste (or enter) `https://github.com/gruehle/exclude-folders` and click "Install" 12 | 13 | By default, this extension excludes all `node_modules` folders. If you want to exclude additional folders, edit the regular expression on line 41 of `main.js`. For example, if you want to exclude all items that contain the words `node_modules`, `bin`, and `components`, use: 14 | 15 | ```js 16 | return !name.match(/node_modules|bin|components/); 17 | ``` 18 | 19 | Note that this will match these words *anywhere* in the folder *or* file name. For example, if you have a folder named "my-components", it will also be excluded. You can use the `^` and `$` anchors to ensure that the name must be a complete match: 20 | 21 | 22 | ```js 23 | return !name.match(/^(node_modules|bin|components)$/); 24 | ``` 25 | 26 | Matching is case sensitive by default. Add `i` to the end to make it case-insensitive: 27 | 28 | 29 | ```js 30 | return !name.match(/^(node_modules|bin|components)$/i); 31 | ``` 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice shall be included in 12 | * all copies or substantial portions of the Software. 13 | * 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | * DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | /*jslint vars: true, plusplus: true, devel: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ 24 | /*global define, brackets */ 25 | 26 | define(function (require, exports, module) { 27 | "use strict"; 28 | 29 | var FileSystem = brackets.getModule("filesystem/FileSystem"); 30 | 31 | var _oldFilter = FileSystem._FileSystem.prototype._indexFilter; 32 | 33 | FileSystem._FileSystem.prototype._indexFilter = function (path, name) { 34 | // Call old filter 35 | var result = _oldFilter.apply(this, arguments); 36 | 37 | if (!result) { 38 | return false; 39 | } 40 | 41 | return !name.match(/node_modules/); 42 | }; 43 | }); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gruehle.exclude-folders", 3 | "title": "Exclude Folders", 4 | "description": "Excludes folders from Brackets", 5 | "version": "0.1.0", 6 | "author": "Glenn Ruehle (https://git.corp.adobe.com/gruehle)", 7 | "license": "MIT", 8 | "engines": { 9 | "brackets": ">=0.34.0" 10 | } 11 | } --------------------------------------------------------------------------------