This commit is contained in:
Zelong Kuang
2025-10-14 19:48:29 +11:00
parent a69e7f58ce
commit 53ec7e10b1
9 changed files with 28 additions and 17 deletions

View File

@@ -0,0 +1,69 @@
return {
{
"CRAG666/code_runner.nvim",
ft = { "lua", "python", "c", "cpp" },
dependencies = { "nvim-lua/plenary.nvim" },
keys = {
{ "<leader>rr", "<cmd>RunCode<cr>", desc = "Run Code" },
-- { "<leader>rf", "<cmd>RunFile<cr>", desc = "Run File" },
-- { "<leader>rp", "<cmd>RunProject<cr>", desc = "Run Project" },
{ "<leader>rd", "<cmd>RunClose<cr>", desc = "Run Close" },
},
opts = {
-- choose default mode (valid term, tab, float, toggle, buf)
mode = "term",
-- Focus on runner window(only works on toggle, term and tab mode)
focus = false,
-- startinsert (see ':h inserting-ex')
startinsert = false,
term = {
-- Position to open the terminal, this option is ignored if mode is tab
position = "bot",
-- window size, this option is ignored if tab is true
size = 8,
},
float = {
-- Key that close the code_runner floating window
close_key = "<ESC>",
-- Window border (see ':h nvim_open_win')
border = "none",
-- 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,
},
filetype_path = "", -- No default path defined
filetype = {
javascript = "node",
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
c = "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt",
python = "python -u",
sh = "bash",
rust = "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
r = "cd $dir && R < $filename --no-save",
typst = "cd $dir && typst compile $fileName",
},
project_path = "", -- No default path defined
project = {},
},
-- config = {
-- filetype = {
-- python = "python3 -u",
-- },
-- mode = "term",
-- float = {
-- close_key = "q",
-- },
-- },
},
}

View File

@@ -0,0 +1,28 @@
return {
{
"xeluxee/competitest.nvim",
dependencies = "MunifTanjim/nui.nvim",
lazy = false,
keys = {
{ "<localleader>rt", "<cmd>CompetiTest receive testcases<CR>", "Receive testcases" },
{ "<localleader>rp", "<cmd>CompetiTest receive problem<CR>", "Receive problem" },
{ "<localleader>rc", "<cmd>CompetiTest receive contest<CR>", "Receive contest" },
{ "<localleader>c", "<cmd>CompetiTest run<CR>", "Run code" },
},
config = function()
require("competitest").setup({
received_problems_path = "$(HOME)/compcode/$(JUDGE)/$(CONTEST)/$(PROBLEM).$(FEXT)c",
received_contests_directory = "$(HOME)/compcode/$(JUDGE)/$(CONTEST)",
template_file = {
cpp = "~/compcode/templates/template.cpp",
},
compile_command = {
cpp = { exec = "clang++", args = { "$(FNAME)", "-o", "$(FNOEXT)", "-lm" } },
},
run_command = {
cpp = { exec = "./$(FNOEXT)" },
},
})
end,
},
}

View File

@@ -0,0 +1,38 @@
return {
-- {
-- "kawre/leetcode.nvim",
-- build = ":TSUpdate html",
-- dependencies = {
-- "nvim-telescope/telescope.nvim",
-- "nvim-lua/plenary.nvim", -- required by telescope
-- "MunifTanjim/nui.nvim",
--
-- -- optional
-- "nvim-treesitter/nvim-treesitter",
-- "rcarriga/nvim-notify",
-- "nvim-tree/nvim-web-devicons",
-- },
-- lazy = false,
-- keys = {
-- { "<localleader>kt", "<cmd>Leet test<CR>", desc = "Leet test" },
-- { "<localleader>ks", "<cmd>Leet submit<CR>", desc = "Leet submit" },
-- { "<localleader>kl", "<cmd>Leet lang<CR>", desc = "Leet lang" },
-- { "<localleader>kp", "<cmd>Leet list<CR>", desc = "List problem" },
-- },
-- opts = {
-- -- configuration goes here
-- ---@type string
-- arg = "leetcode.nvim",
--
-- ---@type lc.lang
-- lang = "cpp",
-- ---@type lc.storage
-- storage = {
-- home = vim.fn.stdpath("data") .. "/leetcode",
-- cache = vim.fn.stdpath("cache") .. "/leetcode",
-- },
-- ---@type boolean
-- logging = false,
-- },
-- },
}