21
votes
4answers
4k views

What is the best code template facility for Emacs?

Particularly, what is the best snippets package out there? Features: easy to define new snippets (plain text, custom input with defaults) simple navigation between predefined positions in the ...
5
votes
3answers
423 views

Emacs: Enter commands like in gedit

in gedit it's possible to define so-called "snippets" for simpler input. For example, there is a snippet while. This means: If you type while -> (-> stands for tab key). And gedit automatically ...
5
votes
2answers
827 views

box-style comments with yasnippet

I'm looking to write a yasnippet template that would allow me to add a license header to a script buffer in Emacs. Kinda like this, but a bit improved: The header needs to include per-user data, ...
3
votes
2answers
101 views

Rebind keys in Emacs to change commenting style in source code

I am trying to document certain sections of my code using Doxygen. I want to use the javadoc style of comments viz /** * My Documentation goes here */ Now in Emacs I can comment out a ...
3
votes
1answer
204 views

yasnippets with % ending the line after $0 acts strange when used with AUCTeX

Yasnippet snippets that has a percent sign, %, ending a line with the last point of the snippet, $0, before the percent sign acts strange in that the cursor gets placed after the percent sign and not ...
3
votes
1answer
178 views

Problem writing a snippet containing Emacs Lisp code

I've been trying to make use of a cool feature of YASnippet: write snippets containing embedded Emacs Lisp code. There is a snippet for rst-mode that surrounds the entered text with "=" that is as ...
2
votes
2answers
155 views

Replace character before expanding yasnippet

Is it possible to replace a character before a yasnippet is expanded? Say that I have the following snippet: # -*- mode: snippet -*- # name: foo # key: foo # -- ~bar$0 I write foo and press Tab to ...
2
votes
1answer
1k views

Can't make Yasnippets work in Emacs, help!

I can't make Yasnippets work (normal version). When I start Emacs it says: error: Error ~/.emacs.d/plugins/yasnippet-0.6.1c/snippets/ not a directory I added this to my .emacs file: (add-to-list ...
2
votes
1answer
346 views

How can I expand a snippet within a snippet using YASnippet?

At the YASnippet site I noticed the following description of yas/triggers-in-field : If non-nil, yas/next-field-key can trigger stacked expansions, that is a snippet expansion inside another ...
2
votes
1answer
596 views

How to use Emacs auto-complete/snippets?

I've been using the emacs-live and it is amazing! I just can't figure out how to use the autocomplete/snippets, the suggestions pop up, you can cycle through the options, but how do you select an ...
2
votes
1answer
190 views

Emacs yet another snippet extension php-mode

I'm new to using emacs, and I am currently having some trouble with the 'yet another snippet' extension. I am trying to do some work using the php-mode major mode. Unfortunately, it is based on the ...
1
vote
1answer
1k views

Emacs Yasnippet install

trying to install yasnippet for emacs 23 from: https://github.com/capitaomorte/yasnippet Firstly I attempted the quick istall but the yasnippet-bundle.el for the 'quick' install doesn't seem to be ...
1
vote
1answer
425 views

Can't install yasnippet?

I tried to install yasnippet using the "normal install" protocol given here. After placing the yasnippet-0.6.1c folder in ~/.emacs.d/plugins/, I tried to eval the following in my .emacs: ...
1
vote
1answer
492 views

Emacs yasnippet - insert snippet on keystroke

Is there a way to easily insert snippet when certain keybinding is activated? AFAICT, official documentation suggests setting: #binding: directive, smth like this: #name : <p>...</p> ...
1
vote
1answer
355 views

yasnippets always puts new snippets in c-mode instead of php-mode — how do I change this?

The yasnippets module for emacs allows the dynamic expansion of words as snippets much like abbrev mode, but more powerful, and is similar to the snippet system used in TextMate on OS X. I'm hoping ...

1 2
15 30 50 per page