Questions tagged [yasnippet]

YASnippet is a template system for Emacs. It allows you to type an abbreviation and automatically expand it into function templates. Bundled language templates includes: C, C++, C#, Perl, Python, Ruby, SQL, LaTeX, HTML, CSS and more.

Filter by
Sorted by
Tagged with
3
votes
2answers
257 views

Org-mode: Disable `t` + `TAB` => `# TODO: ` autocomplete feature

There is a built-in org-mode shortcut where a t character followed by TAB key results in an auto-complete function that produces the # TODO: string literal. How can I disable this? Even better, how ...
5
votes
1answer
4k views

Yasnippet not working with auto-complete-mode

I am just starting to experiment with Yasnippet, and it worked very well until I tried to combine it with auto-complete-mode. The problem is that Auto-Complete is taking over completely. For example, ...
1
vote
1answer
135 views

Yasnippet minor mode working in lisp-interaction-mode but not in emacs-lisp-mode

I wanted to test yasnippet for editing Emacs Lisp files. After installing it from the package manager, the problem is that it works fine from the *scratch* buffer but not when editing a Lisp file ...
10
votes
2answers
2k views

Is there a yasnippet producing a prepopulated doxygen comment?

For the following C++ function: bool importantStuff(double a, double b); It should output the following snippet, perhaps without the tags: /** * <Insert description of importantStuff> * * @...
4
votes
0answers
184 views

how to expand a yasnippet snippet after punctuation?

Q: how can I get yasnippet snippets to expand when placed immediately after punctuation? Consider the snippet SNIP. It will expand if preceded by whitespace (eg, here's a SNIP expands), but not when ...
22
votes
2answers
7k views

How to make yasnippet and company work nicer?

In my emacs, let's say, I use a "elisp" yasnippet to extend a lisp block in org-mode. But before I extend it, company is triggered first, which gives me a menu like "1. elisp1, 2. elisp2" without an ...
1
vote
0answers
729 views

Company Completion Within Yasnippet Snippet

I am trying to use company-completion within a Yasnippet header. I bound company-complete to C-SPC and use that for my auto-completion. When I hit control enter, I get a screen like this: And I hit ...
4
votes
1answer
368 views

How can I disable an individual snippet when in shell-script-mode?

I'm a fairly extensive user of YAsnippet but there is an annoying niggle when I'm working on shell scripts. The default prog-mode snippets includes "fi" which expands to FIXME. This would be fie but ...
5
votes
1answer
1k views

(setq yas-snippet-dirs …) not working

I am unable to set up yasnippet the way I want to set it up. I only want to use yasnippet for a particular set of modes, so I don't want to use yas-global-mode. I only want to use my own snippets, ...
3
votes
4answers
847 views

Autocomplete environments like in TeXStudio

TeXStudio autocompletes environments. How can I get AUCTeX to do the same? I can begin typing an environment name (say myenvironment) and, after entering a part of it (my, myenv, etc.), I hit ...
2
votes
2answers
513 views

Creating a custom Yasnippet with conditions

I have a yasnippet that is conflicting with multiple-cursors because it is not exiting immediately. When multiple-cursors is not active, I would like the snippet to pause and permit me to enter the ...
3
votes
1answer
299 views

Yasnippet prompt when using commands interactively?

How can I use yasnippet to invoke LaTeX commands interactively? If I use auctex to insert \usepackage it starts a minibuffer which lets me select the desired package (including tab completion). ...
4
votes
1answer
1k views

Is there something I should do about “package assoc is obsolete” message?

Just noticed this message after emacs startup "Package assoc is obsolete!", but everything seems to work nice. The requirement seems to be called by yasnippet only. I just want to know if I should ...
2
votes
0answers
1k views

Stop Yasnippet from autoloading

Is there a way to stop Yasnippet from autoloading? I installed it from melpa (v.20141102.1554), and have no reference to it in my init files. However, keeps up autoloading whenever I run emacs. I only ...
8
votes
1answer
555 views

How can I prevent yasnippet from breaking when I update my packages?

After packages have been updated, the location of the loaded elisp files will change to be in the folder of the new version of the package. Yasnippet attempts to lazily load snippets for the file it ...
4
votes
2answers
395 views

YASnippet: How to resume (or reactivate) snippets after exiting them

After exiting yasnippet snippets that contain one or more tab stops, I often find myself wanting to go back and modify content that I entered at the tab stops. Of course, I can do this using standard ...
6
votes
1answer
698 views

Auto-Complete stops working with C files

I am using Emacs24, and my auto-complete plugin was working when I opened my .emacs file. However, it doesn't work when I open some file like : whatever.c To add to this, the auto-complete-c-...
7
votes
1answer
1k views

yasnippet: how to expand a snippet from a string and have the fields recognized?

Q: how do I get yasnippet to expand a text string correctly (recognizing snippet fields) from inside elisp code? A very simple snippet is a just a string of characters with some control characters ...