Emacs mode/function that wraps operators with spaces

随声附和 提交于 2019-12-21 05:25:09

问题


I remember that there was a mode for Emacs, or was it an option, can't recall, that prettified the code by placing space after operators like ,, ., wrapped = with spaces, and some other cools stuff that I can't remember.

I reckon that this is pretty much language-specific issue, but I usually put space after commas, and wrap = with spaces. Any ideas about this mode?


回答1:


You're probably thinking of smart-operator.el.




回答2:


How about smartchr.el? This is probably not what you are trying to recall, but I'm sure it works nicely for that purpose.

For example:

(require 'smartchr)
(global-set-key (kbd "=") (smartchr '(" = " " == " "=")))

With this configuration, when you type = several times,  =  is inserted and it rotates to  ==  to = then back to  = .

Here is an introduction by the author (written in Japanese, but with a demo video and example of configuration): http://tech.kayac.com/archive/emacs-tips-smartchr.html



来源:https://stackoverflow.com/questions/7803317/emacs-mode-function-that-wraps-operators-with-spaces

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!