Sublime Forum

How to name new file in a folder without having to Save?

#1

I have some folders in the Side Bar. If I right click on a folder and select New File an untitled file is created, which doesn’t appear within the folder. Is there a way to name this file, without having to do a Save? Like a right click?

And to get the file to automatically appear within the folder (before doing a Save)?

0 Likes

#2

Yes, because that’s how New File works. It creates a new buffer with the metadata about the right clicked folder so that when you save it, the OS Save dialog opens in the directory of the right clicked folder. There are ways where you can just have an input panel, where you type the name of the file and enter to create the file.

So,2 ways

  1. Install a package to do it. Some that come to mind are AdvancedNewFile, FileManager etc
  2. Create your own small plugin to do it and register the command in Side Bar.sublime-menu.

Option 2 of course depends on some familiarity with the sublime API and Python knowledge. Option 1 is easier.

0 Likes