Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

1
vote
1answer
20 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
15 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
27 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
18 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
84 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-...
0
votes
0answers
20 views

How to achieve this for a major-mode in Emacs

Sorry, not a searchable title. Wanna achieve a something slightly resembling abbrev-mode, like this: Type my(my+SPACE,SPACE was swallowed by stackexchange), then you type SPACE again, it'll expand to ...
4
votes
2answers
62 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
60 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
69 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
1answer
158 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
381 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
170 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
68 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
49 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
49 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
28 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
71 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
138 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
55 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
42 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
35 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
90 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
61 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
33 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 ...
4
votes
1answer
68 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
52 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
58 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
45 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
70 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
96 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
254 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 ...
1
vote
2answers
770 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
306 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
62 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
241 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
627 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
50 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 ...
4
votes
1answer
62 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
114 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
107 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
94 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
32 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-...
4
votes
3answers
78 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
66 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
74 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 ...
9
votes
3answers
1k 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
103 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
292 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 ...