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_dir
Specify 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_file
Specify the files you want to exclude while generate config or tags.
default value:let g:gencconf_ignore_file = []
-
g:gencconf_root_markers
Specify the which directoriy is root_marker dir.
default value:let g:gencconf_root_markers = ['.root', '.git', '.svn', '.hg']
-
g:gencconf_suffix_list
Specify 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_rootmarker
1
, config will save in root_marker dir,0
, save in root_marker's parent dir.
default value: 1 -
g:gencconf_relative_path
0
: full path,1
: relative path.
default value: 1 -
g:gencconf_tag_relative
0
: full path,1
: ctags set --tag-relative
default value: 1 -
g:gencconf_default_option
Default options, add before autogen config.
onlycompile_commands.json
usecpp
options.default value:
let g:gencconf_default_option = { \ 'c': ['gcc', '-c', '-std=c11'], \ 'cpp': ['g++', '-c', '-std=c++14'], \ '*': ['-ferror-limit=0'] \ }
-
g:gencconf_conf_name
Specify 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_bin
Set path of ctags bin.
default value:ctags
-
g:gencconf_ctags_option
Set ctags option.
default value: `` -
g:gencconf_autoload_tag
Auto load tags in root_marker.
default value:1
-
:GenClangConf
Gen
compile_flags.txt
in root_marker's parent dir, it will add all the directories
containing the specified suffix files.
if not found root_marker dir, gencompile_flags.txt
in current dir. -
:ClearClangConf
Remove the generated file.
-
:GenCtags languages
Gen
tags
in root_marker's dir.
if not found root_marker dir, gen in current dir.
parameter is used to set thelanguages
option, 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-bang
option force update whole project
:GenCtags! languages
-
:ClearCtags
Remove the generated tags.