by Mofi » Wed Jul 25, 2012 1:09 am
I have another suggestion: using 2 INI files with different settings.
The first INI file is the standard uedit32.ini used for general text editing. In this INI the version backup feature is not enabled nor the backup feature at all. Also other configuration settings not useful for general text editing like Reload files previously open on startup, Save bookmarks, Save folded lines, ... are disabled. The configuration is simply set for editing text files of any kind with remembering in uedit32.ini as less as possible.
But for programming purposes a second INI file is used with different settings. This second INI file must be created manually by opening in Windows Explorer %APPDATA%\IDMComp\UltraEdit. Next a copy of uedit32.ini must be made with a different name like ueprog.ini. Also uedit32.in0 and uedit32.uek must be copied to ueprog.in0 and ueprog.uek.
Suggestion 1: Using programming configuration via command line parameter:
A copy of the UltraEdit shortcut on desktop, start menu or quick launch bar must be made. I suggest as shortcut name UE Programming. The properties of the shortcut must be opened to edit the command line. As you surely want to be able to use both INI at the same time and I suppose that configuration setting Allow multiple instances is not enabled so that all files are opened in same instance of UltraEdit, you need to append to command line /fni /i="%APPDATA%\IDMComp\UltraEdit\ueprog.ini"
If you click on this shortcut, always a new instance of UltraEdit is started with using the configuration settings as stored in ueprog.ini instead of using uedit32.ini. Click on this shortcut after saving the modified properties of this shortcut.
Now configure UltraEdit for programming. Enable version backup, enable other advanced features not needed for general text editing, select perhaps a different environment. You should change something on workspace so that you can easily see if this is UltraEdit with configuration for programming or for standard text file editing. For example the background color can be slightly different or the toolbar is configured different.
A problem with this method is to control what happens if you double click on a file in Windows Explorer to open it in (already running instance of) UltraEdit or when using Explorer shell extension of UltraEdit.
In the programming configuration the setting Allow multiple instances should be checked. This is important if you have only UltraEdit with configuration for programming currently running and you double click on a text file to open it in UltraEdit for general text editing. The file should be opened in UltraEdit using uedit32.ini and therefore it is important that Allow multiple instances is in the programming configuration enabled to avoid opening the file in this configuration. Source code files must be opened in UltraEdit with programming configuration either from within UltraEdit (File Open, Quick Open, Explorer or Project tab) or by drag and drop into UE window with programming configuration. In standard configuration (uedit32.ini) the setting Allow multiple instances should not be checked.
But there might remain a problem (not tested by me). If first UltraEdit with programm configuration is started and a second UltraEdit with standard configuration is also running, files opened with a double click could be opened always in a new instance of UE with standard configuration instead of the already running second instance of UltraEdit with standard configuration.
So this method might work only well if you in general work with Allow multiple instances also for general text editing.
Suggestion 2: Using programming configuration via copied UltraEdit program:
This is like the suggestion above, but with an important difference. Instead of creating a shortcut with command line parameters to start a new instance of UltraEdit and load the configuration from ueprog.ini, uedit32.exe and uedit32.chm in UltraEdit program files directory are copied to ueprog.exe and ueprog.chm in same directory. Of course this copy of the 2 files must be made every time after updating UltraEdit. That's the only disadvantage of using this method.
Next the shortcut of UltraEdit on desktop, start menu or quick launch bar must be copied to UE Programming and in the properties of this shortcut the name of the EXE file must be changed to ueprog.exe. That's it, no additional command line parameters.
If you start ueprog.exe via the shortcut, UltraEdit searches now for ueprog.* in %APPDATA%\IDMComp\UltraEdit and makes use of the configuration in those files.
With this method it is also possible that Allow multiple instances is also not checked in the programming configuration as this UltraEdit instance has the name ueprog.exe in the process list of Windows. So if you double click on a file associated with uedit32.exe, uedit32.exe is started and the configuration settings are loaded from uedit32.ini. If an instance of uedit32.exe is already present in Windows process list, the name of the file to open is passed to this instance of UltraEdit and the second instance of uedit32.exe is immediately closed again.
Further you can manually in Folder Options of Windows change existing file associations with uedit32.exe to ueprog.exe if they were made with Windows Explorer. If the file associations were made with UltraEdit at Advanced - Configuration - File Associations, the change of the file association should be done also with UltraEdit. Start UltraEdit with standard configuration (uedit32.exe), open the file associations configuration dialog and remove those file types which should be associated in next step with ueprog.exe. Close the configuration dialog with OK after removing the file associations. Now start UltraEdit with programming configuration (ueprog.exe), open the file associations configuration dialog and add the file extensions for those files which should be always opened in this configuration. UltraEdit registers them in Windows registry with ueprog.exe.
For example for source code files with extension C, CPP, H (for C/C++) the association could be changed to ueprog.exe. Double clicking on a file with such an extension now results in starting ueprog.exe and opening the file in UE with programming configuration. If an instance of ueprog.exe is already running, ueprog.exe passes the name of the file to open to already running instance of ueprog.exe and quits itself.
Conclusion: With creating a copy of uedit32.* files to ueprog.* files in program files and configuration files directory of UltraEdit you have more or less 2 UltraEdit with 2 different configurations and you can decide which files are opened in which configuration.