--- tags: Visual Studio Code Text Editor & Snippet & VScode 程式碼片段 description: 'Visual Studio Code Snippet functionality presentation' title: 'Visual Studio Code Snippet | VScode程式碼片段功能' --- # Visual Studio Code 額外功能筆記 :page_with_curl: Visual Studio Code Snippet | VScode程式碼片段功能. :::info **Latest Updated Date:** May 24, 2022 ::: #### 此筆記供自己閱讀,以自己的方便性為主,因此可讀性並不會太高且會以英文作為主要語言撰寫,以避免自己未來在瀏覽本筆記時,在中文與英文之間切換思考的不便利性。 --- ## Snippet Snippet在Computer Science領域中可譯為程式碼片段。而在Visual Studio Code中,是輸入特定字元定義為Trigger後,在撰寫程式碼時,輸入Trigger後自動產生預先定義好之Snippet的功能。Programmer可設定常用的Snippet,並用特殊字元作為Trigger,節省大量的時間。 補充:同一Trigger可對應到不同的Snippet,在編程中觸發時,可以選擇想要的Snippet填充。 Visual Studio Code支援多種腳本或程式語言的Snippet 例如HTML(註:不屬於程式語言):enter "!" 就可選擇VS code預設的Snippet快速填充撰寫。 reference: 1.[VS Code 中自訂程式碼片段的功能(snippet)](https://pjchender.blogspot.com/2017/04/vs-code-snippet.html ) (Chinese) 2.[VSCode Snippet with Snippet Generator](https://youtu.be/xAV9OyYOTn4) (Chinese Video & 上個網頁的影片教學) 3.[在Visual Studio Code裡加入自訂的Code Snippet](https://www.uuu.com.tw/Public/content/article/20/20200106.htm) (Chinese)
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.