I am trying to define keymapping about
%>% for ess R mode.
Code 1 is my
init.el based on How to implement the piping operator %>% in ESS mode?. After evaluation of the code, I get the keybinding Code 2. I don't know why such a situation happen and
RET does not work well. How do I fix it?
(defun then_R_operator () (interactive) (just-one-space 1) (insert "%>%")) (define-key ess-mode-map (kbd "C-%") 'then_R_operator) (define-key inferior-ess-mode-map (kbd "C-%") 'then_R_operator)
key binding --- ------- RET then_R_operator C-% then_R_operator
I also try a different method as follows. But, I got the same result.
(define-key ess-mode-map (kbd "C-M") "%>%") (define-key inferior-ess-mode-map (kbd "C-M") "%>%")