Hello, the only results I’ve been able to find so far from the forums and plugins is people wanting to disable being able to edit read-only files and such.
However, I want to have the file automatically set to read-only each time I save it. Currently I can edit the file and save it just fine, but I have to manually go and set it to read-only and it’s a pain.
The reason I want to do this is for editing a game’s .ini file. The game resets the .ini to default if it detects that it isn’t one of the premade graphic options (high, medium, low, etc).
I tweaked the file for maximum performance, and am now improving the graphics one setting at a time (to look as good as possible while still having steady FPS).
As you can imagine, it is pretty tedious having to go back to the file properties and setting to read-only every time.
Are there any plugins that can do this? Or settings that I missed?
–Edit–
So as of right now, I figured out an okay solution.
I installed this plugin (seems to work in ST3 as well): https://packagecontrol.io/packages/ReadonlyWritable
I then learned how to make custom keybinds in ST3. Go to Preferences --> Key Bindings, then in the Default (Windows).sublime-keymap file you write:
[
{
"keys": ["ctrl+shift+r"],
"command": "set_readonly",
"caption": "Set Readonly"
}
]
Obviously in the keys section you write whatever keybind you want.
I have to hit the keybind after each save, but that is less of a pain than going to the file properties every time.
–Edit #2–
I made a very small Autohotkey script to make it so that when I hit save it runs the read-only keybind for me:
~^s::
Send ^+r
Return
Good enough of a solution for me!