Vim Tips Wiki
(standard format)
Line 1: Line 1:
  +
{{ScriptComments|213|cvim: C/C++ IDE to write and run programs, insert statements, idioms, comments etc}}
Hi, I encountered the error message
 
   
=="Global template file '.s:C_GlobalTemplateFile.' not readable."==
+
==Bug: template not readable==
  +
I encountered the error message "Global template file '.s:C_GlobalTemplateFile.' not readable." when starting Vim with the cvim plugin.
   
  +
The problem is that the cvim.vim script checks whether the filename it was started with and the home directory match. My home directory happens to be a link which is not fully expanded by <tt>expand()</tt>.
when starting vim with the cvim plugin.
 
   
 
I suggest to replace the occurrences of
The problem is that the cvim.vim script checks whether the filename it was
 
  +
<pre>
started with and the home directory match. My home directory happens to be
 
 
expand("<sfile>")
a link which is not fully expanded by expand().
 
  +
</pre>
I suggest to replace the occurrences of
 
 
'''expand("<sfile>")'''
 
   
 
with
 
with
  +
<pre>
'''resolve(expand("<sfile>"))'''
+
resolve(expand("<sfile>"))
 
  +
</pre>
and likewise for expand("$HOME")
 
   
 
and likewise for <tt>expand("$HOME")</tt>
  +
<pre>
 
line 88:
 
line 88:
 
 
if match( expand("<sfile>"), expand("$HOME") ) == 0
 
if match( expand("<sfile>"), expand("$HOME") ) == 0
 
 
would become
 
would become
 
if match( resolve(expand("<sfile>")), resolve(expand("$HOME"))) == 0
  +
</pre>
   
  +
==Comments==
'''if match( resolve(expand("<sfile>")), resolve(expand("$HOME"))) == 0'''
 

Revision as of 01:18, 25 June 2011

Use this page to discuss script 213 213

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Bug: template not readable

I encountered the error message "Global template file '.s:C_GlobalTemplateFile.' not readable." when starting Vim with the cvim plugin.

The problem is that the cvim.vim script checks whether the filename it was started with and the home directory match. My home directory happens to be a link which is not fully expanded by expand().

I suggest to replace the occurrences of

expand("<sfile>")

with

resolve(expand("<sfile>"))

and likewise for expand("$HOME")

line 88:
if match( expand("<sfile>"), expand("$HOME") ) == 0
would become
if match( resolve(expand("<sfile>")), resolve(expand("$HOME"))) == 0

Comments