Neovim PDE — C/C++, Go, Python and Rust

Setting up a PDE for C/C++, Go, Python, and Rust.

alpha2phi
5 min readMay 20

--

Neovim PDE — C/C++, Go, Python and Rust

In this article, we will set up the development environments for C/C++, Go, Python, and Rust.

This article is part of the Neovim PDE series.

The Neovim configuration files are available in this repository.

Getting Started

In the previous article, we configured a baseline configuration that allows us to set up a personalized development environment based on the programming language we want to use. We also configured the development environment for Lua.

In this article, we will continue to set up development environments for Python, Go, Rust, and C/C++ that can be used as baselines for further customization.

Python

The Python language development environment is configured in the lua/pde/python.lua file.

  • For nvim-treesitter, we install the python parser (line 2— line 7).
  • Using mason.nvim, we install debugpy (debugger) and black (code formatted), and Ruff (linter) (line 15 — line 20).
  • We configure null-ls.nvim to use the black formatter (line 8 — line 14).
  • For nvim-lspconfig, we configure Pyright and Ruff (line 22— line 39). We also configure Python-specific keymappings (line 51 — line 56).
  • For debugging, we install nvim-dap-python (line 63— line 69).

LSP should work now, as shown below.

Python — LSP

Debugging should work now, as shown below,

Python — Debugging

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.