# Directory Local LSP Config
## Metadata
**Status**:: #x
**Zettel**:: #zettel/fleeting
**Created**:: [[2025-06-20]]
## Synopsis
When an LSP client starts, it resolves its configuration by merging from the
following (in increasing priority):
1. Configuration defined for the `'*'` name.
2. Configuration from the result of merging all tables returned by
`lsp/<name>.lua` files in 'runtimepath' for a server of name `name`.
3. Configurations defined anywhere else.
To config LSP in a directory, use [[Directory Local Vim Config]] and add the config in the local exrc file.
Configure a server directly:
```
vim.lsp.config('clangd', {
filetypes = { 'c' },
})
```
Or place LSP configs at `.nvim/lsp/*.lua` and add them to rtp
```
vim.cmd[[set runtimepath+=.nvim]]
```