Skip to content

editor: Suppport .clangd and .editorconfig#829

Open
kavirajk wants to merge 3 commits intocmu-db:masterfrom
kavirajk:kavirajk/editor-tweaks
Open

editor: Suppport .clangd and .editorconfig#829
kavirajk wants to merge 3 commits intocmu-db:masterfrom
kavirajk:kavirajk/editor-tweaks

Conversation

@kavirajk
Copy link
Copy Markdown

@kavirajk kavirajk commented Aug 25, 2025

This PR add two small files to make it more friendly for editors (like Neovim)

  1. .editorconfig - Sets basic indentation and style for this repository
  2. .clangd - Helps to discover local and third-party header files via compile_commands.json

Without (1), my default 4 spaces makes it weird. This config will keep the spaces consistent in the editor as per the existing code in this repository.

Without (2), my editor (Neovim) failing to find the non-standard header files.

Both (1) and (2) are inspired from Neovim repository itself and also looked pretty standard for C++ projects.

  1. https://github.com/neovim/neovim/blob/master/.editorconfig
  2. https://github.com/neovim/neovim/blob/master/.clangd

I kept the configs to bare minimum. Happy to add additional flags --std=c++20 in .clangd if needed to enforce C++20 standard for editor's LSP client for this repository as mentioned in the CMU Database course https://15445.courses.cs.cmu.edu/fall2025/faq.html#q5

This PR add two small files to make it more friendly for editors (like Neovim)

1. .editorconfig - Sets basic indendation and style for this repository
2. .clangd - Helps to discover local and third-party header files via `compile_commands.json`

Without (1), my default 4 spaces makes it weird. This config will keep the spaces consistent in the editor
as per the existing code in this repository.

Without (2), my editor (Neovim) failing to find the non-standard header files.

Both (1) and (2) are inspired from Neovim repository itself and also looked pretty standard for C++ projects.
1. https://github.com/neovim/neovim/blob/master/.editorconfig
2. https://github.com/neovim/neovim/blob/master/.clangd

I kept the configs to bare minimum. Happy to add additional flags `--std=c++20` in `.clangd` if needed to
enforce C++20 standard for editor's LSP client for this repository as mentioned in the CMU Database course
https://15445.courses.cs.cmu.edu/fall2025/faq.html#q5

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant