This commit is contained in:
sankalp committed 2024-05-03 13:00:13 +05:45
1 parent 24feea3d4a
commit 9178d9ad60
8 files changed
+105 -74

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
require('code_runner').setup({
filetype = {
java = {
"cd $dir &&",
"javac $fileName &&",
"java $fileNameWithoutExt"
},
python = "python3 -u",
typescript = "deno run",
rust = {
"cd $dir &&",
"rustc $fileName &&",
"$dir/$fileNameWithoutExt"
},
c = function(...)
c_base = {
"cd $dir &&",
"gcc $fileName -o",
"/tmp/$fileNameWithoutExt",
}
local c_exec = {
"&& /tmp/$fileNameWithoutExt &&",
"rm /tmp/$fileNameWithoutExt",
}
vim.ui.input({ prompt = "Add more args:" }, function(input)
c_base[4] = input
vim.print(vim.tbl_extend("force", c_base, c_exec))
require("code_runner.commands").run_from_fn(vim.list_extend(c_base, c_exec))
end)
end,
},
})