Sublime Forum

Save file without dialog window

#1

Hi guys,

I use Sublime text 2, 2.0.1, 2217 for now.
Please, say me, can I save file by ctrl+s or some other configuration without any dialogs?

Like in vim. Type :e test.php and all`s okay. I tried to enable vim mode… :e and :w work same like as standart ctrl+s

0 Likes

#2

Hello there,

Well if you’re in Windows then it’s Control+s, in Mac Command+s (and to save all Option+Command+s), in Linux I’m not sure though.

Although I don’t know how to use Vim, so I don’t know if Vintage Mode changes anything.

  • Eduan
0 Likes

#3

I know about control+s :smiley:
My question is not about this.

Can i save file immidiatly after ctrl+s without any system dialogs ?

0 Likes

#4

I’m not sure what you mean. :neutral_face:

You mean the dialog that sometimes comes up after you save a file? That dialog is by Sublime Text and it’s only when you have the trial version.
Could you show us a screenshot of what you mean?

  • Eduan
0 Likes

#5

I don’t think this is possible… Have you tried calling something like view.run_command(“save”, args={“filename”:“foo.c”})? But then you’d just be guessing variable names.

0 Likes

#6

Come on, don’t be like that lol

You might have to implement dumping the buffer contents to disk yourself (*), then use view.retarget() (used by the Default/ renaming plugin) …

Awkward but definitely possible

  • (not a big deal if you only care utf8)
1 Like

#7

Come to actually think of it, you can probably just get away with doing view.retarget(file_name) on an unsaved buffer, then call save and Sublime will do the rest.

Give it a shot. Pretty sure a plugin using view.retarget() will get you what you want anyway …

0 Likes

#8

Ooh good point. Forgot about retarget! Thanks :smile:

0 Likes