lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2k stars 43 forks source link

[Request] Set snippet as new tab default #603

Open jackcannon opened 5 months ago

jackcannon commented 5 months ago

Snippets are useful to an extent. I mostly find myself using them to add all the imports that I normally use. This can be a bit annoying when everytime I open a new tab, I need to manually add the snippet that I know I want added for in every tab that I use.

Therefore a setting in the settings titled something like "Populate new tabs with...", and a dropdown of "Nothing (default)" followed by all your saved snippets. Then when you open a new tab, it's already got the imports I need.

I am aware there is a 'Open Snippet in New Tab' option in the snippets window, but that's as cumbersome as adding the snippet manually.

lukehaas commented 5 months ago

Thanks @jackcannon. Just want to check first that you're aware you can insert snippets via autocomplete? For example, if I had a snippet named xyz and I start typing that name, then I can insert it via the autocomplete suggestion:

Screenshot 2024-02-01 at 15 09 14

This should make it easy to add a snippet after you open a new tab.

jackcannon commented 5 months ago

Hi, Yes, sorry, I didn't make it clear - that's what I do atm. But it's still extras steps when I know that I want all new tabs to open with the same thing.

  1. Open new tab
  2. Try to remember what the snippet is called
  3. Start typing the snippet name
  4. Select it from the several similarly named snippets
  5. Enter
  6. Back to thinking about what I want to do

vs

  1. Open new tab
  2. Done