There actually is a 3rd party gedit plugin (compatible with gedit version >= 3.14) that adds a keyboard shortcut to duplicate the current line or selection. Here is how to enable it:
Copy the contents of the extracted or cloned (depending on how you downloaded) folder (duplicateline.plugin and duplicateline.py) to ~/.local/share/gedit/plugins. If the folder does not exist, create it using your file manager or by running:
mkdir -p ~/.local/share/gedit/plugins
Then open gedit → click the hamburger menu (the icon with the three lines on the top right) → Preferences → Plugins and check Duplicate Line.
You can now use the Ctrl+Shift+D shortcut to duplicate the current line or selection.
To uninstall the plugin follow step 3 and uncheck Duplicate Line and also delete the files duplicateline.plugin and duplicateline.py from ~/.local/share/gedit/plugins.
There actually is a 3rd party gedit plugin (compatible with gedit version >= 3.14) that adds a keyboard shortcut to duplicate the current line or selection. Here is how to enable it:
Download and extract the zip file containing the plugin from this GitHub repository: https://github.com/hannenz/duplicate
Alternatively you can use
git
(install it runningsudo apt install git
) to download it in your~
folder using:Copy the contents of the extracted or cloned (depending on how you downloaded) folder (
duplicateline.plugin
andduplicateline.py
) to~/.local/share/gedit/plugins
. If the folder does not exist, create it using your file manager or by running:Then open gedit → click the hamburger menu (the icon with the three lines on the top right) → Preferences → Plugins and check Duplicate Line.
You can now use the Ctrl+Shift+D shortcut to duplicate the current line or selection.
To uninstall the plugin follow step 3 and uncheck Duplicate Line and also delete the files
duplicateline.plugin
andduplicateline.py
from~/.local/share/gedit/plugins
.As far as what I searched, there is no official keyboard shortcut for duplicating a current line in gedit.
Refer this link for more information: https://help.gnome.org/users/gedit/stable/gedit-shortcut-keys.html.en