开发者

How to bind hungry delete for Clojure in Emacs

开发者 https://www.devze.com 2023-02-11 18:30 出处:网络
I just started experimenting with Clojure and it is bugging me that I can\'t use c-hungry-delete-backwards because clojure-mode is not based on cc-mode. In other words, I want to make C-c C-backspace开

I just started experimenting with Clojure and it is bugging me that I can't use c-hungry-delete-backwards because clojure-mode is not based on cc-mode. In other words, I want to make C-c C-backspace开发者_如何学Python delete all whitespace to the left of the cursor until it hits non-whitespace.

How can I make hungry delete or the equivalent work with Clojure + emacs? I'm not using swank or slime right now.


In my .emacs file at home I use:

(load "cc-mode")
(global-set-key (kbd "C-<delete>") 'c-hungry-delete-forward)
(global-set-key (kbd "C-<backspace>") 'c-hungry-delete-backwards)

Which gives me hungry delete everywhere.

On the other hand at work I have installed the hungry-delete package from package.el which provides hungry-delete as a minor mode which you can add to your clojure mode hook.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号