mirror of
https://github.com/joaotavora/yasnippet.git
synced 2026-02-04 06:32:24 +00:00
51
faq.html
51
faq.html
@@ -7,7 +7,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
|
||||
<meta name="title" content="Frequently Asked Questions"/>
|
||||
<meta name="generator" content="Org-mode"/>
|
||||
<meta name="generated" content="2013-11-28T23:36-0500"/>
|
||||
<meta name="generated" content="2013-12-02T19:38+0000"/>
|
||||
<meta name="author" content=""/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="keywords" content=""/>
|
||||
@@ -131,8 +131,9 @@ for the JavaScript code in this tag.
|
||||
<li><a href="#sec-1">Why is there an extra newline?</a></li>
|
||||
<li><a href="#sec-2">Why doesn't TAB expand a snippet?</a></li>
|
||||
<li><a href="#sec-3">Why doesn't TAB navigation work with flyspell</a></li>
|
||||
<li><a href="#sec-4">How do I turn off the minor mode where in some buffers</a></li>
|
||||
<li><a href="#sec-5">How do I define an abbrev key containing characters not supported by</a></li>
|
||||
<li><a href="#sec-4">How to I use alternative keys, i.e. not TAB?</a></li>
|
||||
<li><a href="#sec-5">How do I turn off the minor mode where in some buffers?</a></li>
|
||||
<li><a href="#sec-6">How do I define an abbrev key containing characters not supported by</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -272,7 +273,7 @@ active:
|
||||
<p>
|
||||
This is apparently related to overlay priorities. For some reason, the
|
||||
<code>keymap</code> property of flyspell's overlays always takes priority over the
|
||||
same property in yasnippet's overlays, even if one sets the latter's
|
||||
same property in YASnippet's overlays, even if one sets the latter's
|
||||
<code>priority</code> property to something big. If you know emacs-lisp and can
|
||||
solve this problem, drop a line in the
|
||||
<a href="http://groups.google.com/group/smart-snippet">discussion group</a>.
|
||||
@@ -282,10 +283,40 @@ solve this problem, drop a line in the
|
||||
</div>
|
||||
|
||||
<div id="outline-container-4" class="outline-2">
|
||||
<h2 id="sec-4">How do I turn off the minor mode where in some buffers</h2>
|
||||
<h2 id="sec-4">How to I use alternative keys, i.e. not TAB?</h2>
|
||||
<div class="outline-text-2" id="text-4">
|
||||
|
||||
|
||||
<p>
|
||||
Edit the keymaps <a href="snippet-reference.html#yas-minor-mode-map"><code>yas-minor-mode-map</code></a> and
|
||||
<a href="snippet-reference.html#yas-keymap"><code>yas-keymap</code></a> as you would any other keymap:
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<pre class="example">(define-key yas-minor-mode-map (kbd "<tab>") nil)
|
||||
(define-key yas-minor-mode-map (kbd "TAB") nil)
|
||||
(define-key yas-minor-mode-map (kbd "<the new key>") 'yas-expand)
|
||||
|
||||
;;keys for navigation
|
||||
(define-key yas-keymap [(tab)] nil)
|
||||
(define-key yas-keymap (kbd "TAB") nil)
|
||||
(define-key yas-keymap [(shift tab)] nil)
|
||||
(define-key yas-keymap [backtab] nil)
|
||||
(define-key yas-keymap (kbd "<new-next-field-key>") 'yas-next-field-or-maybe-expand)
|
||||
(define-key yas-keymap (kbd "<new-prev-field-key>") 'yas-prev)
|
||||
</pre>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-5" class="outline-2">
|
||||
<h2 id="sec-5">How do I turn off the minor mode where in some buffers?</h2>
|
||||
<div class="outline-text-2" id="text-5">
|
||||
|
||||
|
||||
<p>
|
||||
The best way, since version 0.6.1c, is to set the default value of the
|
||||
variable <a href="snippet-reference.html#yas-dont-activate"><code>yas-dont-activate</code></a> to a lambda function like so:
|
||||
@@ -309,9 +340,9 @@ but only once you have setup your yas-root-directory.
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-5" class="outline-2">
|
||||
<h2 id="sec-5">How do I define an abbrev key containing characters not supported by</h2>
|
||||
<div class="outline-text-2" id="text-5">
|
||||
<div id="outline-container-6" class="outline-2">
|
||||
<h2 id="sec-6">How do I define an abbrev key containing characters not supported by</h2>
|
||||
<div class="outline-text-2" id="text-6">
|
||||
|
||||
<p>the filesystem?
|
||||
</p>
|
||||
@@ -332,7 +363,7 @@ filename as a trigger key in this case.
|
||||
<p>
|
||||
You should rather use the <code># key:</code> directive to specify the key of the
|
||||
defined snippet explicitly and name your snippet with an arbitrary valid
|
||||
filename, <code>lt.yasnippet</code> for example, using <code><</code> for the <code># key:</code>
|
||||
filename, <code>lt.YASnippet</code> for example, using <code><</code> for the <code># key:</code>
|
||||
directive:
|
||||
</p>
|
||||
|
||||
@@ -349,7 +380,7 @@ directive:
|
||||
</div>
|
||||
|
||||
<div id="postamble">
|
||||
<hr><p class='creator'>Generated by <a href="http://orgmode.org">Org</a> version 7.9.3f with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24 on 2013-11-28T23:36-0500 from eda83304afc7894f0b5ddc15b04b041be52b94fb
|
||||
<hr><p class='creator'>Generated by <a href="http://orgmode.org">Org</a> version 7.9.3f with <a href="http://www.gnu.org/software/emacs/">Emacs</a> version 24 on 2013-12-02T19:38+0000 from 582e3680b66a62f304034376516207c006f77fe4
|
||||
</p>
|
||||
<p class='xhtml-validation'><a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a></p>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user