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