2

How do I bind a key combination (alt-backspace) to delete the current line of text? For example, bind "<alt>Left" { "move-cursor" (display-line-ends, -1, 0) }; in gtk-keys.css moves the cursor to the beginning of the line (this works for me). (Using gtk 2/3 would be preferable, but other methods would be ok) I want to delete the current line of text left of the cursor, NOT the paragraph to the left of the cursor.

bind "<alt>BackSpace" { "delete-from-cursor" (display-lines, -1) };

doesn't work. Pressing alt-Backspace does nothing, nor does display-line-ends.

bind "<alt>BackSpace" { "delete-from-cursor" (paragraph-ends, -1) };

deletes the paragraph to the left of the cursor.

I was thinking that I could select the text I want to delete ("move-cursor" (display-line-ends, -1, 1)) and delete it, but I can't figure out how to do the latter.

If anyone can direct me to resources listing gtk keybindings, I would be much obliged.

Thanks in advance

2

After a bit more research, I found that the line

bind "<alt>BackSpace" { "move-cursor" (display-line-ends, -1, 1) "delete-from-cursor" (chars, -1) };

works as I want it to.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.