问题
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