emacs下使用google-cpplint

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangell/article/details/39780233

        cpplint项目地址 (https://code.google.com/p/google-styleguide/)
        下载cpplint (http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py)

    1. 安装google-cpplint
       $ wget http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
       $ sudo mv cpplint.py /usr/local/bin/cpplint.py
       $ sudo chmod 755 /usr/local/bin/cpplint.py

    2. 配置emacs支持cpplint
       a) 使用package-list-packages安装 flymake-google-cpplint flymake-cursor
       b) 在init.el中增加如下配置
       ;(executable-find "cpplint.py") ; 这个命令和下面这条一样,告诉emacs执行文件位置
       (custom-set-variables
        '(flycheck-c/c++-googlelint-executable "/usr/local/bin/cpplint.py"))
       
       (require 'flymake-google-cpplint)
       (add-hook 'c++-mode-hook 'flymake-google-cpplint-load)
       
       ;; 以下这部分是对 cpplint 的配置, 可以使用其默认配置
       ;(custom-set-variables
       ; '(flymake-google-cpplint-verbose "3")
       ; '(flymake-google-cpplint-linelength "120")
       ; '(flymake-google-cpplint-location 'tempdir))

    一些好的emacs学习blog和emacs配置
       王垠的emacs
       tuhdo的emacs配置(当然你也可以直接进他的github(https://github.com/tuhdo))
       ergoemacs
       璇玑玉衡的教程(此教程为入门级教程 http://www.cnblogs.com/robertzml/archive/2009/09/27/1574557.html)
       flymake指导 (github:https://github.com/senda-akiha/flymake-google-cpplint)
       flycheck指导 (github:https://github.com/flycheck/flycheck)

猜你喜欢

转载自blog.csdn.net/wangell/article/details/39780233