Wikia

Vim Tips Wiki

Script:213

Talk0
1,613pages on
this wiki
Revision as of 08:36, January 31, 2013 by 138.25.206.158 (Talk)

Use this page to discuss script 213 cvim: C/C++ IDE to write and run programs, insert statements, idioms, comments etc

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

Feature requests

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?

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

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

Documentation correction

File: Readme.csupport, Reference: Indian Hill C Style and Coding Standards updated link

Please change the link to "Recommended C Style and Coding Standards"

  -- www.doc.ic.ac.uk/lab/secondyear/cstyle/cstyle.html
  ++ www.doc.ic.ac.uk/lab/cplus/cstyle.html

--Henry Pfeil, January 24, 2012

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

Around Wikia's network

Random Wiki