How I Setup Neovim For Competitive Programming In C++

Michael Bao
Unixification
Published in
3 min readAug 20, 2023

--

Screenshot by author

I have been using Neovim for a few years, and the experience is revolutionary. For competitive programming, I have gone through many different text editors and IDEs, but in the end, landed on Neovim.

When I use Neovim for competitive programming, I use clangd for LSP and clang-format for formatting.

Prerequisites

There are a few packages that we must install before we can start configuring. To do this run the following commands.

brew install neovim --HEAD
brew install llvm gcc@12
brew install clang-format

Since we are using clangd for LSP, we need to configure GCC headers. I have already written an article on this which will mainly cover how to integrate GCC headers to be accessible by clangd. This also goes over the process of using it with Neovim LSP, so I will not be going over that in this article.

Neovim

Clang Format

--

--

Michael Bao
Unixification

Neovim | Arch Linux | macOS | I love to write about random tech stuff. Tinkering around with Linux, Neovim, and computers.