A Vim plugin that integrates Blot, a compiler-explorer clone that works with your local toolchain and project, with Vim for C++ development.
- Display assembly output in a split window alongside your C++ source
- Highlight source-to-assembly line mappings
- Automatic blot executable detection
- Configurable key mappings
Add to your .vimrc:
Plug 'adromanov/vim-blot'Copy the plugin files to your Vim configuration directory:
cp -r ftplugin/ ~/.vim/ftplugin/
cp -r plugin/ ~/.vim/plugin/cd ~/.vim/bundle
git clone https://github.com/adromanov/vim-blot:BlotShowAssembly- Generate and display assembly for the current C++ file:BlotHighlight- Highlight assembly lines corresponding to current source line:BlotClose- Close the assembly buffer
<leader>ba- Show assembly<leader>bh- Highlight current line mappings<leader>bc- Close assembly buffer
" Set custom blot executable path (default: 'blot')
let g:blot_executable = '/path/to/blot'
" Disable default key mappings
let g:blot_no_mappings = 1
" Enable auto-highlighting when cursor moves (experimental)
let g:blot_auto_highlight = 1" Disable default mappings
let g:blot_no_mappings = 1
" Set your own mappings
nnoremap <F5> :BlotShowAssembly<CR>
nnoremap <F6> :BlotHighlight<CR>
nnoremap <F7> :BlotClose<CR>- The plugin runs
blot --json <filename>on the current C++ file - Parses the JSON output containing assembly lines and line mappings
- Creates a new buffer with assembly syntax highlighting
- Provides commands to highlight corresponding assembly lines
- Vim with JSON support (Vim 8.0+ or Neovim)
- Built blot executable (either in project
build-Debug/or in PATH) - C++ project with
compile_commands.json(for blot to work)
- "Blot executable not found": Ensure blot is built or set
g:blot_executable - "Blot failed": Check that your C++ file is in a project with
compile_commands.json - No assembly output: Verify the file compiles successfully with your build system
