I'm running Ubuntu 10.04 and I find it annoying that by default the copy/paste functionality also pastes the text format. Most of the time when I copy/paste text I only want to paste the ascii text without any formatting. Is there a way to configure that behavior?
In fairly recent Ubuntus you can use Ctrl-Shift-v to paste plain text.
I've found a way to achieve this after some searching online and experimenting with my environment.
You can create a custom shell script which you can then bind to a key shortcut in your desktop environment. I'm using Xfce on Linux Mint (which is based on Ubuntu). Xfce allows me to override Ctrl-C by simply defining that as the shortcut in Settings -> Keyboard -> Application Shortcuts, but I prefer using a different shortcut, Ctrl-Alt-C, so that I'm still able to copy with formatting in the rare cases I need to.
Here's how I did it.
Install xclip:
I don't know about other desktop environments, but Xfce didn't like me using a pipe in the custom keyboard command, so I had to make a script with the xclip-line, which is then bound to my keyboard shortcut (Ctrl-Alt-C).
My personal habit is putting custom commands in
~/.bin
and then adding that directory to the PATH variable.Here's how you do that, if so inclined:
(Note that you will need to re-initialize your session for that change to take effect, meaning you'll have to log out of your desktop environment and back in again. See if it worked by typing
echo $PATH
in a terminal after having logged in again.)I've then created the script
~/.bin/copy-without-formatting
with the following content:Remember to make it executable with the following line:
chmod +x ~/.bin/copy-without-formatting
Then, since I'm using Xfce, I've gone to Settings -> Keyboard -> Application Shortcuts and added a shortcut with the full path to the script, without variables or a tilde. So if my username were
mrgaga
, the string would be/home/mrgaga/.bin/copy-without-formatting
. Then I've configured the shortcut.Xfce activates the changes immediately when I've closed the window so you should be able to check if it works right away, without logging out and in again, at least if your environment is similar enough to mine.
I hope it helps.
I use parcellite . It keeps a history of the clipboard.
I don't know of a way to do it automatically. A workaround of course is to paste it into gedit and copy it from there.
In my Ubuntu 20.04 focal (x86-64) Cinnamon 4.8.6 you can use Shift-Insert to paste text without formatting.