I can't seem to get abbrevs working in ess-mode when editing .R files.

I have ess-mode hook to activate abbrev-mode, but I get no expansion for my global abbrevs.

When I do add-mode-abbrev I can add an abbrev, but it is not written to my abbrev file and of course doesn't get ever expanded (after read-abbrev-file or restart).

If I by hand add something like this into my abbrev file and reload:

(define-abbrev-table 'ess-mode-abbrev-table
    ("-=" "<-" nil 0)

it doesn't work either.

How can I make ess-mode aware of my abbrevs?

  • ESS provides an electric underscore, meaning if you type "_", it inserts "<-". That might be easier than typing "-=" anyways.
    – Tyler
    Sep 22 '16 at 20:10

I'm working on abbrev as well and it seems only word-constituent characters can be part of an abbrev. Thus I don't think you can use "-=" as an abbrev. Have you tried using other characters?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.