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 it fires every time I close a if<->fi statement in BASH. How can I disable this one snippet when I'm in shell-script-mode?
Asked
Active
Viewed 449 times
1 Answers
4
Add something like this below snippet name:
# condition: (not (bound-and-true-p shell-script-mode))

abo-abo
- 14,113
- 1
- 30
- 43
-
Unfortunately it's part of the default snippets bundled with YASnippet. As I find the rest of them useful I'd rather not disable all the bundled snipets (although I have my own directories as well). – stsquad Jan 30 '15 at 13:25
-
Are those even updated? I've been using a fork of the original snippets for two years now. – abo-abo Jan 30 '15 at 13:31
-
I guess so, on MELPA my current yasnippet dir is yasnippet-20141223.303 – stsquad Jan 30 '15 at 13:32
-
2Does it really make sense for someone to update the snippets that you're used to? The bunded ones are examples, just fork them and maintain your own. – abo-abo Jan 30 '15 at 13:57
-
1Iirc yasnippet looks in the user snippet directory first, so any snippet it finds there would shadow the ones in the bundle. – T. Verron Jan 30 '15 at 14:12
-
1The condition didn't work me me. In the end I used "# condition: (not (eq major-mode 'sh-mode))" and submitted a pull request – stsquad Feb 02 '15 at 18:22