What is the shortcut to delete last word in csh?
Asked Answered
csh
B

4

5

In bash, I use Ctrl + w to do so, but it is not working in my csh and instead of deleting a word, it is cleaning entire line. How to delete last word ?

Although Ctrl + u is working fine in both csh and bash.

I'm running csh inside screen (ubuntu).

Burtburta answered 6/12, 2012 at 5:10 Comment(0)
B
7

This works for me with tcsh: ALT + BACKSPACE. Hope that helped!

Bovine answered 6/9, 2013 at 8:38 Comment(0)
X
2

Try this: SHIFT + Alt + b & Delete

you can check this list of keyboard shortcuts.

Ximenes answered 6/12, 2012 at 5:26 Comment(1)
Thanks for the list. From the list, I tried Alt + backspace and it worked.Burtburta
L
2

The action is named "backward-delete-word". If you run the command >bindkey in csh you will get all the keyboard shortcuts that apply to your shell. You can >grep "backward-delete-word" and you will get a result kinda like this:

>> bindkey | grep "backward-delete-word"

"^�"          -> backward-delete-word
"^[^H"         -> backward-delete-word
"^[^?"         -> backward-delete-word

These results should be a combination of the default keybinds as well as custom ones if someone set them up.

I definitely have no idea what the first one means, but I can tell that ^[ means "meta-character", ^H means ctrl+h (not ctrl+H which would be ctrl + shift + h) and ^? means "backspace".

You can enter a meta character key by either pressing esc and letting go, or by pressing alt and keeping it pressed while you press on the other keys in the combination.

So the options that I (and probably you as well) have for delete-backward-word are:

alt+ctrl+h

esc->ctrl+h

alt+backspace

esc->backspace

and one mystery option.

Lothario answered 16/4, 2022 at 23:26 Comment(0)
S
0

To get Ctrl-w to delete words in csh like bash, add the following to ~/.cshrc

bindkey "^w" backward-delete-word

Schistosomiasis answered 9/1 at 9:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.