Emacs kill ring & X11 clipboard, let’s be friends!
Today is another day of keyboard shortcuts. This time, let’s get some better interaction going between the X11 clipboard and the Emacs kill ring. This way, when you want to copy and paste text between Emacs and other applications, you won’t have to enable menu-bar-mode to use the function.
As this stackoverflow question explains, there are a few ways to skin this particular cat. One of the answers has a link to an EmacsWiki article that provides even more detail.
Putting the following key bindings into your .emacs should do the trick quite nicely.
(global-set-key "\C-w" 'clipboard-kill-region)
(global-set-key "\M-w" 'clipboard-kill-ring-save)
(global-set-key "\C-y" 'clipboard-yank)
Enjoy!