Is it possible to create "snippets"? #422
-
I'm new to Clink, so apologies if this is a basic question. I'm wondering if Clink has support for something similar to Visual Studio Code's user-defined snippets. As a basic example, I'd like to be able to write: C:\>home then e.g. hit Tab and have my prompt automatically substitute this with: C:\>cd %USERPROFILE% |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Tab is typically for completion. What you're looking for is more like "replacement" not "completion". For example, completion lets you start to type the first few characters of something, press Tab, and get help completing what you started typing. E.g. Also, the specific example A better fit in a command shell would be to create an alias. Then you don't even have to manually expand it. Create an alias with With the alias defined, then you can use Or you can type And you can also use it with completion: There are many alternatives as well, but that's the most common way to do what you asked about in a command shell. |
Beta Was this translation helpful? Give feedback.
Tab is typically for completion. What you're looking for is more like "replacement" not "completion". For example, completion lets you start to type the first few characters of something, press Tab, and get help completing what you started typing. E.g.
cd %userp
Tab would complete tocd %USERPROFILE%
.Also, the specific example
home
Tab ->cd %USERPROFILE%
probably isn't a good example for "replacement snippets". Because if you want to change to your user profile directory, you could just type~
Enter.A better fit in a command shell would be to create an alias. Then you don't even have to manually expand it.
Create an alias with
doskey home=cd %userprofile%
. If you want to expand to literally