How to Colour Code Tabs by Regex in Visual Studio 2022

Поделиться
HTML-код
  • Опубликовано: 1 мар 2023
  • In Visual Studio 2022 V17.5.1 Microsoft included the ability to colour code your tabs via RegEx. Unfortunately they forgot to tell anyone how to do it.
    Checkout this video to learn how to create color coded tab RegEx's for Visual Studio 2022 tab colouring.
    And watch to the end to discover my preferred alternative for color coding tabs.
  • ХоббиХобби

Комментарии • 34

  • @silence8806
    @silence8806 4 месяца назад

    Very helpful video! And for someone who knows regex well from his UNIX background, this Microsoft solution is actually sufficient (once you have figured out where to put your regex line :) ). I just wanted to colour group tabs, that are of one application inside a project. Thank you so much!

    • @radboogie
      @radboogie  4 месяца назад

      Glad it was helpful!

  • @mrsajjad30
    @mrsajjad30 5 месяцев назад +3

    Thank you Sir! You took your time and made this useful video for us. It showed me exactly what I needed.

    • @radboogie
      @radboogie  5 месяцев назад +1

      Glad it helped 👍

  • @DaveHoskinsCG
    @DaveHoskinsCG 4 месяца назад

    It works really nicely for C++ source / header and shaders files.

    • @radboogie
      @radboogie  4 месяца назад

      Nice one, thanks for the info 👍

  • @Srki94MMO
    @Srki94MMO Год назад

    Thank you so much! This is a lifesaver in my case because I have 3 files per page in my XF app and it was kind of tough tracking everything, especially with dark VS theme.

  • @spaaske
    @spaaske 11 месяцев назад +1

    Thank you so much, you have no idea how much I've been looking for this.

    • @radboogie
      @radboogie  11 месяцев назад +1

      You're welcome, glad it helped.

  • @ThOperator
    @ThOperator 11 месяцев назад +2

    Life saver.

  • @PulpFreePress
    @PulpFreePress 16 дней назад

    I had no idea...thanks!

  • @FenderSidekick
    @FenderSidekick Год назад

    Thanks for the quick demo - helped me jump in and test it quicker. Not sure I like it enough yet and may stick to project grouping :/
    Was kind of hoping Microsoft would have converted their current tab color code to regex so more of it is generated (would help in just tweaking their default settings).
    Would also be nice to be able to specify or recommend colors in the file itself. Hopefully they further refine this. I know it was requested but I suspect now they will get more requests to clean this up.

    • @radboogie
      @radboogie  Год назад +2

      Glad it helped, took me a while to work out how they implemented the new features. Ability to add (say) a #Pragma to the code to colour the tabs would be good, but likely a long way off the rate that MS are working on this.

  • @ChyK24
    @ChyK24 10 месяцев назад

    Thanks a lot for this video!
    Wow, Microsoft really did the bare minimum UX-wise, but at least we have something included out-of-the box in VS now.
    About you not matching interface reqex, I guess it's because it matches whole absolute path of a file ("that's why there is "^.*" at the beginning of each regex in the template.), so probably "^.*I.*\.cs$" shoud work (I didn't tested it though).

  • @user-yy6fm8xr4d
    @user-yy6fm8xr4d Год назад

    Thank you!
    Before watching this video, I couldn't figure it out myself.
    What a strange system: RegExp is enabled in one place, its templates are in another, and the colors are in a third.

    • @radboogie
      @radboogie  Год назад

      Glad it helped! Yes, it's all a bit of a bodge but better than nothing if you don't want to buy an extension.

  • @sabrimevis
    @sabrimevis 4 месяца назад

    One suggestion from me; if you comment cs extensions in regex, those files will remain in the default and you can specify color for different file extensions only.

  • @stephanepyrosbrother9056
    @stephanepyrosbrother9056 4 месяца назад

    Hello, thank you a lot for your great video... Do you know if it is possible to add colors in the list which is available ? I want to be more specific than the existing ones with my own colors as the Colors & Tabs offers. Thank you for your answer

    • @radboogie
      @radboogie  4 месяца назад

      No I don't believe this is possible. You would need to use an extension like Tab Studio to be able to do that.

  • @MAPEIRIS
    @MAPEIRIS Год назад +2

    Thank you , you made my day..
    Regex can sometimes be challenging to work with, but they offer powerful and versatile capabilities. In my Razor Pages application, I have file names that are identical but reside in different folders. I have files for Index, Create, Edit, Delete, and Details pages located in your "Pages", "Partners", and "Partnerships" folders, each with the same names but in their respective directories. To group these files using regex, I am using the following patterns:
    (\\Pages\\Partnerships\\\S.*)
    (\\Pages\\Partners\\\S.*)
    (\\Pages\\\S.*)

    • @radboogie
      @radboogie  Год назад +1

      You're welcome, glad it helped.

  • @faltadelogica083
    @faltadelogica083 Год назад

    i have a question, is there any way to colour the tabs if their folder's name match the controller's name, im trying to make a pattern where the TestController has the same colour of Index which is inside of a Folder called Test

    • @radboogie
      @radboogie  Год назад

      If the paths have a common phrase in them then you can write a RegEx to match that path.
      If the path to the controller and the path to the index file have "Test" in them, then you could use the RegEx ^.*Test.*$ to match them.

    • @faltadelogica083
      @faltadelogica083 Год назад

      @@radboogie but, when I do something like that, for some reason, all of the tabs stays in the same colour, I don't know why

    • @radboogie
      @radboogie  Год назад

      @@faltadelogica083 it could be an issue with the RegEx. I'd recommend going to regxr.com and use it to test the RegEx to make sure it works how you want.

  • @henda79
    @henda79 10 месяцев назад

    The correct way to colour the files starting with Trait would be ^.*\.Trait*.cs$, put the ^.*\.cs$ at the bottom, as they are evaluated in order.

    • @radboogie
      @radboogie  10 месяцев назад

      Thanks for sharing your knowledge.

    • @henda79
      @henda79 10 месяцев назад +2

      @radboogie to be honest, it was more trial and error, I've only just found the coloured tabs and already it's changed my life 🤣

    • @radboogie
      @radboogie  10 месяцев назад +2

      Lol, I admire your honesty. Without trial and error we wouldn't get very far 😁 I'm sure the info you added will help someone else in the future and that's what it's all about.

    • @anandshindey
      @anandshindey 7 месяцев назад

      For file name containing a pattern you can use ^.*SRV.*\.cs$ . SRV is the pattern in the file name.

    • @radboogie
      @radboogie  7 месяцев назад +1

      Thanks for adding to the knowledge 👍