change rust run & debug keymaps to use previous target (when available)

this might prove annoying at some point, but i figure this is by far
the most common way i would use these (to re-run/re-debug the same
target as i'm working and in between changes, etc)
This commit is contained in:
Gered 2024-09-03 17:41:07 -04:00
parent 12d125b471
commit 9bb4d876a4

View file

@ -8,9 +8,9 @@ local function map(mode, lhs, rhs, opts)
end
map('n', '<leader>ra', '<Cmd>RustLsp codeAction<CR>', { desc = 'Code [A]ction' })
map('n', '<leader>rr', '<Cmd>RustLsp run<CR>', { desc = '[R]un' })
map('n', '<leader>rr', '<Cmd>RustLsp! runnables<CR>', { desc = '[R]un' })
map('n', '<leader>rR', '<Cmd>RustLsp runnables<CR>', { desc = '[R]unnables' })
map('n', '<leader>rd', '<Cmd>RustLsp debug<CR>', { desc = '[D]ebug' })
map('n', '<leader>rd', '<Cmd>RustLsp! debuggables<CR>', { desc = '[D]ebug' })
map('n', '<leader>rD', '<Cmd>RustLsp debuggables<CR>', { desc = '[D]ebuggables' })
map('n', '<leader>rt', '<Cmd>RustLsp testables<CR>', { desc = '[T]estables' })
map('n', '<leader>re', '<Cmd>RustLsp explainError<CR>', { desc = '[E]xplain Error' })