CLANGD(1)
π CLANGD π
okay bestie, welcome to the clangd manual page, straight from the User Commands corner of the universe β¨ this is the page for clangd 20, and no cap, it's a lot β but I got you, we're going through every single flag together π«Ά
πΈ NAME πΈ
clangd β manual page for clangd 20 π
β¨ DESCRIPTION β¨
OVERVIEW: clangd is a language server that provides IDE-like features to editors π
Real talk: you should be using it via an editor plugin, not by yeeting it at your terminal directly. It's literally not built for that vibe. For more info, go look at:
https://clangd.llvm.org/
https://microsoft.github.io/language-server-protocol/
clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment variable π (yes, the env var is real, it's giving main character energy)
USAGE: clangd [options]
OPTIONS:
π§ GENERIC OPTIONS π§
--helpβ Show you the available options. And if that's not enough for you (valid),--help-hiddenshows more π--help-listβ Show you a list of the available options. If you want more,--help-list-hiddenhas you covered β¨--versionβ Print the version of this program. Simple. Iconic. Slay π
π§ clangd compilation flags options π§
--compile-commands-dir=<string>β Point clangd at a path where it should go looking forcompile_commands.jsonπ If that path is invalid, clangd will look in the current directory and in the parent paths of each source file instead β it's flexible like that.--query-driver=<string>β A comma separated list of globs that white-lists gcc-compatible drivers that are safe to execute β οΈ Drivers matching any of these globs will be used to extract system includes. For example:/usr/bin/**/clang-*,/path/to/repo/**/g++-*
π clangd feature options π
--all-scopes-completionβ If set to true, code completion will include index symbols that are not defined in the scopes (e.g. namespaces) visible from the code completion point. Such completions can insert scope qualifiers π₯--background-indexβ Index your project code in the background and persist that index on disk. Obsessed with this one honestly πΎ--background-index-priority=<value>β Thread priority for building the background index. Heads up bestie: the effect of this flag is OS-specific π=backgroundβ Minimum priority, runs on idle CPUs. May leave'performance'cores unused π΄=lowβ Reduced priority compared to interactive work.=normalβ Same priority as other clangd work.
--clang-tidyβ Enableclang-tidydiagnostics β--completion-style=<value>β Granularity of code completion suggestions π=detailedβ One completion item for each semantically distinct completion, with full type information π=bundledβ Similar completion items (e.g. function overloads) are combined. Type information shown where possible π
--experimental-modules-supportβ Experimental support for standard C++ modules π§ͺ (experimental! be aware!)--fallback-style=<string>β Theclang-formatstyle to apply by default when no.clang-formatfile is found π--function-arg-placeholders=<string>β When disabled (0), completions contain only parentheses for function calls. When enabled (1), completions also contain placeholders for method parameters π«Ά--header-insertion=<value>β Add#includedirectives when accepting code completions π₯=iwyuβ Include what you use. Insert the owning header for top-level symbols, unless the header is already directly included or the symbol is forward-declared.=neverβ Never insert#includedirectives as part of code completion π«
--header-insertion-decoratorsβ Prepend a circular dot or space before the completion label, depending on whether an include line will be inserted or not β--import-insertionsβ If header insertion is enabled, add#importdirectives when accepting code completions or fixing includes in Objective-C code π--limit-references=<int>β Limit the number of references returned by clangd.0means no limit (default=1000) π’--limit-results=<int>β Limit the number of results returned by clangd.0means no limit (default=100) π’--project-root=<string>β Path to the project root. Requiresremote-index-addressto be set π--remote-index-address=<string>β Address of the remote index server π--rename-file-limit=<int>β Limit the number of files to be affected by symbol renaming.0means no limit (default=50) π·οΈ
π clangd miscellaneous options π
--check[=<string>]β Parse one file in isolation instead of acting as a language server. Super useful to investigate/reproduce crashes or configuration problems π΅οΈ With--check=<filename>, it attempts to parse a particular file.--enable-configβ Read user and project configuration from YAML files π Project config is from a.clangdfile in the project directory. User config is fromclangd/config.yamlin the following directories:- Windows:
%USERPROFILE%\AppData\Local - Mac OS:
~/Library/Preferences/ - Others:
$XDG_CONFIG_HOME, usually~/.config
- Windows:
Configuration is documented at https://clangd.llvm.org/config.html π
-j <uint>β Number of async workers used by clangd. The background index also uses this many workers π§π€π§--malloc-trimβ Release memory periodically viamalloc_trim(3)π§Ή--pch-storage=<value>β Storing PCHs in memory increases memory usage, but may improve performance βοΈ=diskβ store PCHs on disk π½=memoryβ store PCHs in memory π§
π clangd protocol and logging options π
--log=<value>β Verbosity of log messages written tostderrπ=errorβ Error messages only π¨=infoβ High level execution tracing π=verboseβ Low level details π£οΈ
--offset-encoding=<value>β Force theoffsetEncodingused for character positions. This bypasses negotiation via client capabilities π―=utf-8β Offsets are in UTF-8 bytes=utf-16β Offsets are in UTF-16 code units=utf-32β Offsets are in unicode codepoints
--path-mappings=<string>β Translates between client paths (as seen by a remote editor) and server paths (where clangd sees files on disk) πΊοΈ Comma separated list of'<client_path>=<server_path>'pairs, the first entry matching a given path is used. e.g./home/project/incl=/opt/include,/home/project=/workarea/project--prettyβ Pretty-print JSON output πΈ (your eyes will thank you)
and that's the whole page bestie, you ate that π«Ά this was clangd 20, dated September 2026, living in the User Commands family β go forth and be the main character of your own editor π
β¨π
π¦ where this page comes from
- ubuntu stonking: clangd-20 1:20.1.8-2ubuntu13 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms