CLANGD(1)
π
CLANGD β the clangd manual page, User Commands edition β¨
okay bestie, sit down, hydrate, and let me tell you about clangd π«Ά this is the User Commands manual page for clangd and it is genuinely iconic.
β¨ NAME β¨
clangd β a language server that gives editors IDE-like features π
πΈ DESCRIPTION πΈ
OVERVIEW: clangd is a language server that provides IDE-like features to editors. no cap, that's the whole vibe. π₯
It should be used via an editor plugin rather than invoked directly. fr fr, don't just rawdog it in your terminal like it's a normal CLI β it wants to live inside your editor, plugged in, thriving, main character energy π
For more information, see:
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 queen, two whole ways to feed her π
USAGE:
clangd [options]
OPTIONS:
π§° Generic Options
--helpβ Display available options (--help-hiddenfor more) π there's always more hiding under the hood--help-listβ Display list of available options (--help-list-hiddenfor more) π--versionβ Display the version of this program β
π οΈ clangd compilation flags options
--compile-commands-dir=<string>β Specify a path to look forcompile_commands.json. If path is invalid,clangdwill look in the current directory and parent paths of each source file π§ she'll go hunting, don't worry--query-driver=<string>β Comma separated list of globs for white-listing gcc-compatible drivers that are safe to execute. Drivers matching any of these globs will be used to extract system includes. e.g./usr/bin/**/clang-*,/path/to/repo/**/g++-*π only the white-listed ones get to run, safety first bestie
π¦ 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 project code in the background and persist index on disk. πΎ she's working while you're not looking, icon--background-index-priority=<value>β Thread priority for building the background index. The effect of this flag is OS-specific. π₯οΈ=backgroundβ Minimum priority, runs on idle CPUs. May leave 'performance' cores unused. π napping on the nice cores=lowβ Reduced priority compared to interactive work. π’=normalβ Same priority as otherclangdwork. πΆ
--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 π every single one, fully dressed=bundledβ Similar completion items (e.g. function overloads) are combined. Type information shown where possible π bundled together, cute
--experimental-modules-supportβ Experimental support for standard c++ modules π§ͺ experimental, bestie, you've been warned--fallback-style=<string>βclang-formatstyle to apply by default when no.clang-formatfile is found π the backup outfit--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 π« not today
--header-insertion-decoratorsβ Prepend a circular dot or space before the completion label, depending on whether an include line will be inserted or not π΅π«₯ a lil dot tellin' you what's up--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 byclangd.0means no limit (default=1000) π’--limit-results=<int>β Limit the number of results returned byclangd.0means no limit (default=100) π’--project-root=<string>β Path to the project root. Requiresremote-index-addressto be set. β οΈ she literally will not do this one without the address, that's the rule--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. Useful to investigate/reproduce crashes or configuration problems. With--check=<filename>, attempts to parse a particular file. π΅οΈ perfect for when something is being weird--enable-configβ Read user and project configuration from YAML files. π- Project config is from a
.clangdfile in the project directory. - User config is from
clangd/config.yamlin the following directories:
- Project config is from a
Windows: %USERPROFILE%\AppData\Local
Mac OS: ~/Library/Preferences/
Others: $XDG_CONFIG_HOME, usually ~/.config
- Configuration is documented at
https://clangd.llvm.org/config.htmlπ
-j <uint>β Number of async workers used byclangd. Background index also uses this many workers. π―βοΈ--malloc-trimβ Release memory periodically viamalloc_trim(3). π§Ή decluttering queen--pch-storage=<value>β Storing PCHs in memory increases memory usages, but may improve performance βοΈ the eternal tradeoff=diskβ store PCHs on disk π½=memoryβ store PCHs in memory π§
π‘ clangd protocol and logging options
--log=<value>β Verbosity of log messages written to stderr π£οΈ=errorβ Error messages only β=infoβ High level execution tracing βΉοΈ=verboseβ Low level details π¬ every last detail, we love a yapper
--offset-encoding=<value>β Force theoffsetEncodingused for character positions. This bypasses negotiation via client capabilities π― no negotiating, we're deciding=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 (whereclangdsees 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π first match wins, remember that--prettyβ Pretty-print JSON output πΈ
β οΈ reminder bestie: run clangd through your editor plugin, not directly. that's the whole design, iykyk π
and that's the whole page π₯Ή this was clangd 22, from September 2026 β user commands, official manual page, no notes. slay, go forth, and let your editor cook πππ
π¦ where this page comes from
- ubuntu stonking: clangd-22 1:22.1.8-1ubuntu1 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms