SublimeText / AdvancedNewFile

File creation plugin for Sublime Text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't work out how to replace default ctrl-S behaviour with the plugin's

opened this issue · comments

I have this in my keybindings global file:

[
// New file
{ "keys": ["ctrl+s"], "command": "advancedNewFile" },
]

Yet, it doesn't work; pressing ctrl-S does nothing. Please advise. I do feel that your documentation could be clearer on this matter. Perhaps I miss something though. Thanks.

The name of the command is advanced_new_file_new. Valid command names can be found on https://github.com/skuroda/Sublime-AdvancedNewFile/wiki/Commands. Thank you for using AdvancedNewFile.

Thank you. However: that does not seem to work (tested on Linux). Please explain in a straightforward fashion how I can make ctrl-S save in a directory, and with a filetype, that I have preset.

{"keys": ["ctrl+s"], "command": "advanced_new_file_new"} in your user key bindings file should work. If it is not, you can enable some level of ST debugging by entering sublime.log_input(True) in the ST console.

When enabled, you should see an entry similar to

key evt: control+s

Setting an extension can be done by setting default_extension, in your AdvanedNewFile user settings file.

"default_extension": ".txt"

If you are still having trouble with the key bindings, you may want to review http://docs.sublimetext.info/en/sublime-text-3/customization/key_bindings.html or ask on https://forum.sublimetext.com/. I haven't done much work with the Sublime Text plugins in quite some time, so there may be new tooling or configurations available to better isolate the problem.

Thank you.

I tried those suggestions, on Windows and Linux, with results I regard as poor. To wit: when I tried to save my existing AdvancedNewFile.sublime-settings file (!), I was prompted, in the status bar - not even a GUI - for a new file name.

Unless I make some mistake, this cure for SublimeText's new file handling is more inconvenient than the original disease.

It sounds like this is a misunderstanding of what this plugin does. It's designed to create a new named file, not save the existing file.

While I believe it's been improved now, earlier versions of sublime text always required saving new files via a GUI. For many use cases, this was unnecessary, as the file being created was known. To put this another way, it is an enhancement of creating and saving a new file without requiring a file UI interaction.

Yes, I think I misunderstood what the plugin is intended to do.