In this entry I describe how to make Ctrl+C and Ctrl+V do Copy and Paste in gnome-terminals. Here is how to do it:
Open a gnome-terminal window and type the following commands:
Add the following to .bashrc
> stty intr ^K # free Ctrl+C for copy
> stty lnext ^- # free Ctrl+V for paste
> stty -g
> stty -g > ~/.stty # store the settings in home directory
case $- inNow using the gconf-editor, edit the gnome-terminal's key bindings (@ /apps/gnome-terminal/keybindings key).
*i*)
stty `cat ~/.stty` # reload the stored stty settings
bind -u quoted-insert # unbind the quoted-insert function of bash - free Ctrl+V for paste
esac
Close and reopen the terminal window. And now Ctrl+C will copy and Ctrl+V will paste.
2 comments:
Out of curiosity, what do we need to do to revert the changes. I mean, reinstate the original/default actions for Ctrl+C and Ctrl+V. Can you put across the settings changes for these, 'coz I would really love to try to modify the actions, but would like to be aware of the changes to revert to default too. Amateur in Unix, sorry if its a very basic question!
Basically
1. removing the file named ~/.stty
2. removing the :
case $- in
*i*)
stty `cat ~/.stty` # reload the stored stty settings
bind -u quoted-insert # unbind the quoted-insert function of bash - free Ctrl+V for paste
esac
block from .bashrc
3. resoting the gnome-terminal keybindings to original value will revert the changes.
Post a Comment