File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -683,7 +683,7 @@ fun! snipMate#RetabSnip() range
683683endf
684684
685685fun ! snipMate#OpenSnippetFiles ()
686- let scopes = s: AddScopeAliases (split (& ft , ' \. ' ))
686+ let scopes = s: AddScopeAliases (snipMate#ScopesByFile ( ))
687687 let dict = snipMate#GetSnippetFiles (0 , scopes, ' *' )
688688 " sort by files wether they exist - put existing files first
689689 let exists = []
@@ -704,5 +704,10 @@ fun! snipMate#OpenSnippetFiles()
704704 endfor
705705endf
706706
707+ fun ! snipMate#ScopesByFile ()
708+ " default implementation to determine scopes based on cursor, filetype,
709+ " syntax setting. Usually &ft and &syntax are the same
710+ return tlib#list#Uniq (split (&ft , ' \.' ) + [&syntax , ' _' ])
711+ endf
707712
708713" vim:noet :sw = 4 :ts = 4 :ft = vim
Original file line number Diff line number Diff line change @@ -140,9 +140,9 @@ See |snipMate-disambiguation| to learn about how name collisions are handled.
140140Note that dotted
141141'filetype' syntax is supported -- e.g., you can use >
142142
143- :set ft=html.eruby
144-
145- to activate snippets for both HTML and eRuby for the current file.
143+ :set ft=html.eruby =syntax=sql
144+ to activate snippets for both HTML, eRuby and sql for the current file.
145+ See snipMate#ScopesByFile()
146146
147147The syntax for snippets in *.snippets files is the following: >
148148
You can’t perform that action at this time.
0 commit comments