Consider the following bash command line, where ^ denotes the cursor location:
svn commit -m very/long/path/to/some/file "[bug 123456] Fix the pixel issue"
^
I'd like to commit a different file with the same message. How can I delete the current word, from cursor location to the next space? Is there also a shortcut for backward deletion, form the cursor to the first space backwards?
Update: ctrl+w erases backwards, but which shortcut erases one word forward?
Ctrl u
is an option for erasing from cursor location to beginning...alt + d
, that might be useful, when emacs editing mode is set.set -o emacs
enables it, but it is usually the default; if not, you can put that line in.bashrc
or.bash_aliases
, then source the file or reload the terminal. However, then the shortcuts you may be used to in vi mode won't be available, although ones such as ctrl+c will because they are not Bash shortcuts.