Command+K in Eshell (mac)

132 views Asked by At

Often I will have multiple buffers open in Emacs, including a few eshells, and using the muscle-memory from bash, I will Command+K to try and clear the buffer in eshell. However, using this in eshell just screws up all of my buffers and I have to close everything and open everything again.

I would like to re-bind Command+K while in eshell to clear the e-shell buffer. If this is not possible, I would like to simply disable the effect of Command+K while in eshell, so that my muscle memory doesn't cause me to screw up my other buffers. Are either of these tasks possible?

1

There are 1 answers

2
dunkaroo On

You can bind key to local map in your case is "eshell-mode-map"

(define-key eshell-mode-map "\C-k" 'eshell/clear)