Files
dotfiles/nvim/lua/custom_functions.lua
2026-05-19 04:10:44 -05:00

32 lines
831 B
Lua

return {
execute = function(type)
local command_table = {
build = {
rust = 'cargo build',
},
run = {
java = 'java %',
python = 'python %',
rust = 'cargo run',
},
test = {
cpp = 'make test',
python = 'pytest',
rust = 'cargo test',
},
benchmark = {
rust = 'cargo bench',
},
upload = {
cpp = 'make upload',
}
}
vim.api.nvim_command('write')
local command = command_table[type][vim.bo.filetype]
if command ~= nil then
vim.cmd('FloatermNew --autoclose=0 --height=0.9 --width=0.9 ' .. command)
end
end
}