VScode equivalent of Jetbrains/IntelliJ/Rubymine scratches (throwaway notes)
Asked Answered
P

3

37

I recently switched from Jetbrains Rubymine/Webstorm to VSCode.

One feature that I miss a lot is scratches.

Scratch files are fully functional, runnable, and debuggable files, which support syntax highlighting, code completion, and all other features for the corresponding file type. For example, while working on one project, you may come up with an idea for a method that you could later use in another project. You can create a scratch file with a draft of the method, which is not stored in your project directory but can be accessed and opened from another project. You can use scratch files to draft Java code constructs, HTTP requests, JSON documents, and so on.

Is there anything similar in VSCode? I did some research but without success.

Prowl answered 11/1, 2019 at 13:23 Comment(0)
G
33

During my research on the similar issue switching from PHPStorm to VSCode, I found your question and an answer to it here.

Grille answered 14/1, 2020 at 10:14 Comment(1)
thanks for your answer! i found marketplace.visualstudio.com/… in the meantime and quite like it. but your extension looks very promising too!Prowl
E
10

If you just need notes of code snippets that you want syntax highlighting and formatting for (rather than executing) then VS Code issue 60377 says:

Given the VS Code supports hot exit (dirty files are saved for you) this is already supported. Just create an untitled file and you do not even get prompted on exit. Please give this a try, this is how I work with scratch files all the time.

Go to File > New File to create a new "Untitled-#" tab, optionally click the "Select a language" link in the window to enable syntax highlighting and formatting.

Note: Pressing the "New file" button in the explorer creates a named file rather than a temporary unnamed file.

Emileemilee answered 21/10, 2021 at 13:47 Comment(1)
or you could also just do Ctrl+n to create the new fileDuque
W
6

To extend response of https://mcmap.net/q/416531/-vscode-equivalent-of-jetbrains-intellij-rubymine-scratches-throwaway-notes

VSC Plugin: Scratchpads
Plugin url: https://marketplace.visualstudio.com/items?itemName=buenon.scratchpads

How to use:

  • Install plugin
  • Run Command Palette Ctrl + Shift + P
  • Create new file command: Scratchpads: New scratchpad
  • Choose file type and enjoy scratch file
  • To open closed scratch files: run command Scratchpads: Open scratchpad

Some features form README:

Scratchpads README
  Create multiple scratchpad files for doodling while you're coding.

Highlights
  Create multiple scratchpads
  Create scratchpads of different languages and file types
  Enjoy VSCode intellisense in your scratchpads
  Scratchpad are not interfering your project and can be removed at any time
Weaner answered 21/9, 2022 at 10:3 Comment(1)
to the extenstion's author: can you make this appear in the Explorer sidebar where we see files tree, problems, outline, timeline (gosh I never use the last two). I don't want it taking up a whole file's space, just need it tucked under my files list where all these other things are, and importantly, switching between files shouldn't make it go away.Cyb

© 2022 - 2024 — McMap. All rights reserved.