Questions tagged [abbrev]

is for the abbreviation feature of Emacs where a string of characters are expanded to a longer string. Mainly used to reduce typing, `abbrev` are recorded in a table that is shared locally, among buffers of the same major mode, or even globally. Some Emacs features, such as mail, implement their own `abbrev` functionality. Use additional tags when appropriate.

Useful Links

92 questions
16
votes
1 answer

How add company-dabbrev to the Company completion popup?

Setup: GUI version GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-07-25 on KAEL Compiled from EmacsW64. , using the latest version of from MELPA Windows 7 x64 bit. Situation: For example, I'm typing in the buffer foobarsentence. And then start a…
ReneFroger
  • 3,855
  • 22
  • 63
11
votes
3 answers

Is it possible to auto-correct spelling “on space”?

I was about to post the question but then I saw it on Stack Overflow while searching for auto-correct possibilities. The linked question has no answers, so I thought it'd have more luck on this site. Here's the text: I wish there were a way so that…
Tymric
  • 762
  • 1
  • 6
  • 15
7
votes
1 answer

abbrev table inherit properties from other tables?

Q: how can I get abbrev tables to inherit properties? Motivation: I'd like to mix and match abbrevs such that some expand automatically when typing, while others expand only when I explicitly tell them to via expand-abbrev. (See a previous question…
Dan
  • 32,584
  • 6
  • 98
  • 168
7
votes
2 answers

How to use abbrevs

I find using abbrevs in Emacs confusing. Despite reading the manual and the EmacsWiki, I continue to have problems using them. Goal: Define a quick, throw-away abbrev for a single Emacs session. Example: When using Python and Numpy, outputs are…
Lorem Ipsum
  • 4,327
  • 2
  • 14
  • 35
6
votes
1 answer

In undo history, how to separate abbrev expansion from self-insert?

Very occasionally, hit SPC during regular typing and get an unexpected abbrev expansion. What I usually do in this case is undo (which reverts the expansion and the inserted space) and then manually C-q SPC to add the space again. It would be really…
Malabarba
  • 22,878
  • 6
  • 78
  • 163
6
votes
1 answer

Is it possible to have conditional abbrev expansion?

I have defined some abbreviations for org-mode, but I want them to conditionally expand. For example, n2 expands to N_{2}, and I want to prevent that from happening in src-blocks. The bottom of this page:…
John Kitchin
  • 11,555
  • 1
  • 19
  • 41
5
votes
3 answers

mixing automatic abbrev expansions with explicit-only expansions?

Q: can I mix abbrev expansions such that some expand automatically, and some only with an explicit call? When abbrev-mode is enabled, an abbrev expands whenever typing a self-inserting whitespace or punctuation character. However, expand-abbrev…
Dan
  • 32,584
  • 6
  • 98
  • 168
5
votes
2 answers

How to expand abbrevs without hitting another extra key?

How can I expand oe to ö immediately after hitting the e without hitting any extra key like space for expansion? Why? For better ergonomics I've remapped some keys like ö, ü and thus must write them with oe and ue.
5
votes
1 answer

Using a common set of abbreviation for multiple major modes

I use multiple programming languages, and there are a considerable number of abbreviations that I use across all of their corresponding major mode (they are usually name of certain variables, but not limited to this category). One way of customizing…
5
votes
1 answer

Context sensitive skeleton triggered by abbrev stuck in loop

I want to create a skeleton, triggered by the abbrev keyword 'func' which checks its context and runs one of two possible sub-skeletons. Here's what I have: (define-skeleton my-func-skeleton "func skeleton" "" (if (looking-back "\n") ;; A…
BigBird
  • 53
  • 3
5
votes
2 answers

How to inherit one abbrev table in another abbrev table?

I've defined a lot of abbrevs in latex-mode-abbrev-table and I'd like to use all the contents in latex-mode-abbrev-table and org-mode-abbrev-table when in org-mode. A possible "solution" would be to write all the abbrevs in global-abbrev-table but…
Saddle Point
  • 481
  • 7
  • 23
5
votes
1 answer

Do not expand abbreviation if preceded by "."

Let's say abbrev expands "com" into "commission". The problem is that this expands "google.com" into "google.commission". Is there a way to disable this expansion if "com" is preceded by a "."?
scaramouche
  • 1,772
  • 10
  • 24
5
votes
1 answer

Do not expand a given abbrev when followed by ":"

Let's say I use abbrev to expand eq into equation. Now I want eq to always expand, except when followed by a colon (:). The logic is that in LaTeX I do not want equation identifiers (e.g., eq:xyz) to be expanded. Any ideas about how to selectively…
scaramouche
  • 1,772
  • 10
  • 24
4
votes
1 answer

How to share `abbrev_defs` across multiple systems

I keep my abbrev_defs file in a git repository so I can share my abbreviations across systems. Unfortunately, the count feature of abbrev-mode leads to little changes in the :count property of defined abbreviations in this file that makes merging a…
Michael Hoffman
  • 665
  • 6
  • 14
4
votes
4 answers

Prevent abbrev-mode from expanding on underscore

Abbrev-mode seems to think an underscore signals a new word, which is not the case in many programming languages. I want it to expand after spaces, newlines, and tabs; not after underscores. Is there a way to tell abbrev-mode not to expand when I…
Avdi
  • 737
  • 1
  • 7
  • 8
1
2 3 4 5 6 7