The trick is to mark a view as “scratch” before closing.
I wouldn’t recommend to close view’s with unsaved content automatically without prompting as this is likely to cause accidental data loss.
The safest solution is probably to create dedicated views for note taking, which are not intended to be saved later.
If really required a plugin can also provide a command to suppress promt and directly close files.
Default.sublime-commands
[
{ "caption": "File: New Scratch", "command": "new_scratch" },
{ "caption": "File: Close Without Saving", "command": "close_without_saving" },
]
Packages/User/file_management.py
import sublime_plugin
class NewScratchCommand(sublime_plugin.WindowCommand):
def run(self):
view = self.window.new_file()
if view:
view.set_scratch(True)
class CloseWithoutSavingCommand(sublime_plugin.WindowCommand):
def run(self):
view = self.window.active_view()
if view:
view.set_scratch(True)
view.close()
return
sheet = self.window.active_sheet()
if sheet:
sheet.close()