When in terminal I can use Ctrl+w to delete a whole word or IP (.
is separator for each octet) when going leftward of prompt. However, if I try Alt+d to go rightward of prompt, terminal recognizes "." in IP for a separator and deletes only one chunk, until the .
out of the whole IP.
How can I adjust that so terminal recognizes only blank spaces for separator of word or even better to have another shortcut for different separators: .
, =
, ,
, etc?
It is very similar with maneuvering in terminal with Ctrl+Arrows (left and right) and behavior is similar based on what is set for word separator.
I read that Emacs editor sits behind what terminal uses to have those shortcuts but I could not get to twink it.
I'm trying to accomplish this in Ubuntu 10.
Here:https://askubuntu.com/questions/577433/deleting-input-forward-to-the-next-space is what I was suggested in the other forum for Ubuntu 14.
I tried this:
"So, now, if you want to combine those two keystrokes (Alt+w followed by Ctrl+w) in a new one, you will need to bind a new keystroke (in my example Alt+q) to execute the previous keystrokes as follow:
bind '"\eq": "\ew \C-w"'
Finally, to make these changes permanently, all you have to do is to add the following lines to your ~/.inputrc
file (if you don't have it, then create it):
"\ew": vi-forward-bigword
"\eq": "\ew \C-w"
but I get this as result:
When added that, Alt+w still does not work, and Ctrl + ← and → error does not work any more. Terminal outputs ;5D
and ;5C
when those are used to move from word to word...
What is the difference between the two versions?
readline
library that is used bybash
to handle user input, history and so on. Read this: http://unix.stackexchange.com/questions/78990/what-are-the-readline-word-separators – orion Feb 04 '15 at 10:42Ctrl-X Ctrl-E
to bring your current command line into editor where you can use all its power to modify the line. In case of vim, deleting till the end of WORD, that is tlll the the first space on the right can be done withdW
. Modified line will be executed in your shell right after you close the editor. – Tagwint Feb 04 '15 at 10:43bind
command in your.bashrc
and it will be set every time you open an interactive shell. That should help in case.inputrc
has some problems. – orion Feb 04 '15 at 10:46