Skip to content

vlopes11/rrust.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RRust

This is a helper tool to record the execution of a Rust test with rr, and replay it using termdebug. For more information, check :h termdebug.

Requirements

Minimum version of neovim: 0.9.0

packadd termdebug

Installation

Plug 'vlopes11/rrust.nvim'

Usage

Position your cursor on a Rust test, and run:

:lua require('rrust').RustRRTestRecord()

It will call rr to record the execution of the test.

To debug the test, run:

:lua require('rrust').RustRRTestReplay()

Etc

I created the following convenience setup:

local rrust = require('rrust')

vim.cmd('packadd termdebug')

vim.keymap.set("n", "<leader>ed", function()
    if rrust.RustRRTestRecord() then
        rrust.RustRRTestReplay()
        vim.cmd([[
            wincmd L
            wincmd h
            vertical resize 73
            wincmd l
            stopinsert
        ]])
    end
end)

vim.keymap.set('n', '<F4>', function() vim.cmd('Stop') end)
vim.keymap.set('n', '<F5>', function() vim.cmd('Continue') end)
vim.keymap.set('n', '<F6>', function() vim.cmd('Finish') end)
vim.keymap.set('n', '<F7>', function() vim.cmd('Step') end)
vim.keymap.set('n', '<F8>', function() vim.cmd('Over') end)
vim.keymap.set('n', '<F9>', function() vim.cmd('Break') end)
vim.keymap.set('n', '<F10>', function() vim.cmd('Evaluate') end)

output

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages