Add a sublime project with a specific directory path

Currently, I am using Sublime Text 2 for a project that is structured as follows:

  • public
    • vendors
      • a.css
      • b.css
    • myfile.less
    • myfile.css (compiled)

I am facing an issue where I need to exclude the css files from the main 'public' folder (specifically myfile.css), while still including the '.css' files from the vendors folders. I attempted to achieve this by adding ""file_exclude_patterns":["public/*.css"]" to my sublime-project file. However, this solution ended up excluding all css files from the vendors folders as well.

If anyone has any suggestions or solutions on how to tackle this problem, I would greatly appreciate it. Thank you in advance!

Answer №1

The selectors file_exclude_patterns and folder_exclude_patterns seem to only support basic wildcard operations using *, unlike the regular expressions available in other configurations. The lack of detailed information in the project file documentation further complicates this issue.

In this scenario, you have two main options, each with its own advantages and disadvantages. Neither option requires you to specifically list out the files you want to exclude.

Firstly, many guides overlook the existence of file_include_patterns and folder_include_patterns. If your project directory mainly consists of a few file types, you can utilize code similar to the example below to include only css files within the vendors directory. The drawback is that you need to explicitly specify what you want to see, rather than what you don't want to see, which can be cumbersome. Using both file_include_patterns and file_exclude_patterns simultaneously for a single folder does not work.

"file_include_patterns": [
    "vendors/*.css",
    "*.less"
]

Alternatively, if you prefer utilizing Goto Anything and are indifferent to the appearance in the sidebar, you can add the vendors subfolder as a separate entity in the sublime-project file and adjust settings per folder accordingly. This approach may result in something like the following:

{
    "folders":
    [
        {
            "path": "path/to/dev/public",
            "file_exclude_patterns": [
                "*.css"
            ],
            "folder_exclude_patterns": [
                "vendors"
            ]
        },
        {
            "path": "path/to/public/vendors"
        }
    ]
}

Both methods may appear complicated and somewhat unconventional—perhaps in the future, we will have the capability to use regular expressions for defining file exclusions.

Answer №2

Is this solution feasible?

"exclude_files":["public/myfile.css"]

Answer №3

Give this a shot

{
  "directories":
  [
    {
      "location": "assets/scripts"
    },
    {
      "file_exclude_patterns": [
        "*.scss"
      ],
      "folder_exclude_patterns": [
        "node_modules"
      ],
      "location": "src"
    }
  ]
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Alignment of Material within Two Adjacent Divisions

I'm having trouble centering the content within two side-by-side divs. It seems like the content in each of these divs is centering towards one another, which is not what I want. I've created a main container and placed two divs inside it. The ...

JavaScript code for displaying mouse positions and Geolocation using OpenLayers, along with a Geocodezip demonstration

I have attempted to merge Geolocation and Mouse Position Display (longitude/latitude; outside of map) from the OpenLayers and geocodezip site, but I am facing issues. The Mouse Position Display works correctly, however, Geolocation does not seem to work. U ...

Incorporate a CSS class name with a TypeScript property in Angular version 7

Struggling with something seemingly simple... All I need is for my span tag to take on a class called "store" from a variable in my .ts file: <span [ngClass]="{'flag-icon': true, 'my_property_in_TS': true}"></span> I&apos ...

Deletion of a custom function in JavaScript

I have written some basic code to generate and remove an image using functions. Specifically, I need help with removing the image created by the function Generate() when a button linked to the function Reset1() is clicked. Here's the code snippet for ...

Having trouble getting the styles property to work in the component metadata in Angular 2?

Exploring Angular 2 and working on a demo app where I'm trying to apply the styles property within the component metadata to customize all labels in contact.component.html. I attempted to implement styles: ['label { font-weight: bold;color:red } ...

Tips for setting up the Top Menu and Left Side Menu in your system

You're looking to incorporate both the Top Menu and Left Side Menu. The top menu should remain fixed at the top of the page. Implementing the Left Side Menu below the Top Menu has been a challenge. It's currently covering the top menu, which is ...

What does the class "md-2n" signify in Bootstrap 4?

Can you explain what 'md' stands for in this context? I understand that 'm' refers to margin, but what about 'd' in the first line of code? Also, what does the 'n' in 'n2' stand for? How is it different fr ...

Selecting the initial and final elements in a list without utilizing pseudo-classes

Currently, I am in the process of designing a custom MUI styled component and I have encountered a challenge. I want to apply extra styles specifically for the first and last child elements. The issue arises because MUI utilizes the emotion styled library, ...

Is it necessary to always include all styles for jQuery UI separately in my project?

While reading various articles, I have noticed a common suggestion to explicitly bundle each jQueryUI .css file, such as the answer provided on How to add jQueryUI library in MVC 5 project?. However, upon examining the .css files within the Content/themes/ ...

Creating the CSS styles for input fields

Here is an example of a form: <form class="mystyle" ...> <input name="test1" type="text"> <input name="test2" type="text"> ... </form> I want to apply CSS styling to all the input elements in this form: .mystyle input[type="text" ...

Eliminate the margin on the subnavigation menu

Hey there, I'm looking to adjust the layout of my menu buttons by removing the left and right "margins" (if that's the correct term), so they all fit neatly inside the navigation bar. https://i.sstatic.net/udes8.png I want to ensure that all th ...

Create a visually stunning CSS3 animation within a specified container, mimicking the style shown in the

I'm currently working on creating the animation depicted in the image below: https://i.stack.imgur.com/W69EQ.jpg My goal is to develop a video slider where, upon clicking a button, the video will seamlessly shift to the right within its parent conta ...

Adjust the horizontal background-position transition for color change while scrolling using jQuery and CSS

I came across a fascinating website - - where the background-position changes on scroll() from a linear gradient with two colors to smoothly slide one color off the screen. While I grasped how they achieved the split colors using linear-gradient, I'm ...

What is the best way to ensure that my grid remains contained within its designated area?

I need to incorporate a grid of 16x16 or 64x64 into my layout without it overflowing. I'm considering using flexbox, but unsure of the implementation process. My goal is to have the grid resize based on the container size rather than exceeding its bou ...

Issue with Firefox causing Bootstrap form to appear incorrectly

I recently created a customized form using Bootstrap, but unfortunately, I'm encountering an issue with Firefox. Despite functioning perfectly on other browsers, the radio buttons are being pushed off the edge of the page and aren't displaying pr ...

Why does my text keep drifting towards the left edge?

After spending a day learning CSS and HTML, I decided to recreate a website from a YouTube video and add my own customizations. I was able to center the text in my introduction successfully. However, upon reviewing my progress (see screenshot here), it is ...

How can I make the main div contain all content between the header and footer in jQuery mobile?

This specific html code was created utilizing jQuery mobile. <div data-role="page" id="map-page"> <div data-role="header" data-theme="a" data-position="fixed" data-fullscreen="true" data-tap-toggle="false"> <h1>header</h1> ...

Issue with menu height persisting while resizing screen

For my responsive design project, I am implementing a menu that switches to a menu button when the width is less than or equal to 768px. Currently, I am using jQuery to dynamically adjust the height of the menu when the menu button is clicked. The jQuery ...

What is the method for using jQuery to retrieve hidden fields with the visible attribute set to "false"?

How can I access a control with "visible = false" attribute using jQuery? Some code examples would be appreciated. <tr>   <td class="TDCaption" style="text-align: left">     <asp:Label ID="lblMsg" runat="server" EnableViewState="False" F ...

Incorporating an SVG with CSS styling from a stylesheet

After exploring various articles and questions on the topic, I am yet to find a definitive solution. I have an external file named icon.svg, and my objective is to utilize it across multiple HTML files with different fill colors and sizes for each instanc ...