use another editor for "Change Settings File Directly"

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
SkipR
Junior Member
Junior Member
Posts: 69
Joined: 2008-03-27, 10:39 UTC
Location: W. Australia

use another editor for "Change Settings File Directly"

Post by *SkipR »

I would really like to default to an editor that is NOT %windir%\notepad.exe for "Configuration"|"Change Settings File Directly" - can I change which editor is used for this?

What about using the current value of the user defined editor (menu Configuration|Options|Edit/View" ) instead of %windir%\notepad.exe as an override ?
Skip
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: use another editor for "Change Settings File Directly"

Post by *Hacker »

SkipR,
Currently not possible. You can define a custom button on the button bar, or a custom item in the menu, etc. This restriction exists because someone might have a hex editor defined as the default editor which might be less than ideal in this case. If it's a reasonable restriction or not is a matter of opinion I'd say.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: use another editor for "Change Settings File Directly"

Post by *tuska »

I have solved this issue with a shortcut [and other settings], e.g.

usercmd.ini

Code: Select all

[em_Wincmd-ini_Edit]
button=
cmd=%COMMANDER_INI%
wincmd.ini - Shortcut: ALT+i

Code: Select all

[Shortcuts]
A+I=em_Wincmd-ini_Edit
Windows key + i -> Apps -> Standard apps -> Select standard apps by file type
Assign file types to specific apps - Name:
.ini
INI file
Click on the icon on the right and select your app (editor).

Configuration -> Options... -> Edit/View: -> Editor for F4

Code: Select all

%COMMANDER_PATH%\Tools\EmEditor-portabel\EmEditorProfessional_64-bit_portabel\EmEditor.exe "%1"
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: use another editor for "Change Settings File Directly"

Post by *Stefan2 »

tuska wrote: 2020-06-22, 09:30 UTC ...
cmd=%COMMANDER_INI%
...

And vise-versa for those who need the second setting file too:

%COMMANDER_INI%\..\wcx_ftp.ini







 
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: use another editor for "Change Settings File Directly"

Post by *tuska »

Stefan2 wrote: 2020-06-22, 10:25 UTC
tuska wrote: 2020-06-22, 09:30 UTC ...
cmd=%COMMANDER_INI%
...
And vise-versa for those who need the second setting file too:
%COMMANDER_INI%\..\wcx_ftp.ini
Thank you for pointing that out.

Interestingly enough, I use "em_command": %COMMANDER_INI% and shortcut ALT+I and only the wincmd.ini file is opened.
The wcx_ftp.ini file remains closed, even though it is located in %COMMANDER_PATH%.
Hmm.
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: use another editor for "Change Settings File Directly"

Post by *Stefan2 »

tuska wrote: 2020-06-22, 10:41 UTC
Stefan2 wrote: 2020-06-22, 10:25 UTC
tuska wrote: 2020-06-22, 09:30 UTC ...
cmd=%COMMANDER_INI%
...
And vise-versa for those who need the second setting file too:
%COMMANDER_INI%\..\wcx_ftp.ini
Thank you for pointing that out.

Interestingly enough, I use "em_command": %COMMANDER_INI% and shortcut ALT+I and only the wincmd.ini file is opened.
The wcx_ftp.ini file remains closed, even though it is located in %COMMANDER_PATH%.
Hmm.

Yes, and now? ... your command only refers to the wincmd.ini, so your result seams to work perfectly fine.



You have to open both INIs if you want that. Maybe somehow like this:


[em_Wincmd-ini_Edit]
cmd="%COMMANDER_INI%"

[em_WincmdFTP-ini_Edit]
cmd="%COMMANDER_INI%\..\wcx_ftp.ini"

[em_ConfigChangeIniFiles]
cmd=em_Wincmd-ini_Edit,em_WincmdFTP-ini_Edit



There are probably more ways,.... maybe petermad have some tricks in his extended languages files...


- - -


For others who have not set an other default editor than Notepad.exe as you did,
they can define the wanted editor directly in the user defined command as shown below:

[em_Edit_WincmdINI]
cmd=" "D:\rive\path\to my editor\editor.exe" "%COMMANDER_INI%" "

or more portable:
[em_Edit_wcxFTPini]
cmd=" "%Commander_Path%\myTools\MyEditor\editor.exe" "%COMMANDER_INI%\..\wcx_ftp.ini" "

[em_Edit_usercmdINI]
cmd=" "%Commander_Ini%\..\usercmd.ini" "

[em_ConfigChangeIniFiles]
cmd=em_Edit_WincmdINI,em_Edit_wcxFTPini,em_Edit_usercmdINI


- - -

Can be added to the language *.MNU too

MENUITEM "&Change Settings Files Directly...", 581
MENUITEM "&Change Settings Files Directly... (em_cmd)", em_ConfigChangeIniFiles


TOTALCMD.INC, text file with all TC-internal commands, says:
cm_ConfigChangeIniFiles=581;Open ini files in notepad


- - -


Or create just some buttons (I use no quoting, as I don't have spaces in my paths):
%Commander_Path%\TOOLs\NotePad2\notepad2.exe %Commander_Ini%
%Commander_Path%\TOOLs\NotePad2\notepad2.exe %Commander_Ini%\..\wcx_ftp.ini
But quotes doesn't harm,
so for button use this quoting:
"%Commander_Path%\TOOLs\NotePad2\notepad2.exe" "%Commander_Ini%\..\usercmd.ini"
and for usercmd.ini use this quoting:
" "%Commander_Path%\TOOLs\NotePad2\notepad2.exe" "%Commander_Path%\HISTORY.TXT" "




 
User avatar
tuska
Power Member
Power Member
Posts: 3741
Joined: 2007-05-21, 12:17 UTC

Re: use another editor for "Change Settings File Directly"

Post by *tuska »

2Stefan2
Thank you!
I think I should take a longer break from writing. :(
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: use another editor for "Change Settings File Directly"

Post by *Horst.Epp »

The easy way to open both ini files is using the command:
cm_configChangeIniFiles
I use NotepadReplacer to replace all calls to notepad to my editor SynWrite.
https://www.binaryfortress.com/NotepadReplacer/
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: use another editor for "Change Settings File Directly"

Post by *petermad »

2Stefan2
maybe petermad have some tricks in his extended languages files...
No, I only have separate commands for opening the ini files in default editor - but I cover all the basic ini files:

Code: Select all

[em_ext_editwincmd]
cmd=%COMMANDER_INI%
path=%COMMANDER_INI%\..
menu=Edit main ini-file

[em_ext_editwcx_ftp]
cmd=wcx_ftp.ini
path=%COMMANDER_INI%\..
menu=Edit wcx_ftp.ini

[em_ext_editfsplugins]
cmd=fsplugin.ini
path=%COMMANDER_INI%\..
menu=Edit fsplugin.ini

[em_ext_editlsplugins]
cmd=lsplugin.ini
path=%COMMANDER_INI%\..
menu=Edit lsplugin.ini

[em_ext_editpkplugins]
cmd=pkplugin.ini
path=%COMMANDER_INI%\..
menu=Edit pkplugin.ini

[em_ext_editcontplugins]
cmd=contplug.ini
path=%COMMANDER_INI%\..
menu=Edit contplug.ini

[em_ext_editusercmd]
cmd=usercmd.ini
path=%COMMANDER_INI%\..
menu=Edit usercmd.ini
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
SkipR
Junior Member
Junior Member
Posts: 69
Joined: 2008-03-27, 10:39 UTC
Location: W. Australia

Re: use another editor for "Change Settings File Directly"

Post by *SkipR »

Thanks to all, for helpful posts, I went with menu change to launch my editor of choice all is working fine.
Stefan2 wrote: 2020-06-22, 10:50 UTC
Can be added to the language *.MNU too

MENUITEM "&Change Settings Files Directly...", 581
MENUITEM "&Change Settings Files Directly... (em_cmd)", em_ConfigChangeIniFiles
2Stefan2,
This is the first time I have setup a custom MNU file (SR.MNU). Before I made change I was puzzled by menu setup. Is their a builtin set of default hardcoded menus because configuration menu item (currently displayed) was slightly different to contents of WCMD_ENG.MNU ?

I see a new item "Mainmenu=c:\pathtoTC\languages\SR.MNU in wincmd.ini after I cloned, edited, and selected that file.

If I do a typical release update that has a newer languages\WCMD_ENG.MNU - am I correct in assuming I need to check for NEW differences between the two MNU files?
Skip
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: use another editor for "Change Settings File Directly"

Post by *petermad »

Is their a builtin set of default hardcoded menus because configuration menu item
Only the English menu is hardcoded and it is used if you choose "English" in the language setup. If you choose "English (WCMD_ENG.LNG)" then the WCMD_ENG.mnu is used (unless you manually insert another menu file).
If I do a typical release update that has a newer languages\WCMD_ENG.MNU - am I correct in assuming I need to check for NEW differences between the two MNU files?
Yes.

Notice that if you change language via the Configuration UI, then the menu file is automatically changed to the menu file that has a name that corresponds to the language file name
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply