The 'shortcuts.xml' file is NOT re-created if you delete it, on purpose or by mistake !
-
Hi All,
One week ago, I was testing some shortcuts on a new portable version
v8.8. Particularly, the Scintilla messagesSCI_DELETEBACKandSCI_DELETEBACKNOT LINE!By default :
-
The
SCI_DELETEBACKNOTLINEmessage has NO defined shortcut -
The
SCI_DELETEBACKmessage has two defined shortcuts :BackspaceandShift + Backspace
So, I wanted to change this behavior and tried to get this configuration :
-
Define the
Backspaceshortcut for theSCI_DELETEBACKNOTLINEmessage -
Define the
Shift + Basckspaceshortcut for theSCI_DELETEBACKmessage
These changes implies this new behavior :
-
The hit of the
Backspacekey always stops at the very beginning of each line -
The hit of the
Shift + Backspaceshortcut allow to go on upwards, deleting characters on the previous line(s)
I did get this expected configuration. Then, I decided to get the default behavior again :
-
I was able to suppress the
Backspaceshortcut for theSCI_DELETEBACKNOTLINEmessage -
However, I got things a bit mixed up and it was impossible to, both, reallocate the shortcuts,
BackspaceandShift + Backspace, simultaneously, to theSCI_DELETEBACKmessage
I said to myself : no problem. Let’s delete the shortcut.xml file, close N++ and a new clean
shortcuts.xmlfile will be created !I was really surprised to discover that NO new
shortcuts.xmlfile has been created !Then, I restarted N++ and decided to create a first shortcut, related to the
View > Summary...commandAfter closing N++ and viewing the
shortcuts.xmlfile, it contained this only shortcut :<NotepadPlus> <InternalCommands> <Shortcut id="44049" Ctrl="yes" Alt="no" Shift="no" Key="186" /> </InternalCommands> <Macros /> <UserDefinedCommands /> <PluginCommands /> <ScintillaKeys /> </NotepadPlus>
After reflexion, I thought that I should NOT have deleted the
shortcuts.xmlfile but simply deleted this line :<ScintKey ScintID="2326" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="8" />And relaunched N++. This automatically would reallocate the two shortcuts,
BackspaceandShift + Backspace, to theSCI_DELETEBACKmessage !
So, just one question :
- Is is normal that a default
shortcuts.xmlfile is NOT created if absent in current folder ( for a portable version ) ?
Of course, I knows that :
-
The
Stylers.xmlfile is created from theStylers.model.xmlfile, if absent when starting N++ -
The
langs.xmlfile is created from thelangs.model.xmlfile, if absent when starting N++ -
The
Session.xmlfile is simply created from scratch, if absent when starting N++
Best Regards,
guy038
-
-
@guy038 said in The 'shortcuts.xml' file is NOT re-created if you delete it, on purpose or by mistake !:
Is is normal that a default shortcuts.xml file is NOT created if absent in current folder ( for a portable version )
I can confirm the behavior. I tried with v8.8.1, then back to v8.0, so I think this is expected/designed behavior (I didn’t try farther back than that).
The “installed” or “cloud” behavior will be different:
- If you run N++ when the settings directory (AppData or cloud-folder) has no shortcuts.xml, but there is a shortcuts.xml next to notepad++.exe, then it will copy the installation’s version to the settings directory
- If you run N++ when neither the settings directory nor the exe directory have shortcuts.xml, it has nothing to copy
So N++ is treating the copy of shortcuts.xml in the exe directory similarly to the “*.model.xml” files in the exe directory. Since the portable doesn’t have a shortcuts.xml in the “exe” directory, it has nothing to copy from, so does not create an empty one. (Similar will happen if a portable or cloud or installed doesn’t have langs.model.xml – if you delete the settings-dir copy of langs.xml, it has no .model. to copy from, and complains at you [but then runs, just with no keyword lists or file extensions defined])
-
It sort of makes sense…
shortcuts.xmlis really just a bunch of overrides… so it isn’t really necessary to be there.For keycombos, all of the defaults are still there, even without a
shortcuts.xmlfile.so I think this is expected/designed behavior
Or probably, “just never considered” behavior. :-)
-
@PeterJones said in The 'shortcuts.xml' file is NOT re-created if you delete it, on purpose or by mistake !:
Since the portable doesn’t have a shortcuts.xml in the “exe” directory
Perhaps I’m misunderstanding your meaning but, if the “exe” directory is the one containing notepad++.exe, the portable version does have shortcuts.xml there.
-
@guy038, related to your original intent of altering the behavior of the backspace key,
<ScintKey ScintID="2344" menuCmdID="0" Ctrl="no" Alt="no" Shift="no" Key="8" /> <ScintKey ScintID="2326" menuCmdID="0" Ctrl="no" Alt="no" Shift="yes" Key="8" />those lines will do the trick, but they have to be added directly in the shortcuts.xml file. It appears it’s impossible to change it through the interface
-
@deleelee said in The 'shortcuts.xml' file is NOT re-created if you delete it, on purpose or by mistake !:
Perhaps I’m misunderstanding your meaning but, if the “exe” directory is the one containing notepad++.exe, the portable version does have shortcuts.xml there.
You ignored the context of the discussion: the specific question @guy038 asked was,
Is is normal that a default shortcuts.xml file is NOT created if absent in current folder ( for a portable version )
Or, phrases a different way: “if you delete the shortcuts.xml and start Notepad++, why doesn’t it re-create it with default shortcuts”
So, definitionally, if you’ve deleted the shortcuts.xml from the portable directory, there is no shortcuts.xml from which NPP can read the defaults, since NPP doesn’t have a .model for shortcuts.xml and it has no where else to look. (I was contrasting that to the normal installation, where if you delete the App data shortcuts.xml, NPP can recreate it using the shortcuts.xml in the exe directory)