mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
add: update config v2.1.0
This commit is contained in:
parent
63de9b2074
commit
90a34ec6e9
41 changed files with 2492 additions and 1287 deletions
58
lua/plugins/coderunner.lua
Normal file
58
lua/plugins/coderunner.lua
Normal file
|
@ -0,0 +1,58 @@
|
|||
local rfile = {
|
||||
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
|
||||
python = "python3 -u",
|
||||
--typescript = "deno run",
|
||||
typescript = "ts-node $dir/$fileName", -- npm install -g ts-node
|
||||
rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt",
|
||||
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
|
||||
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
|
||||
scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css",
|
||||
javascript = 'node "$dir/$fileName"',
|
||||
}
|
||||
|
||||
local data_exists, runscript = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
if runscript.coderunner ~= nil then
|
||||
rfile = vim.tbl_deep_extend("force", runscript.coderunner, rfile)
|
||||
end
|
||||
end
|
||||
return {
|
||||
"CRAG666/code_runner.nvim",
|
||||
lazy = true,
|
||||
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
|
||||
opts = {
|
||||
-- put here the commands by filetype
|
||||
filetype = rfile,
|
||||
-- mode = "term",
|
||||
mode = "float",
|
||||
focus = true,
|
||||
startinsert = true,
|
||||
term = {
|
||||
--position = "vert",
|
||||
position = "bot",
|
||||
size = 50,
|
||||
},
|
||||
float = {
|
||||
-- Key that close the code_runner floating window
|
||||
close_key = "<ESC>",
|
||||
-- Window border (see ':h nvim_open_win')
|
||||
border = "rounded",
|
||||
|
||||
-- Num from `0 - 1` for measurements
|
||||
height = 0.8,
|
||||
width = 0.8,
|
||||
x = 0.5,
|
||||
y = 0.5,
|
||||
|
||||
-- Highlight group for floating window/border (see ':h winhl')
|
||||
border_hl = "FloatBorder",
|
||||
float_hl = "Normal",
|
||||
|
||||
-- Transparency (see ':h winblend')
|
||||
blend = 0,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("code_runner").setup(opts)
|
||||
end,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue