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
0
votes
0answers
7 views

Keyword :parents not working when defining abbreviations

Following the docstring of define-abbrev-table, I have these settings (define-abbrev-table 'text-mode-abbrev-table '(("fw" "for which"))) (define-abbrev-table 'latex-mode-abbrev-table '(("1d2" "...
1
vote
1answer
42 views

abbrevs not expanding

I have wrote the following abbrev definition file, and saved it as my_abbrev.el: (define-abbrev-table 'global-abbrev-table '( ("else__" "else begin end") )) ;; turn on abbrev mode globally (...
1
vote
1answer
34 views

Abbrevs with interstitial capital letters

Whenever I type YouTrack, abbrev erroneously corrects it to Youtrack. I noticed that in my abbrevs file it has ("youtrack" "youtrack" nil :count 7). Why is that there, and how can I get abbrev to ...
5
votes
2answers
189 views

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

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

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. ...
0
votes
0answers
11 views

Abbrev counter didn't work

I am using abbrev for long time. But the counter didn't work, So I try to fix it today, but I am stuck. Previously this is my config file: (use-package abbrev :ensure nil :defer 3 :delight " ☈" ...
0
votes
1answer
48 views

evil-mode unwanted abbrev expand (setq evil-want-abbrev-expand-on-insert-exit nil)

Upon escaping evil-insert-state, if the cursor is next to a letter/phrase in my abbrev list, it expands despite having (setq evil-want-abbrev-expand-on-insert-exit nil) called before evil-mode. ...
1
vote
1answer
25 views

Define abbrev for `helm-mini`

I am trying to define an abbreviation for helm-mini, I would like d to expand to *dired. When I try my usual way of *dired C-x a i l, I get an error saying Command attempted to use minibuffer while in ...
0
votes
1answer
23 views

Hooking on to abbreviation expansion

I don't know exactly how abbrev-mode works, but I suppose certain keys --spaces and stops-- cause an examination of the word before point, and a replacement of it in some cases. My question is how ...
0
votes
1answer
55 views

use a single abbrev-table for multiple modes?

I would like for all my text-based modes (org, markdown, message, mu4e-compose, etc) to use a single abbrev-table, and especially, to add new abbrevs to that shared table whenever I'm in one of those ...
0
votes
1answer
38 views

Automatically `expand-abbrev` with `org-meta-return` and `org-insert-heading-respect-content`

I take notes with org-mode and abbrev-mode. Normally pressing SPC or RET leads to any abbreviations at point expanding before the edit is made. This doesn't happen when I use C-RET (org-insert-...
0
votes
1answer
323 views

Best pratice advices for abbrev vs. completion vs. snippets

I am not sure if this is really a proper question but I am interested in having some opinions about the most efficient usage of Emacs' abbreviations features (abbrev/dabbrev) in combination with auto-...
4
votes
2answers
76 views

Use abbrev to expand “-->”

I want to type "--> " and have it automatically converted into "→ ". Is there a way to do this using Abbrev?
0
votes
1answer
93 views

How to define abbrev boundaries and where to put them?

I'm new to Emacs and Common Lisp. I'm wanting to use abbrev-mode to replace standard Common Lisp function names with aliases that I have created. So for example, I would like to replace the following ...
0
votes
2answers
100 views

Quick/electric text expansion

I've seen in some Emacs videos, the author would type #+BEGIN_SRC in their buffer, and emacs auto inserts #+END_SRC. Is this a feature I can "turn on" in vanilla Emacs? If not, which package can I ...
2
votes
2answers
270 views

Disable “Autocompletion”/“Abbreviation” in Verilog-Mode

When I use the Verilog Mode in spacemacs with evil keybindings, every time I type e.g. wire and press ESC, an automatic dialouge pops up and asks me msb:, lsb: and name (RET to end). This is super ...
2
votes
1answer
589 views

How to disable `abbrev-mode`?

I am using Spacemacs and it always ask me to save .cache/abbrev_defs which is very annoying. I tried to put (abbrev-mode -1) in dotspacemacs/user-config function. But it still ask for save the ...
1
vote
1answer
236 views

Alternative to abbrev-mode that supports special characters in abbreviations?

I already use abbrev-mode to correct common typos, e.g. I have an abbrev setup for expanding functino to function, etc... I'm currently writing a large document, and I keep stumbling over the ...
2
votes
1answer
104 views

How do I set the directory-abbrev-alist values?

I'd like to customize this value - it's briefly mentioned in the manual. How can this be done?
0
votes
1answer
80 views

How to make abbrev expand on symbol, not on word?

I have something like (define-abbrev-table 'c++-mode-abbrev-table '(("string" "std::string" nil 0))) in my .abbrev_defs. However, when I input to_string, the string still gets expanded into std::...
0
votes
1answer
69 views

How to make all abbrev table case sensitive?

I know that I can use (abbrev-table-put c++-mode-abbrev-table :case-fixed t) to make one abbrev table to be case sensitive. But how can I make this default for all abbrev-tables ?
0
votes
0answers
43 views

How to use abbrev with different configuration for each mode?

How can abbrev-mode be enabled per mode (so enable for org-mode and python-mode for example, but not other modes).And each mode use its own set of abbreviations?
6
votes
1answer
80 views

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 ...
1
vote
3answers
189 views

Regexp only matching one character when using abbreviations

I'm trying to expand abbreviations with some additional characters, so I'm using the regexp option on an abbrev-table to try and add these characters. The expression I used was found on this tutorial ...
1
vote
1answer
60 views

Abbreviation expansion without spaces

I would like to set up things so that when I type Iuulius, the sequence uu is seamlessly replaced by ū (and a few more such pairs), as soon as I type the second u. I.e. the keystrokes and buffer text ...
0
votes
0answers
47 views

Can you use a regexp in an abbrev definition?

I want to replace words like 1st with 1^{st} and 102nd with 102^{nd} while typing in emacs. Basically I want to replace things that match this: "\([0-9]+\)\(st\|nd\|rd\|th\)" with this \1^{\2} as I ...
1
vote
1answer
63 views

Emacs' default `expand-abbrev` does not work

I try to use emacs -Q and then input RET RET dd in *scratch* buffer and then M-x add-mode-abbrev, then after the prompting message Mode abbrev for "dd":, I input abcdefg RET. So I defined an mode ...
5
votes
2answers
120 views

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 ...
1
vote
0answers
73 views

How to cycle between language specific abbrev tables in a buffer?

I have (human-)language-specific abbrev-tables named like lang-francais-mode-abbrev-table, lang-castellano8-mode-abbrev-table backed by my ~/.emacs.d/abbrev_defs file. The language names are the ...
0
votes
1answer
42 views

emacs ABBRV command break for new line

i want to add an abbrv for 2 lines (that is a 1st line, a break and then a 2nd line) Anyone know the syntax for that? here is the syntax i try ("8rt" "#+ATTR_HTML: :style color:green *lets try it ...
5
votes
1answer
102 views

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 "."?
1
vote
1answer
70 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 ...
3
votes
0answers
76 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
52 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
79 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
124 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
278 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 (...
12
votes
1answer
3k 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
998 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
337 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
68 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
275 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
718 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
53 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
75 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
119 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 ...
6
votes
1answer
121 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
108 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
37 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-...