I have an original "dotfiles" repository made years ago when I was first learning how to code. It's a dumpster fire. Thus, this is the "redux" replacement, bigger, better, faster, stronger.
- Copy .pre-commit-config.yaml file to project root directory
- For c/c++ projects, copy .clang-format file to project root directory
- In project root directory, execute the following to configure hooks:
pre-commit install
pre-commit install -t prepare-commit-msg
- Copy
project-configs/CMakeLists.base.txt
to project root - (deprecated) Copy
project-configs/.ccls
to project root to configure ccls language server - After configuring CMake files, from project root execute:
The first command creates a debug target, the second is a release target
CC=clang CXX=g++-13 cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=DEBUG CC=clang CXX=g++-13 cmake -S . -B build/release -DCMAKE_BUILD_TYPE=RELEASE
clangd will rely on a generated compile_commands.json
database to know
what flags are present at compile time. This is used by the LSP when in Neovim to
power features like jump to definitions, etc. CMake is configured to emit this file.
If you're not using CMake, you can use Bear
to generate this file.