如何讓 UltiSnips 支援自訂的檔案副檔名 (How to use UltiSnips on file with custom extension)
- 取得連結
- X
- 以電子郵件傳送
- 其他應用程式
如何讓 UltiSnips 支援自訂的檔案副檔名
以新增 file.customExtension 作為例子 在你的 vimrc 中加入這行
autocmd BufRead,BufNewFile *.customExtension setfiletype customExtension
接著就可以在你的 snippets 資料夾加入customExtension.snippets
這樣就大功告成了
原理
Unitsnips 是用 vim 的 filetype 來作為尋找 snippets 的依據,上面那一行設定是讓 vim 去認識,所有用特定副檔名的檔案都是某個檔案型態
How to use UltiSnips on file with custom extension
Use file.customExtension as example write the line into your vimrc
autocmd BufRead,BufNewFile *.customExtension setfiletype customExtension
therefore, you could add file customExtension.snippets in your snippets folder
That's all!
Principle
Unitsnips uses filetype provide by vim.the setting above sets filetype for all file which filename like ```customExtension.snippets```
留言
張貼留言