Is there a C++11 syntax file for vim?

后端 未结 9 844
栀梦
栀梦 2020-12-02 14:58

In particular, the display of initialization lists is really bad:

vector v({1,2,3});

will highlight the curly braces in red (den

相关标签:
9条回答
  • 2020-12-02 16:00

    use uniform initialization instead of the old () constructor

    vector v {1,2,3};

    0 讨论(0)
  • 2020-12-02 16:03

    There is now a C++11 script from http://www.vim.org/scripts/script.php?script_id=3797, which no longer mark the braces inside parenthesis as error.

    0 讨论(0)
  • 2020-12-02 16:03

    If you use YouCompleteMe,you can change '.ycm_extra_conf.py'.like this:(file path~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py) ;

    only change flags

    flags = [
    '-std=c++11',
    '-O0',  
    '-Werror', 
    '-Weverything', 
    '-Wno-documentation', 
    '-Wno-deprecated-declarations', 
    '-Wno-disabled-macro-expansion', 
    '-Wno-float-equal', 
    '-Wno-c++98-compat', 
    '-Wno-c++98-compat-pedantic', 
    '-Wno-global-constructors', 
    '-Wno-exit-time-destructors', 
    '-Wno-missing-prototypes', 
    '-Wno-padded', 
    '-Wno-old-style-cast',
    '-Wno-weak-vtables',
    '-x', 
    'c++', 
    '-I', 
    '.', 
    '-isystem', 
    '/usr/include/', 
    

    ]

    0 讨论(0)
提交回复
热议问题