Feature Request: Support for Snippet Variables (e.g., TM_FILENAME, TM_FILENAME_BASE) #42248
erikbachman
started this conversation in
Ideas From VSCode
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the snippet parser in Zed does not support variables. It would be very useful if we could use variables in snippets, such as TM_FILENAME, TM_FILENAME_BASE, CURRENT_YEAR, etc., just like in VSCode.
Expected Behavior:
The snippet parser should recognize and replace variables such as:
$TM_FILENAME- current file name$TM_FILENAME_BASE- current file name without extension$TM_CURRENT_LINE- current line content$TM_SELECTED_TEXT- currently selected text$CURRENT_YEAR,$CURRENT_MONTH,$CURRENT_DATE- time-related variables$CLIPBOARD- clipboard contentUse Case Examples:
Benefits:
This would make snippets much more powerful and context-aware, significantly improving developer productivity when working with file-specific or time-sensitive templates.
Beta Was this translation helpful? Give feedback.
All reactions