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.

107 questions
0
votes
1 answer

yasnippet does not load automatically when .html file is loaded

yasnipped has been installed on emacs using elpa/melpa package system. I can confirm it's in ~/.emacs.d/elpa/yasnippet-20160104.129 When I load an .html file there's no yasnippet menu, as expected, please advise. I did not add anything extra to…
Wasteland
  • 4,889
  • 14
  • 45
  • 91
0
votes
1 answer

How stop yasnippet field in emacs 24

I use elpy and yasnippet to make emacs become a python editor. Then I use yasnipprt to build a class object, but I find I can't exit field as quickly as sublime text can, within double "return". That means I have to move cursor at the begin of line…
ccQpein
  • 705
  • 7
  • 20
0
votes
1 answer

symbol's value as variable is void: php-executable

I'm getting the following warning printed on the minibuffer when I try to use php-auto-yasnippets by pressing C-c C-y into Emacs symbol's value as variable is void: php-executable I'm using Ubuntu 14.04 with php5-cli. I did use setq in my emacs…
0
votes
1 answer

How to unset yasnippet's tab key?

How to unset yasnippet's tab key default behaviour or even redefine it? I am having issues getting yasnippet and auto-complete to play well together and, in particular, find the Tab key behaviour to be problematic at times as auto-complete tends to…
migdsb
  • 677
  • 1
  • 8
  • 19
0
votes
1 answer

emacs yasnippets for rails

I'm using emacs 24.3.1 for rails development and currently I end up with enh-ruby-mode when in my rails model files. I would like to use yasnippets for rails commands eg: typing 'bt' + tab expands to belongs_to. Should my rails templates be put…
map7
  • 5,096
  • 6
  • 65
  • 128
0
votes
1 answer

Where to put the customized functions for snippet?

I try to create a snippet which needs a little elisp code (about 15 lines). I don't want to put all the code there to make the snippet looks very ugly. A function call is the best choice. But I am not sure where should I put the code for that…
Enze Chi
  • 1,733
  • 17
  • 28
0
votes
2 answers

How to add values of two yasnippet fields

I'm trying to write a snippet whose inputs (tab-stop fields) are two numbers, and which returns their sum. But I don't know how to reference the values of both fields at the same time, and it seems like I can't reference the values of the tab-stop…
MTS
  • 268
  • 2
  • 6
0
votes
1 answer

Prevent HAML snippets loading when using sass-mode and yasnippet

I'm using Emacs with sass-mode and yasnippet to edit .sass files. This is all working great and the snippets are expanding. But since sass-mode requires haml-mode the haml snippets are also loaded when editing sass files. This is rather annoying…
aaron.cimolini
  • 123
  • 1
  • 6
0
votes
1 answer

YASnippet fails when typing letter "t" in the replacement zone

Having created the following YASnippet (to automate title creation in Org mode): # key: org # name: org # -- #+TITLE: ${1:`(capitalize (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`} #+Time-stamp: <2013-10-08 Tue…
fniessen
  • 4,408
  • 19
  • 18
0
votes
1 answer

yas-choose-value files in dir

I'm trying to do a snipped with default values being files in a directory, but fail. Seems calling elisp-code in yas-choose-value need special treatment? I know you can hardcode it. something like ${1:file-name$(yas-choose-value '("foo"…
0
votes
1 answer

Emacs: how to get rid of the unwanted tab in perl-mode yasnippet

I have the following yasnippet in perl-mode to create a sub: #name : sub ... { ... } #key: sub # -- sub ${1:function_name} # {{{ { $0 } # }}} But when Emacs expands it, it generates an unwanted tab: sub function_name # {{{ <-- ? { } #…
user4035
  • 22,508
  • 11
  • 59
  • 94
0
votes
1 answer

Indent under the previous line

This is my snippent: foo ($1) $0 Where I activate it with indent and touch 'argbar' I want like this: foo (x) bar But I got this: foo (x) bar My yas-indent-line is fixed. Emacs 24.2.1 Yasnippet 0.8.0 (20130218)
Astas Raigh
  • 31
  • 1
  • 4
0
votes
2 answers

emacs autoload modes

I am a newbie. Now I want to auto start yasnippet auto-complete gtags flymake modes when I opening a (php/java/el/...) file. What Should I put in my emacs config file ?
jilen
  • 5,633
  • 3
  • 35
  • 84
0
votes
1 answer

yasnippet and backslashes

I have installed yasnippet 0.8 from elpa on emacs 24 and I want to write a snippet that inserts this text into a LaTeX document (using AUCTeX): \\ \vspace{10pt} So I have this snippet: # -*- mode: snippet -*- # name: para # key: para # binding:…
jaybee
  • 1,897
  • 2
  • 16
  • 29
0
votes
1 answer

ido in Yasnippet save new snippet

I want to save a new snippet. Emacs24 asks me for the filename, but ido does not work in the minibuffer. Is that a known bug, or a bug in my configuration. How to reproduce: $ emacs /tmp/test.tex Menu: YSSnippet/New Snippet I create a small…
Jonas Stein
  • 6,826
  • 7
  • 40
  • 72