There is no Delete current line shortcut?
-
@earth-invader
Ctrl+L does Line cut
Ctrl+Shift+L does Line delete -
@neil-schipper I can’t believe there is really a hidden shortcut. It would be great if I could change the shortcut so that I could make it consistent with my other code editors. For now I have to use Autohotkey to remap the shortcut because the setting seems to be missing from the shortcut mapper.
Thanks
-
@earth-invader said in There is no Delete current line shortcut?:
I can’t believe there is really a hidden shortcut
How is it hidden??
It’s right in the Shortcut Mapper (get there via the Settings menu): -
@alan-kilborn Oh I don’t know what Scintilla means so I didn’t look at that tab. I through the shortcut is hidden because there is no entry under Main Menu > Edit > Line Operation. I guess regular people would try to find such shortcut there and if its not there, they probably think there is no such function implemented.
Thanks again.
-
@earth-invader said in There is no Delete current line shortcut?:
Oh I don’t know what Scintilla means
Scintilla is the editing component Notepad++ embeds.
It is a separate project maintained by others.
Some commands really don’t benefit from being on the menus, as no one would really play with the menus to run the commands. -
Although @alan-kilborn is technically correct that those actions & shortcuts are not hidden, the larger truth is that they are so hard to find, they may as well be hidden:
- not shown on any menu
- not mentioned in the npp manual
- in the Scintilla doc the action names (constants used by coders) are found in a list; no shortcuts given, actions not described
So @earth-invader is surely correct in suggesting the natural place for them is Main Menu > Edit > Line Operation where they’d be seen, learned and enjoyed daily by the line-deleting (and line-cutting) masses.
For a bunch of years of my using npp,
Ctrl+L
wasn’t in my repertoire, and how should I have known that it was available? Either by a motivated search thru Shortcut Mapper, or luck. I only learned aboutCtrl+Shift+L
when I was doing my response above (I wanted to check the “official” name of theCtrl+L
action). (And I’m happy to know about it because it happens often enough that after aCtrl+L
action I realize I unintentionally disturbed the clipboard.) (And it feels wonky that the 2-key combo is mapped to the more complex action, and the 3-key to simpler.)Other useful actions with shortcuts that are effectively hidden are: Line copy (
Ctrl+Shift+X
), and the lovely paragraph navigate & select actions (shortcuts w/square brackets), and (maybe a bit less useful) the word-oriented counterparts (shortcuts w/slashes).It’s a shame a user has to try discovering these by perusing a list of 99 rows of arcane and often only vaguely descriptive names. It doesn’t help that the list only appears in a modal dialog, so you have to dismiss it before you can play around with a shortcut that in the moment looks interesting, and… when you’re done fooling with that s/c, and you want to resume browsing for another, you need to do a bunch of clicks and careful scrolling to restore the view.
And it gets better.
The Shortcut Mapper lacks common features we expect with tables, like the ability to sort by specific column, and, ability to select between (a- & de-)scending. The filter feature is nice, but it’s hobbled on the Scintilla tab: in all the other tabs (i.e. Main menu, Macros, Run, Plugin) the Filter applies to the Shortcut column (in addition to the Name column) so you can helpfully filter with “ctrl+”, etc (would be even more helpful with ability to have filter apply only to Shortcut column). But, on the Scintilla tab the filter only applies to Name column.
So, for reasons on top of reasons, the user manual and UI conspire to disincentivize user learning of handy shortcuts.
The manual would be greatly improved by including this:
A good way learn about many useful shortcuts (not documented in this manual) is to launch a new instance of npp, and in one instance, bring up the Scintilla tab of Shortcuts Mapper, and, in the other instance, try out shortcuts to see what they do.
By the way I see some folk have made cheat sheets, and some are quite attractive and well laid out. But all the ones I checked:
http://www.cheat-sheets.org/saved-copy/Notepad++_Cheat_Sheet.pdf
https://cheatography.com/math-academy/cheat-sheets/notepad/
https://www.makeuseof.com/notepad-plus-keyboard-shortcuts/
were (incomplete &| out of date &| wrong).Has there ever been an official cheat sheet project? or a cheat sheet within the main project? A shortcuts.txt file would be pretty close to 100% correct, around 100% of the time (so many astute eyeballs). It could be provided with each install.
-
Do you know what I did, when i was tired of going to the old and out-of-date, locked, wiki-based documentation? I gained enough reputation in the group as a good helper, and slowly worked on Don until he agreed to replace the old site with the modern git-based documentation. And now that it’s in GitHub, anyone can create an issue, and even provide a Pull Request with the suggested changes, which can then be reviewed by the central team (mostly myself, but others occasionally review as well). And that provides the benefit that anyone can make suggestions, but it takes review to get it incorporated, so that one person or one small group doesn’t have to come up with all the things that need to be documented, but a central group is able to prevent grafitti/spam (which is what closed down the original wiki docs). So instead of complaining about documentation, average users like yourself can suggest improvements in a manner that has as chance of being incorporated… instead of just being able to complain here in the forum because there was years of no changes to the documentation.
not mentioned in the npp manual
The reason why we don’t individually docment the 99 or so Scintilla operations is because the Scintilla Project fully documents exactly what every one of those does at https://www.scintilla.org/ScintillaDoc.html. If you don’t think there is enough linkage in the documentation, the maybe creating an issue and/or PR would be useful. For example, if you had an issue and accompanying PR which suggested the wording in your example paragraph above, I would probably rephrase it some, add links to the Scintilla documentation, and probably approve it. And if that happened in the next couple days, it might even be in time to be included in the next update of the user manual website, which I will probably be telling Don that it’s ready for publishing soon, because it looks like v8.3.3 is pretty stable and might trigger auto-update soon.
in the Scintilla doc the action names (constants used by coders) are found in a list; no shortcuts given, actions not described
Of course no shortcuts are given in the Scintilla docs: the shortcuts are defined in Notepad++. And the Shortcut Mapper does a good job of showing what the current shortcuts are.
And, in my opinion, the Scintilla documents do describe what many of them do. For example, the SCI_CUT and related are clearly described as being clipboard-related actions:
However, you are right, your
Ctrl+L
SCI_LINECUT doesn’t have a good description in the scintilla docs Keyboard Commands section. Maybe you could suggest improvements to that section to Scintilla documentation team.The filter feature is nice, but it’s hobbled on the Scintilla tab
You might search the existing issues in the codebase, because I thought that lesser ability had been brought up before, or suggested improvements. And if it doesn’t exist, create your own issue; because complaining here won’t be tracked as an issue for improvement in the UI. I was pleased when Don provided the filter, because that made it infinitely better than it was for the years of the Shortcut Mapper without any filter.
the user manual and UI conspire to disincentivize user learning of handy shortcuts.
The user manual is in no way attempting to disincentivize users. I am doing my best with limited resources. But as I am basically the only regular contributor, and most users are too lazy to even look at the user manual, let alone read the user manual and submit an issue when they find a lack, let alone create a PR to go with the issue. And that chain of inaction means I don’t even know of the holes that others can see in the documentation, so there’s only so much I can randomly guess to improve to make others happy.
Has there ever been an official cheat sheet project? or a cheat sheet within the main project?
No. And with half-a-thousand entries necessary for the cheat sheet, it would be as hard to navigate as the current shortcut-finding tools that already exist, but would be another point of maintenance.
A shortcuts.txt file would be pretty close to 100% correct, around 100% of the time (so many astute eyeballs). It could be provided with each install.
There have been multiple conversations in this forum about extracting the existing shortcuts from Notepad++ using a scripting plugin (and if you weren’t involved in them, you at least have the skills necessary to search for them). But since people knowingly or unknowingly change shortcuts (a lot of people inherit
shortcuts.xml
from IT departments), the “default” shortcuts are rarely useful… and a lot of people would complain the documentation is out of date, only to find out that in actuality, they had changed their shortcut half a decade ago to match some other editor, and then forgot about the customization they made. So we’d still get as many complaints about the problems in the documentation, even when it was 100% right. Whereas running such a script as has been published here will always tell you exactly what shortcuts are defined on your specific customization, which is the only useful list of shortcuts. -
@peterjones said in There is no Delete current line shortcut?:
There have been multiple conversations in this forum about extracting the existing shortcuts from Notepad++ using a scripting plugin
Here’s one: https://community.notepad-plus-plus.org/topic/12576/list-of-all-assigned-keyboard-shortcuts
-
I said,
I don’t even know of the holes that others can see in the documentation
Since I now know of this hole, I created issue #335. If you would like to participate in the solution, feel free to comment there.
-
In general I don’t have strong feelings, I’m just glad that there is a means to configure Scintilla shortcuts (because some of the default N++ setups for them clash with what I’ve historically used for other functions).
Aside: For me, line-delete has always been – and always will be – Ctrl+y. Why? Probably because the old DOS-based Turbo C IDE used that (could be remembering the source wrong, though). So the bottom line is that I’m just ecstatic that I can set N++ up this way, even if I have to go to some “arcane” tab in the UI to do it.
HOWEVER… I think the Shortcut Mapper tab may be the only user exposure to the term “Scintilla”. And I find this awkward; it seems like Scintilla should be hidden from the user, given that it has no other exposure.
-
I said,
If you would like to participate in the solution, feel free to comment there.
Since no one gave me any input, I used my own phrasing, which will end up in the next release of npp-user-manual.org
@Alan-Kilborn said,
it seems like Scintilla should be hidden from the user
If you or anyone else ever makes an issue and convinces Don to change the UI so it doesn’t mention Scintilla there (maybe
Editing commands
instead ofScintilla commands
) I will take a similar action to change the User Manual’s mentions of Scintilla as well. -
Although shortcut keys, may be important to you, and I understand, as I used them with early editors also, but the moment we were using mouse and menus, except for Cntrl-c or Cntrl-v, I’ve completely given up using keyboard shortcuts, period. I even used to buy the 116-key keyboards to record shortcuts of only a few important keyboard keymaps/macros, but since the advent of right clicking and context senstive choices, I’ve found little use to remember convoluted keyboard shortcuts.
I even remember buying those commercial keyboard shortcut templates that fit over the keyboards to use common keyboard shortcuts…but those days are long gone for me and I suspect most users, however, as it is a mostly arcane use these days, someone really needing it is going to find it or ask about it, so I don’t think it’s hidden as much as it is “not emphasized”. But as Peter points out, it’s almost impossible to get people who use free software to read the free documentation. It’s easier for them to waste someone else’s time coming up with an answer they won’t research on their own. It’s just the times and generation we live in now, apparently. ::shrug::