sponsor Vim development Vim logo Vim Book Ad

c.vim : C/C++ IDE --  Write and run programs. Insert statements, idioms, comments etc.

 script karma  Rating 4962/1527, Downloaded by 99939    Comments, bugs, improvements  Vim wiki

created by
Fritz Mehner
 
script type
utility
 
description
**   Statement oriented editing of  C / C++ programs
**   Speed up writing new code considerably.
**   Write code und comments with a professional appearance from the beginning.
**   Use code snippets
**   Toolbox for cmake(1), doxygen(1), and make(1)

- insertion of various types of comments   (file prologue, function descriptions, file section headers
    keyword comments, date, time, ...  )
- insertion of empty control statements   (if-else, while, do-while, switch, ... )
- insertion of various preprocessor directives
- insertion of C-idioms   (enum+typedef, loops, complete main, empty function, file open dialogs, ... )
- insertion of C++ -idioms   ( frames for simple classes and template classes, try-catch blocks,
    file open dialogs, output manipulators, ios flags, ... )
- use and organize your own collection of code snippets
- compile / link / run support for one-file projects   (without a makefile)
- run buffer through splint
- personalization of comments   (name, email, ... )
- menus can be switched on and off   (Tools menu)

Here are some screen shots : http://lug.fh-swf.de/vim/vim-c/screenshots-en.html

The help file online :   http://lug.fh-swf.de/vim/vim-c/csupport.html

The key mappings of this plugin (PDF) : http://lug.fh-swf.de/vim/vim-c/c-hotkeys.pdf

See also the http://www.thegeekstuff.com tutorial
"Make Vim as Your C/C++ IDE Using c.vim Plugin"
(http://www.thegeekstuff.com/2009/01/tutorial-make-vim-as-your-cc-ide-using-cvim-plugin/)

DOCUMENTATION
--------------------------------------------------------
This plugin comes with a help file (csupport.txt). Read it with  

:h csupport

** PLEASE READ THE DOCUMENTATION **

Editing actions differ for different modes!  
There are  a lot of  features which can be configured or customized
to match your needs.

GitHub
--------------------------------------------------------
C Support is on GitHub:

      https://github.com/WolfgangMehner/vim-plugins

(Please help us keep track of all the issues and name your report/request "C-Support: <title>")

MAILING LIST
--------------------------------------------------------
You can subscribe to the vim-plugins-list mailing list to post your questions or
suggestions for improvement or to report bugs.  The list will also be used to
announce new releases ( c.vim / bash-support / perl-support / awk-support /latex-support / vim-support ).
Visit the following page for subscribing to the mailing list:
    
  http://lug.fh-swf.de/cgi-bin/mailman/listinfo/vim-plugins-list

The vim-plugins-list list is very low on traffic.
 
install details
Copy the zip archive  cvim.zip to $HOME/.vim/ (Linux/Unix) or $HOME/vimfiles (Windows) and run
      unzip cvim.zip
If you have already an older version of this plugin and you have modified the
template files you may want to save your templates first or copy the files from the
archive by hand. See also the file README.csupport within the zip file.

To enable the tools for cmake or doxygen, add these lines to ~/.vimrc :

      let  g:C_UseTool_cmake    = 'yes'
      let  g:C_UseTool_doxygen = 'yes'

For how to enable the Doxygen templates, see Chapter 1.10.1 of the documentation:

      help csupport-doxygen-enable
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
cvim.zip 6.1.1 2014-04-21 7.0 Fritz Mehner - Added 'C_SetMapLeader' and 'C_ResetMapLeader'.
- Bugfix: Resetting maplocalleader in filetype plug-in after setting it to the
  value of g:C_MapLeader.
- Bugfix: Setup of local templates in case of global installation.
- Bugfix: Better compatibility with custom mappings
  (use "normal!" and "noremap" consistently).
- 'Help->show manual' shows man page text with appropriate width (UNIX only).
- Extended the documentation.
cvim.zip 6.1 2013-12-28 7.0 Fritz Mehner - Map renamed: \rme -> \re.
- New global variable g:C_InsertFileHeader (suppress file description comment for new files).
- Two new ex commands: CCmdlineArgs, CMakeCmdlineArgs.
- 'Run->cmd. line arg.' : tab expansion (files/directories)for all arguments.
- Bugfix: template 'file description header' not loading (thanks to Marco Lasczok).
- Bugfix: unnecessary characters in one template.
- Prototype picker improved.
- Toggle non-C-comments.
- Run debugger.
- Some global variables now changeable on the fly.
- Menus now show the correct mapleader.
- Bugfix: g:C_LoadMenus now works.
- Bugfix: Prevent unnecessary rereading of the template library.
- Added Doxygen templates and 'Doxygen->brief, after member'.
- Added help menu entries: help English, help Doxygen
- Improved "adjust end-of-line comment".
- Bugfix: Setup of local templates in case of global installation.
- Bugfix: Map and menu entry 'Snippets->edit global templates'.
- Several internal improvements.
cvim.zip 6.0 2012-08-20 7.0 Fritz Mehner ++  The plug-in version 6.0+ is a rewriting of version 5.19.
++  The template syntax has changed!

- New template system (many thanks to Wolfgang Mehner)
- A few new hotkeys and menu item.
- A few hotkeys and menu items renamed.

cvim.zip 5.19 2012-05-18 7.0 Fritz Mehner - Resolve home for linked home directories.
- Three C++-items removed (see file 'customization.cpp.vim').
- Bugfix: global options changed unintentionally.
- Minor improvements and bugfixes.
cvim.zip 5.18 2012-03-03 7.0 Fritz Mehner - Hotkeys \lcs, \ucs removed.
- Bugfix: delayed template initialization missing correct style.
- Wrong cursor position when inserting some templates at the end of a line.
cvim.zip 5.17 2011-12-29 7.0 Fritz Mehner - Two new plugin tags: LICENSE,ORGANIZATION
- System-wide installation: minimal Template file for a user will automatically be added.
- New menu item and hotkey: choose a makefile.
- New idiom: realloc.
- New preprocessor item: #if #endif.
- New hotkeys: \ire, \ifs, \ifp, \pif.
cvim.zip 5.16.1 2011-11-10 7.0 Fritz Mehner - Bugfix: problem with a system-wide installation under Windows (thanks to Ricardo Vrech).
cvim.zip 5.16 2011-11-05 7.0 Fritz Mehner - Plugin loads faster: loading the templates is delayed until the first use.
- Plugin now works with pathogen.vim.
- Menus will always be generated (for the use with :emenu).
- Bugfix: no local templates available with a system-wide installation (thanks to Iain Arnell).
- Several improvements.
cvim.zip 5.15.1 2011-09-11 7.0 Fritz Mehner This is the correct version 5.15.
The version 5.15 just published) contains a wrong archive. Sorry.
cvim.zip 5.15 2011-09-11 7.0 Fritz Mehner - New hotkey \cx C to C++ comments and vice versa.
- Several hotkeys allow a range, e.g. '3\cl' (see help text and c-hotkey.pdf).
- Improved prototype picking: \nf, \np picks up a function prototype,
  \nm picks up a method prototype (see documentation for more).
- include-statements will now be inserted in the actual line (before: new line
  below the actual line).
- Several minor improvements.
cvim.zip 5.14 2011-07-02 7.0 Fritz Mehner - A makefile can be run with C-F9
- Linking ( Run menu, \rl, \rr ) will be suppressed if buffer contains no main function.
- Bugfix: correctly deactivate unwanted compiler messages in a quickfix buffer.
- Several minor improvements.
cvim.zip 5.13 2011-01-25 7.0 Fritz Mehner - New hotkeys \rmc (run 'make clean') and \rme (executable to run).
- Hotkeys for make are working when in a makefile.
- Linker errors and errors during a make will be shown in a quickfix buffer.
- Bugfix: detection of a systemwide installation can fail.
- Bugfix: preprocessor directive '#if 0 #endif' not working.
cvim.zip 5.12 2010-11-19 7.0 Fritz Mehner - New hotkeys \+" .
- Windows: user installation now possible.
- Bugfixe: for-idiom shows part of type definition as variable name in some cases.
- Bugfixe: wrong cursor position for some templates.
cvim.zip 5.11 2010-05-31 5.7 Fritz Mehner - New tag {CURSOR} to avoid indent problems in a few cases.
- Three hotkeys renamed \rg -> \rma , \ri -> \rpa ,  \re -> \rka (better to remember).
- 'long long' added to the for-idioms.
- Bugfixes: for-idiom shows type as variable name if no variable name was given.
- Bugfixes: for-idiom inserts standard types with 2+ words wrong.
- Bugfixes: multiline end-of-line comments have wrong position in some cases.
- Bugfixes: local installation looks like a system-wide installation in seldom cases.
cvim.zip 5.10 2010-02-05 7.0 Fritz Mehner - The plugin now handles different template styles without editing and reloading the main template file.
- The number of template styles is not limited.
- New hotkey and ex-command to switch template styles.
- Template styles can automatically be related to file extensions.
- indent(1) errors will be presented in a quickfix error window.
- Comment alignment improved.
- Minor improvements.
cvim.zip 5.9 2009-10-21 7.0 Fritz Mehner + Two additional hotkeys (+ ex commands) for preprocessor statements.
+ Compile-link-run: improved error detection.
+ Menu Run: hardcopy can print any buffer.
+ Several minor improvements and bugfixes.
cvim.zip 5.8 2009-06-30 7.0 Fritz Mehner + Hotkeys are shown in the menus.
+ File browser for code snippets and templates choosable (2 global variables).
+ Two new hotkeys: include file description (implementation, header).
+ New menu item: namespace alias
+ Bugfix: wrapper script for use of a xterm could not handle parameters containing blanks.
+ Several minor improvements.
cvim.zip 5.7 2009-04-30 7.0 Fritz Mehner + 4 new hotkeys : insert file section comments (C/C++/H), special comments,
  keyword comments.
+ End-of-line comment adjustment improved.
cvim.zip 5.6 2009-04-06 7.0 Fritz Mehner + Jump targets (templates) and mapping Ctrl-j can be switched off.
+ Yet unused jump targets will be highlighted after a file is opened.
+ Statements menu: else block (key mapping \se).
+ Handling of <SPLIT> improved (templates).
+ Minor improvements.
cvim.zip 5.5 2009-02-17 7.0 Fritz Mehner + Additional plugin-tags (jump targets in templates): <+text+>, <-text->.
+ Additional mapping Ctrl-j : jump to these new targets.
+ Template-file: additional macro |STYLE| and IF-ENDIF-construct to easily
  choose between sets of templates.
+ Additional mapping: auto-complete classical C comment (also multi-line).
+ Additional mapping: auto-complete open block starting with {<CR> .
+ Visual mode for date and time insertion (menu 'Comments').
+ Visual mode for tags (submenu 'Comments->tags (plugin)').
+ Bugfix: hotkey \ica not working
+ Bugfix: hotkey Shift-F2 for the alternate-plugin disappeared.
cvim.zip 5.4 2008-12-15 7.0 Fritz Mehner + New hotkey \+co inserts ' cout <<  << endl;'
+ New menu item C++-menu: 'cout' replaces 'cout variable' and 'cout string'.
+ Hotkey \c/ removed ( \cc does the same).
+ Bugfix: after an unsuccessful compilation screen sometimes garbled.
cvim.zip 5.3 2008-12-03 7.0 Fritz Mehner + Insertions work properly when folding is used.
+ Menu items Idioms->for(...) : type declaration for loop variable possible (tab completion).
+ Specification of command line arguments (Run->cmd. line arg.): filename completion active.
+ New main menu item 'show manual' (hotkey \hm): read manual for word under cursor.
+ One hotkey renamed: \h -> \hp (help plugin)
cvim.zip 5.2.1 2008-08-18 7.0 Fritz Mehner + Bugfix: stray characters whith three dialogs
+ Bugfix: Missing parameter in 2 internal function calls
+ Menu items 'Snippets->edit local/global templates' start an file browser (convenience).
cvim.zip 5.2 2008-08-04 7.0 Fritz Mehner + Superfluous control characters for mode switching (menus, hotkeys) removed. Caused beeps.
+ Template files (local/global) can be opened from the snippet menu.
+ Three new preprocessor statements.
+ v-mode for RTTI-entries.
cvim.zip 5.1 2008-03-12 7.0 Fritz Mehner + Definition and implementation of classes have now different templates and menu entries.
+ Accessor methods (get/set) can be generated.
+ New templates: everything other than language keywords comes from a template (and is user changeable).
cvim.zip 5.0.5 2007-11-21 7.0 Fritz Mehner + Bugfix: on a few systems doubling of path components in the run command (F9).
  Skip this upgrade if you do not have this problem.
cvim.zip 5.0.4 2007-11-16 7.0 Fritz Mehner + Format for the macros |DATE|, |TIME|, and |YEAR| can be defined by the user.
+ Help text improved.
cvim.zip 5.0.3 2007-10-16 7.0 Fritz Mehner + Code snippets can now be used in the console mode (Vim without GUI).
+ Bugfix: Possible conflict with 'indent' removed when inserting templates.
cvim.zip 5.0.2 2007-10-03 7.0 Fritz Mehner + Bugfix: Prototype picker did not alway delete no longer used prototypes.
+ Bugfix: Prototype picker removed template specializations from parameter lists.
cvim.zip 5.0.1 2007-09-26 7.0 Fritz Mehner + Bugfix: autocmd setting can influence autocmd settings of OTHER plugins.
cvim.zip 5.0 2007-09-17 7.0 Fritz Mehner + New template system. Now every menu item is user definable.
+ Changes to allow a system-wide installation.
+ A few hotkeys added and renamed.

cvim.zip 4.6.1 2007-08-13 6.0 Fritz Mehner + New global variable to control the filetype of *.h header files (default is now 'cpp').
+ Bugfix: properly resetting 'compiler' after using make, splint, and CodeCheck.
cvim.zip 4.6 2007-05-25 6.0 Fritz Mehner + New insert mode mappings (comments, statements, preprocessing, idioms, C++).
+ Some mappings renamed (easier to remember).
+ New tag (basename of a file reduced to characters allowed in names).
cvim.zip 4.5 2007-04-24 6.0 Fritz Mehner + New menu item and hotkey for the (re)alignement of end-of-line comments.
+ Hotkey \cn removed. Only one menu item for end-of-line comments left.
+ Changed hotkeys: \ce -> \cl and \cl -> \cs .
+ Three new tags (giving the basename of a file) for writing template files.
+ Prototype picker handles template methods.
+ Bugfix: splint works now under Windows.
+ Minor improvements.
cvim.zip 4.4 2007-02-21 6.0 Fritz Mehner + PLUGIN DIRECTORIES REARRANGED.
+ main- and for-idiom have a visual mode now.
+ Four new commands (command line) to control the comment style.
+ Comment style (C/C++) can automatically follow the filetype.
+ Bugfix: empty new file after removing the header template can't be closed.
+ Bugfix : Tools entry missing when root menu not shown from the start.
+ Minor improvements.
cvim.zip 4.3 2006-11-17 6.0 Fritz Mehner + New key mappings for preprocessor statements.
+ Source code analysing tool CodeCheck (Trademark) integrated
+ New preprocessor menu.
+ Bugfix: indent under Windows.
+ Minor improvements.
cvim.zip 4.2.1 2006-08-26 6.0 Fritz Mehner + Bugfix: change needed for some menu names after patch 7.0.054 .
cvim.zip 4.2 2006-08-03 6.0 Fritz Mehner + Setting the starting column for trailing comments improved.
+ Small bug in block uncommenting fixed.
+ Mac OS X : circumvent a Vim bug which caused a crash when loading plugin version 4.1
+ File syntax/c.vim removed (but see help in csupport.txt).
cvim.zip 4.1 2006-06-29 6.0 Fritz Mehner + A complete switch statement can be made from a list of labels.
+ Additional cases can be made from a list of labels.
+ Small bug in line end commenting fixed.
+ Minor improvements.
cvim.zip 4.0 2006-04-13 6.0 Fritz Mehner + Kernighan & Ritchie style for block statements can be enabled.
+ Changes to make plugin compatible with Vim 7.
+ Set C/C++ file type for source files which should not be preprocessed (*.i, *.ii).
+ Some minor improvements.
cvim.zip 3.11 2006-03-20 6.0 Fritz Mehner + Hotkeys and an accompanying reference card added.
+ Preparation for syntax based folding.
+ Some minor improvements.
cvim.zip 3.10 2006-01-26 6.0 Fritz Mehner + Remove "#if 0 ... #endif" from the inside.
+ Change C comments to C++ comments and vice versa.
+ try..catch / catch / catch(...)  now can be set surround a marked area.
+ Prototype picking improved (for C++).
+ A hardcopy shows the localized date and time in the header line.
+ New help menu entry in the main menu of this plugin (shows the plugin documentation).
+ Switch between corresponding source and header files with <S-F2> if the plugin a.vim
  is present.
+ Plugin can be used with autocompletion for (, [, and { .
cvim.zip 3.9.1 2005-12-04 6.0 Fritz Mehner + Doubling of file header for new c- and h-files under Windows fixed (Thanks to Fabricio C A Oliveira).
+ Tiny bug in the file open idioms fixed.
cvim.zip 3.9 2005-11-01 6.0 Fritz Mehner + Formatter 'indent' integrated.
+ Bugfix in the automatic header insertion.
+ Assert idiom added.
+ #if 0 ... #endif statement for blocking out code added.
+ Minor stylistic improvements in some idioms.
cvim.zip 3.8.2 2005-09-05 6.0 Fritz Mehner + Screen update problem solved: color inversion under FC4 (Thanks to Bernie Barton).
+ RTTI menu : additional v-mode.
+ Statement menu and C++ menu rearranged.
+ Include guard : name generation improved.
+ File header templates will be included for additional file extensions (cp, cxx, c++, ...).
cvim.zip 3.8.1 2005-08-08 6.0 Fritz Mehner + More C++ output manipulators; manipulator insertion more intuitive.
+ Output into buffer: cursor goes to top of file.
+ Makefile template improved (code snippet).
+ Some minor improvements.
cvim.zip 3.8 2005-05-31 6.0 Fritz Mehner + Windows support. Most features are available under Windows now.
cvim.zip 3.7.2 2005-05-05 6.0 Fritz Mehner + Run buffer through splint (A tool for statically checking C programs; see
  http://www.splint.org). An error window will be opened; quickfix commands can be used.
+ Set buffer related command line arguments for splint.
+ Line end comments start in a fixed column (can be set from the menu).
+ Spaces in path names and file names are now possible.
+ Template files and snippet files are no longer kept in the list of alternate files.
+ Some minor improvements.
cvim.zip 3.7.1 2004-12-21 6.0 Fritz Mehner + Bug fixed (comand line arguments not passed to the executable).
+ File extension for executables can be set.
+ Minor improvements.
cvim.zip 3.7 2004-12-17 6.0 Fritz Mehner + Running a program:
  (1) Run program from the gVim command line.
  (2) Run program and direct the output into a window with name "C-Output".
  (3) Run program in an xterm.
+ Command line arguments are now buffer related (each buffer can have its own arguments).
+ Code snippets can be protected from being indented during insertion.
+ Picked up prototypes will be deleted after insertion.
+ A code snippet with the file name extension "ni" or "noindent" will not be
  indented on insertion.
+ for- and calloc-/malloc-idioms improved.
+ Bug fixed (word list handling).
cvim.zip 3.6 2004-07-06 6.0 Fritz Mehner + Installation simplified.
+ for-loop-idiom asks for control variable, initial value, ...
+ malloc-idiom asks for pointer variable and size.
+ Toggling the comment style works correct again.
+ Empty error windows will be closed.
+ Prototype picker removes trailing parts of the function body if marked.
+ The dialog windows (GUI) have been replaced by more flexible command line inputs.
+ The undocumented and unnecessary hot key F12 has been removed.
+ Extension to ctags + taglist shows makefile targets and qmake targets.
cvim.zip 3.5 2004-04-02 6.0 Fritz Mehner + Aligned line end comments for consecutive lines.
+ Improved prototype picker removes comments.
+ Picked up prototypes can be shown.
+ Uncomment more than one block at once.
+ 3 new idioms.
+ Help file improved .
cvim.zip 3.4 2003-12-26 6.0 Fritz Mehner + The following constructs are now read as templates from files:
   class, class using new, template class, template class using new, error class
+ The preprocessor statements #if... and the function idiom include marked lines when invoked in visual mode.
+ All hotkeys are only defined for C/C++ files (file type plugin added).
+ Only one C/C++ entry in the gVim root menu (can be disabled).
+ Two new global variables: C_Dictionary_File, C_MenuHeader .
+ Install script added.
+ Customization improved.
+ Documentation improved (help file added).
+ Bug fix (template file handling)
cvim.zip 3.1 2003-05-31 6.0 Fritz Mehner + When the comment style "C" is active the menu entry "Comments.code->comment"
  turns a marked region in one multiline C-comment.
+ The menu entry "Comments.comment->code"  turns marked multiline C-comment   back into code.
+ A marked region can be surrounded by a for-, if, if-else, while-, do-while-statement  (with indentation).
+ The menu entry "Snippets.make prototype" makes a C- or C++-prototype from
  the current line or marked region and puts it in an internal buffer.
+ The menu entry "Snippets.add prototype" also makes a C- or C++-prototype from
  the current line or a marked region and adds it to the internal buffer.
+ The menu entry "Snippets.put prototype" inserts all gathered prototypes    below the current line.
+ Tag substitution rewritten (Some characters in a substitution text for a tag
  prevented the tag from being substituted).
cvim.zip 3.0 2003-04-28 6.0 Fritz Mehner + C-style comments AND C++-style comments are supported now.
+ The menu entry 'Comments->Comment style ..' switches the styles (toggle).
+ Block comments are now read as templates or skeletons from files:
    Frame Block,        Function Description,  Method Description,
    Class Description,  H+file header,         C/C++-file header
+ These templates can contain tags like |FILENAME|, |AUTHOR| etc. which are replaced
  after reading (KDevelop templates can be used without any change).
+ indentation: multiline inserts and code snippets will be indented after insertion.
+ Most menu entries are now also active in normal mode.
+ new menu items:  includes for the C99 header,
  includes for the standard C++ header,
  includes for the C++ version of the Standard C Library header,
  multiline C comment,  vim modeline
+ Reading the templates is done in one function which can be called in an autocmd.
+ Code cleanup: register z no longer used. Most function calls are silent now.
cvim.zip 2.8.1 2003-03-06 6.0 Fritz Mehner - menus appear immediately after loading the plugin
- additional word lists for keyword completion (optional):
    C/C++ -keywords
    German words (for commenting sources)
    K&R-Book: Words from the table of content (for commenting sources)
    Standard Template Library (STL):  method names and type names
    XFORMS library: macro and function names
- additional settings for .vimrc and .gvimrc (optional)
c.vim 2.8 2003-02-17 6.0 Fritz Mehner - code snippet support: read, write, edit code snippets in a separate directory
- specify command line arguments for make
- hardcopy: print whole buffer or a highlighted part of it into a file (Postscript)
- new menu entry  "fscanf( infile, "", & );"  after code for opening a file with pointer "infile" is inserted
- new menu entry  "fprintf( outfile, "\n",  );"  after code for opening a file with pointer "outfile" is inserted
cvim.zip 2.6 2002-07-04 6.0 Fritz Mehner - separation of file section comments in 2 new submenus
   'C-File-Sections' and 'H-File-Sections'
- class comment
- method comment
- keyword comments and special comments are now in submenus
- new hot key to run make
- word list for C/C++ word completion (optional)
- some optional vimrc- and gvimrc-entries in two files (optional)
- minor improvements and corrections
c.vim 2.1 2002-04-04 6.0 Fritz Mehner - include all file section headers at once
- insert empty block
- 2 additional loops
- includes for all Standard C Library header files
- minor internal improvements
c.vim 2.0.3 2002-03-07 6.0 Fritz Mehner (1) 4 new keyword comments
(2) code->comments does no longer mark  the first character in all lines
c.vim 2.0 2002-02-13 6.0 Fritz Mehner Initial upload
ip used for rating: 107.22.141.14

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo