3

TL;DR

How to configure global environment shortcuts in KDE Plasma 5 on GNU/Linux for Ctrl+Backspace and Ctrl+Del to delete only whitespaces and new lines in all GUI applications which do not override this shortcut?

Examples

Example #1:

def function(self,                argument):

Place the cursor after the , and press Ctrl+Del. Expected behavior: only spaces are deleted. Actual behavior: spaces and argument are deleted.

Example #2:

if True
:
    pass

Place the cursor before the : and press Ctrl+Backspace. Expected behavior: only new line is deleted. Actual behavior: new line and True are deleted.

The problem

Default shortcuts are unusable (for me). I know only two applications which have an expected behavior: KDevelop and NetBeans. It seems to me that they override a global shortcut while other applications do not.

I would like to have the same behavior in all my applications: Chromium, Thunderbird, each of the LibreOffice applications, Atom, Eclipse, Kate, any application where a input text. I don't want to spend hours trying to configure each of them. Some of them don't even have such configuration options. Is there a way to configure a global system-wide shortcuts for this?

  • 1
    keyboard shortcuts and editing capabilities vary between text editor implementations. Plasma is not an editor AKAIK. Are you talking of the kate text editor? – Stéphane Chazelas Nov 9 '16 at 9:30
  • @StéphaneChazelas I know only two applications which have an expected behavior: KDevelop and NetBeans. It seems to me that they override a global shortcut. I would like to have the same behavior in all my applications: Chromium, Thunderbird, each of the LibreOffice applications, Atom, Eclipse, any application where a input text. I don't want to spend hours trying to configure each of them. Is there any global shortcuts for this? – Kolyunya Nov 9 '16 at 9:37
  • 1
    No, there's not. Each application does as they please. You wouldn't want vi behave like emacs for instance. They have completely different approaches at editing text. For instance in vi, to delete a word, it's dw or dW depending on the definition of "word" (or cw/cW to change a word) while it's Alt+D in emacs. Never heard of Ctrl+DEL before. – Stéphane Chazelas Nov 9 '16 at 9:46
  • @StéphaneChazelas I'm not asking about deleting words. Instead I'm asking about specific shortcuts: Ctrl+Delete and Ctrl+Backspace which are present on my system and which behavior I would like to change. Also I'm obviously not asking about console applications. – Kolyunya Nov 9 '16 at 10:29
  • There are no global "specific shortcuts". Each application interprets keys in whatever way they like. If these shortcuts are "present on your system", you should say in what application(s) they are present, and then look up how to configure shortcuts for these application(s). – dirkt Nov 9 '16 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.