If you look at the output of the following command:
bind -l
or better to:
bind -l | grep arg
you can see that doesn't exist any readline function for all arguments like is, for example, yank-last-arg
for last argument - which can insert last argument to the previous command (the last word of the previous history entry). So, if such a function doesn't exists, most probably doesn't exist a shortcut to accomplish what you wish.
Let's try to crate one approached to your request...
First, look for example at the output of the following command:
bind -p | grep yank-nth-arg
The output is:
"\e\C-y": yank-nth-arg
and can be translated as follow: yank-nth-arg
(which insert the first argument to the previous command - with an argument n, insert the nth argument from the previous command) is bound to Alt+Ctrl+y.
In the same way can be interpreted any line from the output of bind -p
command.
Now play attention at the following scenarios:
If you set the following binding:
bind '"\ea": "\e2\e."'
Alt+A will be mapped to Alt+2Alt+. which is mapped to insert the second argument of the previous command. So, after when you press Alt+A, the second argument of the previous command is inserted in the current command.
If you set:
bind '"\ea": "\e1\e. \e2\e."'
After when you press Alt+A, the first two arguments of the previous command is inserted in the current command. If the number of the arguments from the previous command is maximum 2, of course all of the previous command is inserted in the current command.
If you set:
bind '"\ea": "\e1\e. \e2\e. \e3\e."'
After when you press Alt+A, the first three arguments of the previous command is inserted in the current command. If the number of the arguments from the previous command is maximum 3 (as in your case), of course all of the previous command is inserted in the current command.
And so on.
For first 10 arguments, you can use:
bind '"\ea": "\e1\e. \e2\e. \e3\e. \e4\e. \e5\e. \e6\e. \e7\e. \e8\e. \e9\e. \e1\e0\e."'
And I think that this is long enough as far as I don't use too often commands with so many arguments.
To make it persistent, add the following line line to your ~/.inputrc
file:
"\ea": "\e1\e. \e2\e. \e3\e. \e4\e. \e5\e. \e6\e. \e7\e. \e8\e. \e9\e. \e1\e0\e."
In this example I chose Alt+A to insert all arguments (if the number of arguments is not greater than 10) of the previous command, but you can chose any other combination you with by replacing in the previous command the \ea
string.
Resources:
I'm very sorry to say but you want Ubuntu to be Windows, which is not going to happen tomorrow... :-(
Ubuntu is based on Linux, and although it has "windows" than can be dragged around a "desktop" and that it adheres to the CUA like Windows, it's just not the same thing! Asking for something and ruling out all possible answers is just going to leave you with an answer like this:
Sorry to be the harbinger of bad news, but what you're asking for is impossible...
Best Answer
If you look at the file
/usr/share/X11/xkb/symbols/latin
, you will find the following lines:So apparently an up arrow (↑) is already defined -- for ALT GR+SHIFT+U. If not, you can copy the file to a directory, edit it at will, name the profile somehow (say "foo" instead of "latin") and simply run
(the
-I.
makes setxkbmap look for layout files also in the current directory).The four strings assign to each key give the four characters that are produced by pressing the key, key with shift, key with altgr and key with algr+shift. The names of the entities (keysyms) that xkb can recognize can be found here.