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.

Filter by
Sorted by
Tagged with
1
vote
1answer
84 views

How can I get “this->” by inputting “this.”?

I want to input this. and get this-> in c++-mode. I tried abbrev-mode and yasnippet, but failed. In abbrev-mode, I defined an abbrev this to get this using . as a trigger key, but soon as I typed ...
2
votes
0answers
94 views

specify global-abbrev-table in a separate file

I know one can define where abbrev files are saved with something like this (setq abbrev-file-name "/home/zeltak/.emacs.d/abbrv/personal_abbrv.txt") but this file has several section like (define-...
3
votes
1answer
66 views

Prevent abbrev expansion on capitalization

Is there a way to get abbrev expansion on a lower case abbrev but not on its upper case version? E.g.: I have "r" expanding to "are". I'd like "R" to stay "R". I don't necessarily want to get rid of ...
1
vote
1answer
87 views

Change key for f90-start-abbrev

Emacs defines ` to be used for abbrevs in f90 mode. How do I change this so some other key, like e.g. # ? I think, I found the relevant lines in f90.el: (defvar f90-mode-map (let ((map (make-sparse-...
1
vote
0answers
153 views

Triggering abbreviation expansion or auto completion automatically from a regular expression match?

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 ...
1
vote
2answers
372 views

abbrev-mode - Expansion with trailing / does not work

I want to have w/ expand to with globally. Defining the abbrev in the usual way works (e.g. typingwith C-x ag w/), and the entry in the abbrev_defs file looks fine - output of M-x list-abbrevs under (...
15
votes
1answer
5k views

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 ...
2
votes
2answers
1k views

File name autocomplete with dropdown

I like vim's tabcomplete feature - filename completion for its dropdown choices. Like this vi popdown, I use hippie-expand with functions, try-complete-file-name-partially try-complete-file-name. It ...
3
votes
2answers
456 views

How to use abbrev for words with dollar-sign ($) as prefix?

My setup GNU Emacs GUI (version 24.4.51.1 (x86_64-w64-mingw32) compiled from Harroogan Emacs.) Situation I would like to type a word in PHP-mode, and it will automatically ...
3
votes
1answer
85 views

how to keep my abbrevs table files separate?

I'd like to maintain several distinct abbrevs files for different types of abbreviation expansions. I have this: (read-abbrev-file "~/Dropbox/elisp/main-abbrevs-file.abbrev_defs") (read-abbrev-file ...
3
votes
1answer
381 views

do not insert space after abbreviation if there's a space already there

I would like expand-abbrev to operate differently depending on what is just after the abbreviation to be expanded. In particular, if there is a space after the cursor, then expand-abbrev should not ...
4
votes
1answer
882 views

abbrev vs yasnippet for this use case

I have not done much with abbrev-mode or yasnippet, but I recently started using AucTex mode with great success, and I think some common TeX markup I'm inputting could benefit from expansion. Example:...
0
votes
1answer
64 views

Toggle abbrev-mode using keyboard

I would like to be able to toggle abbrev-mode on and off with ease. Of course I could use M-x abbrev-mode But I would like to set this to some keyboard shortcut. To this end I've added the following ...
5
votes
1answer
89 views

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) ...
4
votes
1answer
129 views

Abbrev expansion after quotation mark

I've looked for a solution to this a number of times. Suppose 'kg' normally expands to 'knowledge' in my abbrev file. I wonder if there is any way to get emacs to expand after a single or double ...
7
votes
1answer
140 views

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 ...
3
votes
1answer
141 views

rotate between abbrev expansions?

Q: is there a way to rotate between multiple expansions bound to the same abbrev? I'm experimenting with abbrev-mode, and I have some abbreviations that I'd like to use for different expansions of ...
6
votes
1answer
41 views

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-...
5
votes
3answers
103 views

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 ...
1
vote
1answer
86 views

Adding abbrevs in ess-mode

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 ...
5
votes
1answer
126 views

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 ...
10
votes
3answers
2k views

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. ...
2
votes
1answer
117 views

Highlight abbrev upon expansion

I don't really like the feeling of not being in control when using emacs' abbreviations feature. On the one hand, I don't want to be asked all the time but on the other hand I'd like to know when an ...
4
votes
4answers
447 views

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 ...

1
2