random-sublime-text-plugin icon indicating copy to clipboard operation
random-sublime-text-plugin copied to clipboard

Feature Suggestion - User Settings

Open jasonirwin opened this issue 10 years ago • 3 comments

I'd like to run a suggested feature by you. I'm willing to develop the code and submit a pull request, if it is something that there is a need for, beyond my own. I think there are a few cases where user settings could be used to override defaults.

As background, I use this plugin for mockups at work and there are three specific issues I run into.

  1. Typically I use integers for various fixed length identifiers that are displayed on screen.So there may be 20 6-digit integers, and another 20 12-digit integers on the screen at one time. Having to specify the range each time is a little cumbersome and it would be nice to move this to a settings file.
  2. Often, email addresses in my mockups require a specific domain name or set of domains. It would be nice to be able to override the email functionality with a pre-defined set of domains (without modifying the data files).
  3. While random date functionality isn't implemented, it would be nice to be able to generate dates. If this functionality were available it would be nice to be able to a) specify a date range to choose dates from and b) specify the format of the output date.

Here is an example of what I think it would look like:

{
    "random_email_domain_override": ["gmail.com","hotmail.com"],
    "random_int_default_min": 100000,
    "random_int_default_min": 999999,
    "random_date_start_date":"2014-01-01",
    "random_date_end_date":"2014-03-02",
    "random_date_date_format":"YYYY/MM/DD"
}

jasonirwin avatar Feb 19 '15 02:02 jasonirwin

I like the idea of a settings file and if you'd like to submit a PR for that it would be awesome! Having the option to overriding email addresses is a very useful and I like that approach.

Adding int_default/float_default to the settings file is great. Making the plugin remember your previous choice would probably be even more user friendly? I can open an issue for that.

I'm all on board with adding random dates, but I'd like that to be done in a separate PR. I can open another issue for that.

Thanks a lot for some really great ideas @irwinj !

kimpettersen avatar Feb 20 '15 18:02 kimpettersen

Sounds great. I'll get working on it and will submit a PR soon.

jasonirwin avatar Feb 21 '15 02:02 jasonirwin

Sweet! I'll see if I get time to do the part where it remembers the range this weekend.

kimpettersen avatar Feb 21 '15 02:02 kimpettersen