简体   繁体   中英

VSCode Shortcut based on filename

Is it possible to create a shortcut that pastes something based on the filename?

For example, I have a file called featured-brands.js , now I want to create a shortcut that inserts featured-brands in my code when I'm working inside of this file.

I'm using a snippet now:

"Filename Namespace": {
    "prefix": "namespace",
    "body": [
        "${TM_FILENAME_BASE}"
    ],
    "description": "Namespace for file"
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM