sponsor Vim development Vim logo Vim Book Ad

cppSyntaxCheck : A syntax check script for cpp

 script karma  Rating 53/20, Downloaded by 3692  Comments, bugs, improvements  Vim wiki

created by
Phonzia Yang
 
script type
utility
 
description
This a script use g++ as a parser to check the syntax of cpp source code, and show where the errors and warnings are. Installion is in a easy way and everytime you save the file, syntax errors and warnings are showed.
You can also check errors in quickfix window by using command :cw
See the install details for install guide, if you find any bugs or method to make it better, please contact me using e-mail: phonzia@gmail.com

Key binding:
<Leader>s      go to next signed error or warning line

You can also download it from github:
https://github.com/phonzia/cppSyntaxCheck.git
 
install details
Put the script cppSyntaxCheck.vim in folder ~/.vim/plugin, then it works
You can also add statement like below in order to adjust to your environment
let g:include_path=":../include:./include:./tinyxml"
let g:compile_flag="-D_LINUX_"
let g:cpp_compiler="/usr/bin/g++"
let g:enable_warning=1
let g:cpp_compiler="LANG=C g++ -Wall"
let g:longest_text=120

 

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
cppSyntaxCheck.vim 1.1 2013-05-20 7.3 Phonzia Yang 1.Fix A bug which may cause vim crash
2.Optimized for better performance
cppSyntaxCheck.vim 0.6 2013-05-16 7.3 Phonzia Yang Now you can check errors in quickfix window
cppSyntaxCheck.vim 0.5 2013-05-16 7.3 Phonzia Yang 1. Show a hint message instead of error/warning message if error/warning message is too long. You can custumize your longest length.
cppSyntaxCheck.vim 0.4 2013-05-13 7.3 Phonzia Yang Modifies:
1. Add a shortcut key <Leader>s to go to signed error
2. Optimized to be faster
cppSyntaxCheck.vim 0.3 2012-09-05 7.3 Phonzia Yang modifies:
1. The analyze results will not lost when switching between buffers in this version, we don't need to resave to trigger the analyze again when swiching to another file and switching back later
cppSyntaxCheck.vim 0.2 2012-09-04 7.3 Phonzia Yang add option g:enable_warning to enable and disable warnings
cppSyntaxCheck.vim 0.1 2012-09-03 7.3 Phonzia Yang Initial upload
ip used for rating: 18.119.111.9

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.
   
Vim at Github