ColorHelper icon indicating copy to clipboard operation
ColorHelper copied to clipboard

[Out of the box] Enable color previewer/picker for plain-text in a temporary new file

Open Mark-Joy opened this issue 2 years ago • 6 comments

No issue here!! Just want to say that It took me an hour for a noob as so ordinary as me to read through the documents to do just a simple thing: Enable color previewer/picker for plain-text in a temporary new file Simply copy the below code into right handside of: Preference -> Packages Settings -> ColorHelper -> Settings That's it! That's all a noob needs to know to make life easier :) Well, in case you are as noob as me! lol

colorHelper-scanning

// Settings in here override those in "ColorHelper/color_helper.sublime-settings",

{
  "generic": {
        "allow_scanning": true,
        "scanning": ["-comment -string"],
        "color_class": "css-level-4"
    },

}

Mark-Joy avatar Sep 23 '22 15:09 Mark-Joy

You can just run the following command from the command palette: Color Helper: Override View's Scanning. I'm not sure if I documented it though....

facelessuser avatar Sep 23 '22 15:09 facelessuser

For clarity, the above command will temporarily enable basic previews and such in a text file. Personally, I would not just enable generic scanning in all text files. I like to enable it only when I need it.

facelessuser avatar Sep 23 '22 15:09 facelessuser

I'm not specifically sure what the request is asking, but I don't think we'll encourage people to generically enable previews everywhere. With that said, I will double-check the documentation and see if we specifically talk about view overrides, and if not, or if it doesn't appear clear, I will update the docs accordingly.

facelessuser avatar Sep 23 '22 15:09 facelessuser

Well, not all users are in html/xml/css things. I just want a convenience way to pickup/choose colors in some setting files, and there was like no quick tooltips to do that on the home page. Like quickly enable it, use it, done, disable it :D

Anyway, thank you for your great project! When it's enable the right way, it's really help me to do the job faster and easier.

Mark-Joy avatar Sep 23 '22 16:09 Mark-Joy

Well, not all users are in html/xml/cssthings.

I understand this, my point is more that enabling everywhere can potentially cause false positives and noise where color previews are not desired. I work in other things than HTML/XML/CSS as well, but I don't like color previews popping up everywhere, but if I do want them, I like that I can bring them up on demand.

I just want a convenience way to pickup/choose colors in some setting files, and there was like no quick tooltips to do that on the home page. Like quickly enable it, use it, done, disable it :D

Everybody is different, and I'm not trying to discourage you from doing what you want, but just mentioning that is probably not the recommendation path I want to send people down by default. You may like having them enabled everywhere now, but find that it can get annoying in the future, or maybe you'll always like it, but I think in the docs, we will recommend a more conservative approach.

facelessuser avatar Sep 23 '22 16:09 facelessuser

Agreed!! I understand your point. The thing is as a new user I dont know what I can do and can not do with your package. I have to read through the document: https://facelessuser.github.io/ColorHelper/usage/ Even then, there was no mention about command palette to enable color helper in some random files Color Helper: Override View's Scanning Hence this topic was created to help some random guys save some time facing the same issue. Cheers!

Mark-Joy avatar Sep 23 '22 16:09 Mark-Joy

Hi. Is there any way to turn on Override View's Scanning for all files by default in config? Thx

ArtJuice avatar Oct 30 '22 13:10 ArtJuice

Override View's Scanning is view specific command that overrides a view on demand, so it cannot be applied globally.

Currently, there is no global way to force all views to show color previews except what is suggested in the OP. When doing what is done in the opening post, you don't get too much language-specific control, so it'll just show previews everywhere that are not found in strings or comments, but you can remove that requirement, or come up with a better generic rule if desired as well.

If there is a file type I prefer to have colors in all (or most of) the time, I simply add a new rule for that file type. If you truly want colors in all files, regardless of the language, then enabling scanning in generic via override is what you want. Then you can disable via Override View's Scanning only when you want.

facelessuser avatar Oct 30 '22 15:10 facelessuser