Sublime has this cool feature where you can create a new file (or modify an existing one) and close the text editor without having to explicitly save the modifications.
Next time the editor is opened, the unsaved modifications will still be there.
Is there a way to mimic this behaviour in atom?
This functionality is already included in Atom by default now.
Settings -> Core Settings uncheck Open Empty Editor on Start
Set Restore Previous Windows on Start to Always.
Settings -> Packages -> autosave. In package settings check Enabled.
Also, restore will not work in Atom unless at least one Project has been added to the Project pane. You can add anything there. You can just add my Documents folder.
This sublime feature is called hot exit. Although atom doesn't has this feature this package claims to implement it.
Note: I haven't tested it, so I don't know if it really works; be careful in order to avoid losing your work.
Related
When an app stops in debugging mode and I make changes to the code
Is there a way to save the code with the changes, without stop the app?
Although the VB6 IDE does not provide this natively, an add-in for the IDE called MZTools has been around for ages which adds this feature.
Personally I've used MZTools 3.0 for many years, and this works really well.
This is what its help system says:
Shortcut To Save File At Debug-Time
The Shortcut To Save File At Debug-Time feature allows you to define a keyboard shortcut (Options
window, Shortcuts tab) to save the selected file at debug-time. The
Visual Basic IDE does not allow to save files at debug-time, but often
it is useful to save the modifications that you have made to the
source code at debug-time.
Remarks:
This feature is not available in the VBA version of MZ-Tools. This
feature only works at debug-time. Since Visual Basic disables buttons
or menus of add-ins at debug-time, the only way to save a file at
those times is through a keyboard shortcut. The file must be
previously saved at design-time, that is, MZ-Tools does not prompt for
a name to save the file (it shows an error message instead).
This is the options window for how I have it configured locally:
Note that originally MZTools was free in version 3 and later they switched to a paid version; if I hadn't gotten v3 originally however it would be well worth paying for, not only for this feature.
The short answer is you can't.
If you make the project before the crash, maybe this piece of code can be found in a ".tmp" file. But searching in .tmps is often a waste of time.
I particularly always force myself to stop the debug and save my progress.
And I always use this setting which forces me to remember to save:
I'm working with RubyMine 2017.1.3 on Linux and it appears that RubyMine has modified one of my files to better fit its own idea of formatting. That causes distracting changes in the files since I have to inspect the differences (as detected by Git) and see if they are changes that I meant to make or what.
Is there a way to prevent RubyMine from automatically modifying a file? I searched through the settings but I wasn't able to find anything.
Go into Preferences -> Editor -> Code Style -> Ruby and change the settings to match your existing code (e.g. line spacing, tab width, etc).
Make sure to pick the correct boxes when commiting changes.
I was wondering how is it possible to assign keyboard shortcut that will reset my opened VS window to my saved settings (full setting import)?
I am not talking about Tools > Import and Export Setting (I want to have a single Reset shortcut) also I am not talking just about ResetWindowLayout option (this one only resets windows layout, not all settings).
Manually all settings can be restored from saved file by going to
Tools > Import and Export Setting
Import Selected Environment Settings > select "Just Import new settings, overwriting my current settings" radio button
Choose a collection of Setting to Import > select a saved file
Choose Setting to import > Check "All Setting" checkbox
Click Finish
Too many steps, I just want to import my setting with one click, similar to ResetWindowLayout to which I can assign a keyboard shortcut.
Any ideas ?
New Answer
Install the macro extension from Microsoft.
https://visualstudiogallery.msdn.microsoft.com/d3fbf133-e51b-41a2-b86f-9560a96ff62b/view/Reviews
Create two macro files. Adjust your paths. (I think you need to keep the commented reference path.
SaveSettings:
dte.ExecuteCommand("Tools.ImportandExportSettings", "-export:C:\\Docs\\VS2013\\Settings\\BACKUP.vssettings");
LoadSettings:
dte.ExecuteCommand('Tools.ImportandExportSettings', '-import:C:\\Docs\\VS2013\\Settings\\BACKUP.vssettings');
Old Answer - Still can work for you. I unsure the project is not supported anymore.
Your are in luck. We both had this same question today and I was considering making something myself before stumbling on this.
VS Settings Switcher
This supports saving and loading settings as profile names.
Even better, you can set a solution to default to a particular settings profile. Useful if your project is a web project to appear as a certain layout. Or a class library project with unit testing layouts. Or even for switching between multi and single monitor.
One of the tests I performed with this tool was to not only close and move around my tool windows, but I deleted icons from my toolbars. I then restored all my changes by applying the saved profile.
Especially when using an sftp drive (but this problem is also an issue with local drives, although thankfully not as frequent), the folders in the sidebar just keep spinning and spinning, and the "Open Anything" dialog therefore has no files to choose from.
"Project > Refresh folders" does not work in most cases.
I've resorted to restarting Sublime manually, which works most of the time, but it's getting to be a pain to have to do this every other time I switch projects.
Is there any better way to "force" the folders to refresh?
This problem is the reason I asked this question:
How to save project state before exiting in ST3 on Windows?
The SublimeRestart plugin doesn't work on Windows until this project-state-saving problem is solved. However, even if it did work perfectly, it would still only be a workaround for this really annoying non-refreshing-folders issue.
My workaround on Windows, FYI: After loading a project, when the folders don't refresh (don't load even the first time), I have ctrl+f10 bound to "File > Exit", and f10 configured into the shortcut that I launch Sublime Text with. So two reasonably-quick (although additional!) button presses.
Open Sublime Text.
Select Preferences from the top menu and click Key Bindings – User. Here you will see a JSON file that should contain an array of objects (initially the array is empty). Every object will represent a shortcut.
Add the following (new shortcut object) entry into the array (between the brackets):
{
"keys" : ["f5"],
"command" : "refresh_folder_list"
}
You should be able to refresh the folders with F5.
Try to Install this package:
https://packagecontrol.io/packages/SideBarEnhancements
Open the package folder. Main menu -> Preferences -> Package Control: -> Package Control: Install Package
Search the keyword: SideBarEnhancements
Enjoy it
After you install this plugin, you will see the refresh button in your sidebar option:
I have added this myself the other day. I constantly work in an environment where files in the project are changing before I can see them.
Goto 'Preferences' menu -> 'Key Bindings' -> 'User' which will open a JSON file, add below code, save and close that file.
{ "keys": ["ctrl+f5"], "command": "refresh_folder_list" }
It will work like charm 100%. Thanks for asking this question.
This isn't going to be a very useful answer but it documents some early behaviour in Sublime Text that would solve your problem, assuming you need no later features from Sublime Text 2/3 (a big assumption indeed).
Sublime Text 1 had the handy feature in the folder context menu to "Refresh folder". This cause an immediate indexing of only the specified directory (and subdirectories) which was a boon when using networked drives over high-latency connections.
This was deprecated in Sublime Text 2.
Version 1 is available here or by direct download here. It's not clear that these will be available indefinitely though, so this isn't necessarily a long-term solution.
If a file open in geany is modified by another program, and geany is then brought to the front, then geany displays a modal dialog as follows.
The file 'stuff.txt' on the disk is more recent than
the current buffer.
Do you want to reload it?
This dialog is displayed, blocking any sort of work flow if files are continually regenerated by running command-line tools. How can this behavior be changed so that the dialog does not appear, and geany automatically reloads any such file?
Close Geany (else your changes will be overwritten), then open geany.conf in a different editor. Find disk_check_timeout and set it to 0. Save that, and reopen Geany.
Open geany.conf in a different editor and set the line reload_clean_doc_on_file_change=false to reload_clean_doc_on_file_change=true
The dialog cannot be disabled and automatic reloading is not supported (which could be bad anyway, depending on whether you've made changes to the document).
That being said, I had started working on a better method using GtkInfoBar like Gedit uses so that it wouldn't block you from working but still notify you of changes. Unfortunately I haven't had much time or interest to push it through into the master branch. If you feel like trying to use it (not recommended in current out-of-date/incomplete state) or continuing work on it, the branch is here.