diff.md

 1---
 2title: Diff
 3description: "Configure Diff language support in Zed, including language servers, formatting, and debugging."
 4---
 5
 6# Diff
 7
 8Diff support is available natively in Zed.
 9
10- Tree-sitter: [zed-industries/the-mikedavis/tree-sitter-diff](https://github.com/the-mikedavis/tree-sitter-diff)
11
12## Configuration
13
14Zed will not attempt to format diff files and has [`remove_trailing_whitespace_on_save`](https://zed.dev/docs/reference/all-settings#remove-trailing-whitespace-on-save) and [`ensure-final-newline-on-save`](https://zed.dev/docs/reference/all-settings#ensure-final-newline-on-save) set to false.
15
16Zed will automatically recognize files with `patch` and `diff` extensions as Diff files. To recognize other extensions, add them to `file_types` in your Zed settings.json:
17
18```json [settings]
19  "file_types": {
20    "Diff": ["dif"]
21  },
22```