zed icon indicating copy to clipboard operation
zed copied to clipboard

Custom snippets

Open xyzqm opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the feature

VSCode has a feature that allows you to write your own snippets: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets

It would be nice if Zed supported something similar. A major improvement from VSCode would be better support for multiline snippets. Currently, they have to be written in array form, like so: https://stackoverflow.com/questions/41856706/whats-the-best-way-to-write-multi-line-code-snippets-in-vs-code

However, I think it would be nice to allow loading snippets from individual files (maybe under a .zed/snippets directory?), especially if it's a longer snippet (my personal use is a template for competitive programming that includes several necessary headers, macros, and globals).

If applicable, add mockups / screenshots to help present your vision of the feature

No response

xyzqm avatar Apr 12 '24 21:04 xyzqm

I rely heavily on this feature, and it would be great if there were

Kalmaegi avatar Apr 13 '24 08:04 Kalmaegi

Snippets or Live Templates (in JetBrains IDEs) are extremely powerful, quite an essential feature!

OSuwaidi avatar Apr 13 '24 16:04 OSuwaidi

duplicate https://github.com/zed-industries/zed/issues/4611

0x2CA avatar Apr 15 '24 03:04 0x2CA

I see this is closed but you don't say if snippets will be something you will add in the future or not something you will ever add?

Are snippets something that could be added as an extension?

Thanks

AllTheUserNamesAreGone avatar Jun 14 '24 14:06 AllTheUserNamesAreGone

I see this is closed but you don't say if snippets will be something you will add in the future or not something you will ever add?

This issue has been closed as a duplicate of the issue linked above, which is still relevant. Be sure to follow that thread for more information on the feature.

Moshyfawn avatar Jun 14 '24 15:06 Moshyfawn

I missed the duplicate, thanks.

AllTheUserNamesAreGone avatar Jun 25 '24 21:06 AllTheUserNamesAreGone