With abbrev mode, I can define abbreviations that trigger when I type a certain term. For example, typing "yn" would be expanded to "Your Name". For this, "yn" must have been defined as an abbreviation before hand.

What I'm looking for is a setup in which rather than specifying the abbreviation terms explicitly, I can specify a regular expression that when matched gets expanded by the defined instructions.

A simple example would be that everytime I type a website as


it gets expanded to


I'm specifically looking for a solution that works like abbrev in that I don't have to invoke a command after typing my abbreviation to have it converted.

  • 1
    Setabbrev-expand-function to a function that does what you want, in terms of matching a given regexp?
    – Drew
    Commented Jan 9, 2016 at 18:04


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.