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?
1 Answer
Add something like this below snippet name:
# condition: (not (bound-and-true-p shell-script-mode))
-
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).– stsquadJan 30, 2015 at 13:25
-
Are those even updated? I've been using a fork of the original snippets for two years now.– abo-aboJan 30, 2015 at 13:31
-
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-aboJan 30, 2015 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. Jan 30, 2015 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– stsquadFeb 2, 2015 at 18:22