Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yasnippet expansion is broken #18

Closed
UndeadKernel opened this issue Nov 8, 2016 · 3 comments
Closed

Yasnippet expansion is broken #18

UndeadKernel opened this issue Nov 8, 2016 · 3 comments

Comments

@UndeadKernel
Copy link
Member

It seems that the yasnippet expansion is not working as intended.

If I understand correctly, snippet expansion only occurs when some text is selected. If I open an elisp file, for example init.el, type in "def", select that word and then press tab; then an unrelated snippet is expanded.

@hlissner
Copy link
Member

hlissner commented Nov 9, 2016

No selection is necessary. You type def, press tab and the snippet expands.

Make sure you have snippets installed. They're not included in this config. I keep mine in a separate repo. Run make snippets in ~/.emacs.d to install them (or just clone them to ~/.emacs.d/private/snippets) -- if you use them, I suggest you fork them; mine are tied closely to my own workflows and will change often.

Assuming you have snippets installed, these are the two main ways to use snippet expansion (| will represent the cursor, as well as the editable points you can cycle through with Tab after expansion):

  • defun| => Tab => (defun fn-name| (|) |)

  • (message "Hi") => select the form => Tab => select defun =>

    (defun fn-name|()
      (message "Hi")|)

This gif illustrates these two workflows:

@UndeadKernel
Copy link
Member Author

UndeadKernel commented Nov 9, 2016

It must've been something messed up with my repository copy.
After loading the master branch from scratch and loading some snippets, it is back to working!
Quick question: which tools are you using for creating the animated gifs?

@hlissner
Copy link
Member

hlissner commented Dec 24, 2016

Oh gosh, I'm so sorry i'm only noticing this message now! I'm actually still on the prowl for a good gif app. For the above, I used Quicktime Player (which has a screen recorder on Mac) and used this script to convert the resulting .mov file into a .gif.

You could use any screen recorder with that script, really. Haven't tried it with other video formats though.

Other alternatives:

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants