plugin for Vim/NeoVim to easy use clang config.
It is used for generate simple config file for clangd, ccls, ycm, tested on Windows/Linux.
get file list default use rg, if not have, use vim script(may be slow).
-
Plug 'fcying/gen_clang_conf.vim'
-
g:gencconf_ignore_dirSpecify the directories you want to exclude while generate config or tags.
default value:let g:gencconf_ignore_dir = ['__pycache__', 'out', 'lib', 'build', \ 'cache', 'doc', 'docs']
-
g:gencconf_ignore_fileSpecify the files you want to exclude while generate config or tags.
default value:let g:gencconf_ignore_file = []
-
g:gencconf_root_markersSpecify the which directoriy is root_marker dir.
default value:let g:gencconf_root_markers = ['.root', '.git', '.svn', '.hg']
-
g:gencconf_suffix_listSpecify the which suffix file will be found.
default value:let g:gencconf_suffix_list = { 'c': ['c'], 'cpp': ['cc', 'cpp'], 'h': ['h', 'hh']}
-
g:gencconf_storein_rootmarker1, config will save in root_marker dir,0, save in root_marker's parent dir.
default value: 1 -
g:gencconf_relative_path0: full path,1: relative path.
default value: 1 -
g:gencconf_tag_relative0: full path,1: ctags set --tag-relative
default value: 1 -
g:gencconf_default_optionDefault options, add before autogen config.
onlycompile_commands.jsonusecppoptions.default value:
let g:gencconf_default_option = { \ 'c': ['gcc', '-c', '-std=c11'], \ 'cpp': ['g++', '-c', '-std=c++14'], \ '*': ['-ferror-limit=0'] \ }
-
g:gencconf_conf_nameSpecify clang config file name, ex:
compile_commands.json,compile_flags.txt,.ccls,.ycm_extra_conf.py.
default value:let g:gencconf_conf_name = 'compile_commands.json'
-
g:gencconf_ctags_binSet path of ctags bin.
default value:ctags -
g:gencconf_ctags_optionSet ctags option.
default value: `` -
g:gencconf_autoload_tagAuto load tags in root_marker.
default value:1
-
:GenClangConfGen
compile_flags.txtin root_marker's parent dir, it will add all the directories
containing the specified suffix files.
if not found root_marker dir, gencompile_flags.txtin current dir. -
:ClearClangConfRemove the generated file.
-
:GenCtags languagesGen
tagsin root_marker's dir.
if not found root_marker dir, gen in current dir.
parameter is used to set thelanguagesoption, if not provided, not setlanguages.
If the tags file exists, only incremental updates to the current file,
else the whole project will be updated, or you can use the-bangoption force update whole project
:GenCtags! languages -
:ClearCtagsRemove the generated tags.