Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Gedit, I installed the line_tools plugin. It uses Ctrl+D to duplicate the the current line. When I pressed Ctrl+D, it did the opposite! It deleted the line instead!

It turns out that Gedit has an unlisted (not in the menu) shortcut-key: Ctrl+D, which deletes a line.

It is quite simple to change any menu item's shortcut-key in Gedit by enabling Editable Menu Accelerators, but I can't change this delete-line action's key, because there is no menu item for it!

How can I override this delete-line action? .. and what other unlisted actions does Gedit have? .. and why is it (they?) unlisted?

PS: The developer of the 'line_tools' provides the plugin with Ctrl+D set to 'Duplicate'.. I assume he tested it; which would suggest that there was no such clash circa 2008-01-30 (the timestamp on the downloaded )

share|improve this question
Have you looked through GConf? – Scott Severance Apr 21 '11 at 13:24

I like the idea to do a binary edit. However the process described above seems too cumbersome.

Here is a much simpler and more reliable way:

sudo sed -i "s/delete_from_cursor/_elete_from_cursor/g" /usr/bin/gedit
share|improve this answer
Thank you so much. I cannot believe that works! Seems sed assumes the ascii conversion to the binary string comparison. I've get confused by reading…. – erm3nda May 26 '15 at 4:20
up vote 2 down vote accepted

I've found a workaround for this particular Ctrl+D shortcut...

It was interesting to see that most on the site where I found it have been a Notepad++ users (me too :), where Ctrl+D was the "delete-line" shortcut...

The "fix" involves a simple mod to the 'gedit' binary... It changes one byte of a name, so that the shortcut reference becomes invalid...
This frees-up the Ctrl+D shortcut, and allows the plugin to function normally, and the new Ctrl+D menu-item is editable.

The only side-effect appears to be that a "Warning" is issued, which you can see if you start 'gedit' from the terminal...
Because this is a "hack" (in the roughest sense of the word), it is possible that there could be other side-effects, eg. maybe something doesn't get cleaned up properly... but I'll be using it...

Here is the 2-minute hack:
(The fix will need to be re-applied when gedit is updated)

# Make a backup of 'gedit' binary
sudo cp /usr/bin/gedit{,.before-ctrl+d-hack} 

# Hexedit the 'gedit' binary ...(I've used 'ghex2`)
gksu ghex2 /usr/bin/gedit

# In 'ghex2' 
#     Find the string: delete_from_cursor
#     Replace it with: #elete_from_cursor
# Save the binary, and exit... 
share|improve this answer
Even if that sound interesting, i don't know why you didn't install with Wine. Anyway, i wanna hack gedit too to get rid of Ctrl+Destroyer shortkey. Thank you. – erm3nda May 26 '15 at 4:00
(The fix will need to be re-applied when gedit is updated) . Seems what you really like is the sed command from @Stephen Boesch – erm3nda May 26 '15 at 4:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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