mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 16:39:04 +02:00
fix code runner
This commit is contained in:
parent
418a659142
commit
a44ddd6365
2 changed files with 19 additions and 11 deletions
|
@ -116,5 +116,13 @@ vim.g.pcode_whichkey = {
|
|||
|
||||
-- https://github.com/CRAG666/code_runner.nvim
|
||||
vim.g.pcode_coderunner = {
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
python = "python3 -u",
|
||||
typescript = "deno run",
|
||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||
cpp = "g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
javascript = "node $dir/$fileName",
|
||||
go = "go run $fileName",
|
||||
}
|
||||
|
|
|
@ -3,26 +3,26 @@ if not status_ok then
|
|||
return
|
||||
end
|
||||
|
||||
local filetype = {
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
python = "python3 -u",
|
||||
typescript = "deno run",
|
||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||
cpp = "g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
local rfile = {
|
||||
-- java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
-- python = "python3 -u",
|
||||
-- typescript = "deno run",
|
||||
-- rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
-- -- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||
-- cpp = "g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
-- scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
}
|
||||
|
||||
local data_exists, runscript = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
for _, code in pairs(runscript.coderunner) do
|
||||
table.insert(filetype, code)
|
||||
if runscript.coderunner ~= nil then
|
||||
end
|
||||
rfile = runscript.coderunner
|
||||
end
|
||||
|
||||
code_runner.setup({
|
||||
-- put here the commands by filetype
|
||||
filetype = filetype,
|
||||
filetype = rfile,
|
||||
-- mode = "term",
|
||||
mode = "float",
|
||||
focus = true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue