How to bind Emacs key for delete whole word backword as the same in a shell?

I have just started learning Linux and Emacs. It was pleasant to have the same key bindings in both Emacs and a shell (bash/tcsh) for the most frequently used cursor movements, so that I do not have to consciously think which one I have to use. Still worse, use the wrong command and undo the mistake. There were two exceptions, though.

One often used command was the equivalent of backspace, delete a character backwards. In a shell, it was C-h. I got the same behaviour in Emacs, thanks to this tip from Janos, who probably felt the same way. http://www.math.rutgers.edu/~komlos/emacs.htm

Now the mistake I do often in Emacs is trying to delete words backwards with the command M-C-h, as in a shell.

Can somebody please give a binding that will make Emacs delete words backwards with 'M-C-h'? Currently, this command selects the whole of the text in a buffer, which is quite an useful thing (C-a in windows), but not so frequently used as deleting words backwards.

Moreover, any binding to replace the current binding of M-h (from the link above) to help will be appreciated.

Thank you,

Elan.

Answers


Below binds C-M h to backward-kill-word. You can put it in your .emacs file.

(global-set-key (kbd "C-M-h") 'backward-kill-word)

You can use M-<backspace> in terminal and emacs to delete word backward.


Need Your Help

oracle find where a date falls into a list

oracle date triggers compare

so I am creating an oracle database for my university coursework on an airline. Now i have a table called staff_allocations which allocate staff for flights in the Flight table.

MySQL Query to check a DateTime column

mysql ruby-on-rails ruby ruby-on-rails-3

I have a rails 3 application that is using a mysql db. Part of the functionality is that I am trying to query a table in my DB for all records where:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.