AssemblyForNeovim is a small Lua plugin that brings compiler-generated assembly into Neovim in a floating window. It supports C, C++, and Rust, targeting x64 and AArch64. Its purpose is to let developers inspect how code is translated into machine instructions without leaving the editor, much like using an online compiler explorer. The repository provides a demonstration video and installation instructions for lazy.nvim; setup consists of adding the plugin and calling `require("asm").setup()`.
In normal mode, pressing `a` displays the assembly for the function under the cursor. In visual mode, the same key compiles the selected text, and the `:Asm` command can also be used with selected lines. Within the floating window, `+` and `-` adjust the compiler optimization level, `R` reruns compilation, and `q` closes the window. The plugin requires `cc` or `c++` for C and C++ compilation, or `rustc` or `cargo` for Rust, to be available on the system path. When present, a `compile_commands.json` file is used to obtain compilation settings. The project is a compact editor utility rather than a full debugger: its focus is quickly comparing source code with the assembly produced by different optimization levels.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.