Is there a way to combine two operations into one keybinding (dont think would work with function).
This is what I\'d like to do:
I\'d like a keybinding (say
This might work for you:
"\ex": menu-complete
"\ez": "ls \ex"
Include these lines in your ~/.inputrc file.
These lines set Alt-x to menu-complete and Alt-z to ls space menu-complete. This will give you the first file in the directory and use Alt-x to cycle through the remainder one at a time.
See here for more examples of macros.
Checkout the readline commands by invoking bind -p or bind -P and bind -s will show the macros you already have. See here for the bind command also you can make one off macros too, see here. Lastly check that the .inputrc file is being read, I had trouble because the environmental variable was set to /etc/Inputrc and my personal version was never being invoked.
BTW steer clear of Control-x as it is already in use for many readline commands.