How to change smart assign key (“_” to “<-”) binding in ESS

*爱你&永不变心* 提交于 2019-12-04 20:15:46

Here's the docstring for ess-smart-S-assign-key:

Documentation:
Key used by `ess-smart-S-assign'. By default bound to
underscore, but can be set to any key. If this key is customized,
you must add

 (ess-toggle-S-assign nil)
 (ess-toggle-S-assign nil)

after the line that sets the customization and evaluate these
lines or reboot emacs. The first call clears the default
`ess-smart-S-assign' assignment and the second line re-assigns
it to the customized setting. 

So: put this in your .emacs file to get the desired behavior:

(setq ess-smart-S-assign-key ":")
(ess-toggle-S-assign nil)
(ess-toggle-S-assign nil)

Kind of ugly, but it works.

The accepted answer didn't work for me, but the following did:

(global-set-key (kbd "C-;")  (lambda () (interactive) (insert " <- ")))
(ess-toggle-underscore nil)

Insert your shortkey choice instead of C-;.

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