Saturday, March 19, 2016

Integrating cpplint with Vim

Vim is a light-weight, yet powerful editor. Although it may be quite frustrating for developers that it does not, by default, support features such as nice syntax highlighting or keyboard shortcuts,  It is really too easy and straightforward to enable such developer friendly features into it. Here I am showing how to setup a keyboard shortcut to use cpplint with Vim in order to perform code style checking.

cpplint is a code style checker that checks how much your code matches the Google C++ Style guidlines. The feedback returned by cpplint can be valuable for developers to practice writing good code according to Google C++ style guidelines (or others).

  1. Download cpplint from here.
  2. copy cpplint to one of your path directories, make sure it is executable. For example:
sudo cp /usr/local/bin/
sudo chmod usr/local/bin/

3. To setup a keyboard shortcut in VIM to run against your cpp file. Add the following line into your ~/.vimrc file

autocmd BufRead *.cpp map <F7> :w<enter>:!/usr/local/bin/ %<enter>

4. Now, you can use the F7 keyboard shortcut to run cpplint while editing any *.cpp file.


  1. Finding the best healthcare assignment writing services and Medical Assignment Writing Services is not easy unless one is keen to establish a reliable custom medical research paper provider & medical writing service help online.

  2. Accounting assignment writing services have become very popular for students studying finance & accounting coursework writing services as they engage the best online Accounting Writing Services.

  3. Great Article Cyber Security Projects projects for cse Networking Security Projects JavaScript Training in Chennai JavaScript Training in Chennai The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training