Files
dotfiles/nvim/lua/custom_functions.lua
FaultyBranches abe81c01b3 feat: A working state during the transfer between the old neovim
configurations and using newer built-in functionality in the 0.12.x
versions of Neovim.

Further work is needed for treesitter updates, cleanup of the conversion
work and testing to verify old functionality isn't lessened to get the
benefits of a cleaner config and vastly faster load times.
2026-05-23 20:28:34 -05:00

37 lines
912 B
Lua

return {
execute = function(type)
-- Mapping of filetypes to commands
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',
}
}
-- Save the file
vim.api.nvim_command('write')
local command = command_table[type][vim.bo.filetype]
if command ~= nil then
-- Run command in a new terminal buffer
vim.cmd('terminal ' .. command)
end
end
}