Vim Tips Wiki
No edit summary
(Bug fixed since version 5.19.)
 
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{ScriptComments|cvim: C/C++ IDE to write and run programs, insert statements, idioms, comments etc}}
+
{{ScriptComments|c-support: C/C++ IDE to write, compile and run C/C++ programs}}
   
  +
==Reports and requests==
==Bug: template not readable==
 
  +
Please put bug reports or feature requests at https://github.com/WolfgangMehner/vim-plugins
I encountered the error message "Global template file '.s:C_GlobalTemplateFile.' not readable." when starting Vim with the cvim plugin.
 
   
  +
Please help us keep track of all the issues and name your report/request:
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 <code>expand()</code>.
 
  +
:C-Support: <title>
   
  +
== Requests: Doxygen style comments ==
I suggest to replace the occurrences of
 
  +
Can support for doxygen style comments be added please? There's another plugin for doxygen-support, but I'd really like to be able to use the c-support mappings. Something like \cdme for method description and so on?
<pre>
 
expand("<sfile>")
 
</pre>
 
   
  +
- Is in work for the next release. - Wolfgang Mehner
with
 
<pre>
 
resolve(expand("<sfile>"))
 
</pre>
 
 
and likewise for <code>expand("$HOME")</code>
 
<pre>
 
line 88:
 
if match( expand("<sfile>"), expand("$HOME") ) == 0
 
would become
 
if match( resolve(expand("<sfile>")), resolve(expand("$HOME"))) == 0
 
</pre>
 
   
 
==Comments==
 
==Comments==
Line 64: Line 52:
 
it seems work fine. <small>--Preceding [[Vim Tips Wiki:Quick reference|unsigned]] comment added by [[User:Julian01|Julian01]] 21:00, September 15, 2011</small>
 
it seems work fine. <small>--Preceding [[Vim Tips Wiki:Quick reference|unsigned]] comment added by [[User:Julian01|Julian01]] 21:00, September 15, 2011</small>
   
  +
==Solve the template read error on MS Windows==
===Documentation correction===
 
 
*Go to C:\Program Files\vim\vim73\plugin\
File: Readme.csupport, Reference: Indian Hill C Style and Coding Standards updated link
 
 
*find c.vim
 
 
*select from line 70 to 84 then replace the contents with the following:
Please change the link to "Recommended C Style and Coding Standards"
 
<pre>
 
-- www.doc.ic.ac.uk/lab/secondyear/cstyle/cstyle.html
 
++ www.doc.ic.ac.uk/lab/cplus/cstyle.html
 
</pre>
 
 
--Henry Pfeil, January 24, 2012
 
 
 
 
== '''========Easy method to Solve the Template read Error on MS Windows==========''' ==
 
 
Solve the problem, its easy:
 
Go to C:\Program Files\vim\vim73\plugin\
 
find c.vim
 
select from line 70 to 84 then replace the contents with the following:
 
 
<pre>
 
<pre>
 
\ substitute( expand("$VIM"), '\', '/', 'g' ) ) == 0
 
\ substitute( expand("$VIM"), '\', '/', 'g' ) ) == 0
Line 101: Line 74:
 
</pre>
 
</pre>
   
 
Still confused? Download my [http://www.filefactory.com/file/7cbuywyyhbut/n/c_vim c.vim] and put it in the plugin directory, but keep a backup of the old file always.
Still confused?
 
Download the c.vim (of mine) and put it in the plugin directory, but keep a backup of the old always.
 
 
[http://www.filefactory.com/file/7cbuywyyhbut/n/c_vim c.vim]
 
   
  +
I solved this just adjusting the paths, for the future releases of cvim adjusting the paths should solve the problem. But I hope this would have ben solved in the next release if the developers are interested in. Currently my solution works for the Script Version 6.0 (2012-08-20) VIM Version 7.0.
This worked for me on my Win_XP and my brother's Win_SEVEN, both machines.
 
   
 
This worked for me on my Win_XP and my brother's Win_SEVEN, both machines. --Pinaki Sekhar Gupta, September 12, 2012 4:19 AM (Kolkata, INDIA).
You may give it a try.
 
   
  +
===Extra fix for omnicppcomplete===
--Pinaki Sekhar Gupta, September 12, 2012 4:19 AM (Kolkata, INDIA).
 
  +
Still now omnicppcomplete does not work. I had to modify the plugin's path to work properly, so I did. Get this modified version: [http://www.filefactory.com/file/1xgoca1yua3h/n/cvim_6_0_modified_zip cvim_6.0_modified.zip] --October 13, 2012

Latest revision as of 17:06, 27 October 2013

Use this page to discuss script 213 c-support: C/C++ IDE to write, compile and run C/C++ programs

  • 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.

Reports and requests[]

Please put bug reports or feature requests at https://github.com/WolfgangMehner/vim-plugins

Please help us keep track of all the issues and name your report/request:

C-Support: <title>

Requests: Doxygen style comments[]

Can support for doxygen style comments be added please? There's another plugin for doxygen-support, but I'd really like to be able to use the c-support mappings. Something like \cdme for method description and so on?

- Is in work for the next release. - Wolfgang Mehner

Comments[]

I had the same error than you on my Windows SEVEN computer. I tried your solution but unfortunatly it didn't solve it.

Is it really working on your side ? Thanks, --Julien, 11:05, August 8, 2011

Patch[]

I have trying you c's vim script and now I update to the new release 5.15.1 and I ran into this message:

Local template file 'C:\Users\main/vimfiles/c-support/templates/Templates' not readable.

I resolved this in this manner:

I modified line 74 to 80 in c.vim:

		" user installation assumed
		let s:plugin_dir  					= $HOME.'/vimfiles/'
	endif
	"
	let s:C_LocalTemplateFile     = $HOME.'/vimfiles/c-support/templates/Templates'
	let s:C_LocalTemplateDir      = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
	let s:C_CodeSnippets  				= $HOME.'/vimfiles/c-support/codesnippets/'
	let s:C_IndentErrorLog				= $HOME.'/_indent.errorlog'
	"

I've changed for this:

		" user installation assumed
		let s:plugin_dir  					= $VIM.'/vimfiles/'
	endif
	"
	let s:C_LocalTemplateFile     = $VIM.'/vimfiles/c-support/templates/Templates'
	let s:C_LocalTemplateDir      = fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
	let s:C_CodeSnippets  				= $VIM.'/vimfiles/c-support/codesnippets/'
	let s:C_IndentErrorLog				= $VIM.'/_indent.errorlog

it seems work fine. --Preceding unsigned comment added by Julian01 21:00, September 15, 2011

Solve the template read error on MS Windows[]

  • Go to C:\Program Files\vim\vim73\plugin\
  • find c.vim
  • select from line 70 to 84 then replace the contents with the following:
				\		substitute( expand("$VIM"),   '\', '/', 'g' ) ) == 0
		"
		" USER INSTALLATION ASSUMED
		let g:C_Installation				= 'local'
		let s:plugin_dir  					= substitute( expand('<sfile>:p:h:h'), '\', '/', 'g' )
		let s:C_LocalTemplateFile		= s:plugin_dir.'/c-support/templates/Templates'
		let s:C_LocalTemplateDir		= fnamemodify( s:C_LocalTemplateFile, ":p:h" ).'/'
	else
		"
		" SYSTEM WIDE INSTALLATION
		let g:C_Installation				= 'system'
		let s:plugin_dir						= $VIM.'/vimfiles'
		let s:C_GlobalTemplateDir		= s:plugin_dir.'/c-support/templates'
		let s:C_GlobalTemplateFile  = s:C_GlobalTemplateDir.'/Templates'
		let s:C_LocalTemplateFile		= $VIM.'/c-support/templates/Templates'

Still confused? Download my c.vim and put it in the plugin directory, but keep a backup of the old file always.

I solved this just adjusting the paths, for the future releases of cvim adjusting the paths should solve the problem. But I hope this would have ben solved in the next release if the developers are interested in. Currently my solution works for the Script Version 6.0 (2012-08-20) VIM Version 7.0.

This worked for me on my Win_XP and my brother's Win_SEVEN, both machines. --Pinaki Sekhar Gupta, September 12, 2012 4:19 AM (Kolkata, INDIA).

Extra fix for omnicppcomplete[]

Still now omnicppcomplete does not work. I had to modify the plugin's path to work properly, so I did. Get this modified version: cvim_6.0_modified.zip --October 13, 2012