Sublime Forum

Default save location and default file extension

#1
  1. How do I set the default save location for a file?
  2. How do I set the default file type when saving a file?
0 Likes

Setting to change the default save location?
#2
  1. The default save location is the location of the last active saved file.
  2. The default file type is based on the syntax applied to the buffer (shown in the lower-right corner, on the status bar).
0 Likes

#3

[quote=“adzenith”]1) The default save location is the location of the last active saved file.
2) The default file type is based on the syntax applied to the buffer (shown in the lower-right corner, on the status bar).[/quote]

  1. Not for me, mine always defaults back to the Sublime install directory
  2. It says “Plain text” but it never appends the .txt extension automatically.
0 Likes

#4

Is it possible to define the default extension (txt for example)?

0 Likes

#5

bump

0 Likes

#6

I have the VERY same two questions!

Can we set somehow to always save on the desktop by default instead of current file’s dir?

My syntaxes are now all set (was difficult to have them work), and, in my case, it is set to AutoHotKey. However, I’d like to have Sublime always assume I’m writing a .txt file to be saved in the desktop by default (thus automatically appending the .txt extension) and do not apply the AHK syntax unless I save with the .ahk extension for the first time. Is it possible?

0 Likes

#7

bump

The default behavior assumes I never work on two projects, or that it is perfectly fine to randomly save files from one project into another. Furthermore, it’s weird enough that I assume it works right until my file is missing when I try to add it to git. This is wrong and indefensible.

0 Likes

#8

You can use github.com/skuroda/Sublime-AdvancedNewFile to create your files. Don’t know how well it’ll fit your workflow, but you can define initial paths and a default extension.

0 Likes

#9

bump…
Is there any status or ideas about this… it really is very frustrating…

updated:
I’ll clarify that the most frustrating part is where the file is saved. And, searching doesn’t seem to provide any ways/ideas on how to fix this…

0 Likes

#10

It is now some year later, and I too want action on these two fronts of (1) setting a fixed, default file save location and (2) on Windows, getting Sublime to be the default editor for extensionless text files. Come on, Sublime Text, you are meant to be a good editor, so get these things (and, for goodness sake, the lack of native printing support) sorted out. Not doing so is just slapping yourself in the face, frankly.

0 Likes

#11

1 https://github.com/SublimeTextIssues/Core/issues/1418#issuecomment-252268641
(or how about writing a two line plugin to set the default folder from preferences when a new tab is created?)
2 has nothing to do with ST:
https://superuser.com/questions/13653/how-to-set-the-default-program-for-opening-files-without-an-extension-in-windows

0 Likes

#12

It is now even more years later, and I thought I had the same problem as everyone else…They might genuinely have a problem but for me I realized that It turns out that for only the first time you “Save as…” you have to specify the file path and the type of file manually. Once you do that, it then saves to the last active file, depending on where you saved it. Hopefully this helps.

0 Likes

#13

see this Is it possible to set a default folder for project files?

1 Like

#14

[Because this thread keeps coming up on Google / DuckDuckGo]

https://sublime-text-unofficial-documentation.readthedocs.io/en/latest/reference/settings.html#file-and-directory-settings has the variable default_dir for your settings file. On my Windows machine that is CTRL-SHIFT-P --> preferences:settings, then add a line

"default_dir": "C:\\Users\\tcl\\OneDrive\\Desktop",

(you have to escape the \)

Thorsten

0 Likes