J-Cowsert

Neovim plugin to visualize C/C++ class/struct memory layouts using clang

13
1
100% credibility
Found Apr 17, 2026 at 13 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Lua
AI Summary

Neovim add-on that displays memory layouts for C/C++ structs, classes, unions, and types in a floating window.

How It Works

1
💻 Editing C/C++ code

You're working on C or C++ code in Neovim and curious about how your data structures arrange memory.

2
🔍 Find the tool

You discover classlayout, a handy add-on that reveals memory layouts right inside your editor.

3
🛠️ Add to Neovim

You easily include it in your Neovim setup so it's ready whenever you need it.

4
📄 Open your file

You open and save your C/C++ code file in Neovim.

5
👆 Cursor on type

You place your cursor over a struct, class, or variable name and press the simple shortcut.

6
🪟 See the layout

A helpful pop-up window floats up, showing exactly how memory is organized with offsets and spaces.

Bytes revealed

You now clearly understand your data's memory footprint without ever leaving your editor.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 13 to 13 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is classlayout.nvim?

classlayout.nvim is a Lua-based Neovim plugin that lets you visualize C/C++ struct and class memory layouts right in a floating window—field offsets, padding, and alignment included. Put your cursor on a type name or variable, hit `cl` or `:ClassLayout`, and it dumps the compiler's exact layout using clang, pulling flags from `compile_commands.json` for accuracy. No more switching to terminals or external tools to hunt down why your bytes aren't packing right.

Why is it gaining traction?

It stands out by resolving variables to types via clangd LSP, handling STL containers and unions seamlessly, and caching dumps for instant repeat lookups after the first compile. Developers dig the auto-detection of project compiler flags, keeping layouts precise without manual tweaks, and the clean hover-style workflow that fits neovim plugins lists like lazy.nvim installs. In a sea of neovim github integrations, this nails C/C++ debugging without bloat.

Who should use this?

C/C++ systems programmers tweaking struct padding for embedded targets or performance-critical code. Kernel hackers or game engine devs optimizing memory in Neovim with clangd setups. Anyone on NixOS or using neovim github copilot who hates context-switching for layout dumps.

Verdict

Worth a spin for C/C++ Neovim users—installs easily via plugin managers, docs cover setup and keymaps cleanly—but at 13 stars and 1.0% credibility, it's early alpha with no tests visible. Try on non-prod code first; could mature into a staple with more eyes.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.