I recently started using gentoo distribution.
I have used xptemplates for some time.
Gentoo is so kind(or not so kind) that it distributes vim files for
its specific files but not so kind to change filetype to sth like
gentoo-*.
For example vi /etc/make.conf -c":echo &ft"
will yeld gentoo-make-conf.
This causes problem with xptemplates because It can't find matching
file type.
Problem code
file: plugin/classes/FiletypeScope.vim line 29 (in my git version)
fun! s:SetSnippetLoaded( filename ) dict "{{{
let self.loadedSnipFiles[ a:filename ] = 1
let fn = substitute(a:filename, '\\', '/', 'g')
let shortname = matchstr(fn, '\Vftplugin\/\zs\w\+\/\.\*\ze.xpt.vim')
let self.loadedSnipFiles[shortname] =
endfunction "}}}
I the same is for 0.4.8.1220.
One solution is patch below, it may fix some other problems.
Second is to add some gentoo file matching to xptemplates .
Proposed patch :
diff --git a/plugin/classes/FiletypeScope.vim
b/plugin/classes/FiletypeScope.vim index 8a3b96f..a37c2d6 100644
--- a/plugin/classes/FiletypeScope.vim
+++ b/plugin/classes/FiletypeScope.vim
@@ -31,7 +31,9 @@ fun! s:SetSnippetLoaded( filename ) dict "{{{
let fn = substitute(a:filename, '\\', '/', 'g')
let shortname = matchstr(fn,'\Vftplugin\/\zs\w\+\/\.\*\ze.xpt.vim')
- let self.loadedSnipFiles[shortname] = 1
+ if ( shortname != "" )
+ let self.loadedSnipFiles[shortname] = 1
+ endif
endfunction "}}}
--
You received this message because you are subscribed to the Google Groups "xptemplate" group.
To post to this group, send email to xptem...@googlegroups.com.
To unsubscribe from this group, send email to xptemplate+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xptemplate?hl=en.
/usr/share/vim/vimfiles/ftdetect/gentoo.vim
which in turn provide some additional functionality for system
configuration files.
The one above contains:
" make.conf
au BufNewFile,BufRead make.{conf,globals}
\ set filetype=gentoo-make-conf
second ones like
/usr/share/vim/vimfiles/syntax/gentoo-make-conf.vim
provide syntax highlighting.
But using the xptemplates at first time for that file results in error:
Error detected while processing function
XPTemplateStart..<SNR>52_GetContextFTObj..XPTsnippetFileInit..<SNR>37_CheckAndSetSnippetLoaded..<SNR>37_SetSnippetLoaded:
line 6: E713: Cannot use empty key for Dictionary
after that everything is ok.
I can send you the file in question if you want.