Home Download Buy Blog Forum Support

Save file without dialog window

Save file without dialog window

Postby HQ0 on Thu Oct 18, 2012 8:27 am

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
HQ0
 
Posts: 2
Joined: Thu Oct 18, 2012 8:24 am

Re: Save file without dialog window

Postby Eduan on Thu Oct 18, 2012 1:40 pm

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
Check out my blog and website: EduanTech.com (currently undergoing some facial and organs makeover...)
Also check out my profiles: GitHub - Greduan | BitBucket - Greduan
Eduan
 
Posts: 140
Joined: Sun Oct 14, 2012 4:05 pm

Re: Save file without dialog window

Postby HQ0 on Thu Oct 18, 2012 5:38 pm

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

Can i save file immidiatly after ctrl+s without any system dialogs ?
HQ0
 
Posts: 2
Joined: Thu Oct 18, 2012 8:24 am

Re: Save file without dialog window

Postby Eduan on Thu Oct 18, 2012 5:41 pm

I'm not sure what you mean. :|

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
Check out my blog and website: EduanTech.com (currently undergoing some facial and organs makeover...)
Also check out my profiles: GitHub - Greduan | BitBucket - Greduan
Eduan
 
Posts: 140
Joined: Sun Oct 14, 2012 4:05 pm

Re: Save file without dialog window

Postby adzenith on Thu Oct 18, 2012 9:56 pm

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.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Save file without dialog window

Postby sublimator on Thu Oct 18, 2012 11:55 pm

I don't think this is possible...


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)
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Save file without dialog window

Postby sublimator on Fri Oct 19, 2012 2:03 am

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 ...
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Save file without dialog window

Postby adzenith on Fri Oct 19, 2012 5:10 pm

Ooh good point. Forgot about retarget! Thanks :)
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: Exabot [Bot] and 9 guests