Sublime Forum

Default folder to save new files

#1
  1. Create new project
  2. Add folder to project
  3. Open that folder in sidebar
  4. CTRL+n
  5. CTRL+s

Save dialog ask to save file into home directory

EXPECTED: save dialog must ask to save file into current folder in sidebar

Please fix this behaviour.
Thank you

0 Likes

#2

Right click any folder in the sidebar and select New File. Select Save and the file will be saved in that folder.

0 Likes

#3

I understand that, but it is not fixing BUG when using CTRL+n

0 Likes

#4

Not a bug, it’s a feature.

Most, probably all, software that implements save as dialogs uses the same default path that you last saved to. This is an OS default. While what you are requesting is not unreasonable, it’s not a bug report but a feature request (meaning you are in the correct forum).

By the way, you can implement this yourself using a small plugin.

[code]import sublime_plugin

class NewFileListener(sublime_plugin.EventListener):
def on_new_async(self, view):
if not view.window() or not view.window().folders():
return
view.settings().set(‘default_dir’, view.window().folders()[0])[/code]

0 Likes

#5

This issue also troubled me .

In old SublimeText , when I create an new untitled file, the default save-folder is as same as the opened file in current view.
But now, the default save-folder depends on Mac OS .

I like the older behavior .

0 Likes

#6

Ok , I wrote a plugin ( for sublime text 3 ) for this request.

gist.github.com/finscn/8bc573bb3a970b1c214d

0 Likes

#7

COOL!

0 Likes

#8

Amazing !

0 Likes

#9

Super

0 Likes

#10

I’ve a question. Will this stop Sublime - on Windows, at least - from offering to save new files . . in the folder from which SublimeText runs itself? That behaviour is bonkers. For, if I open Sublime, write a note, and wish to save it on my desktop, then Sublime offers to save the file . . in C:\Program Files\SublimeText (or some such). Very, very irritating.

0 Likes