From b41ed5be130a34b0b77d6c82f733b03ab091d9d6 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 26 Sep 2025 09:15:43 -0400 Subject: [PATCH] feat: provide default contest config --- lua/cp/config.lua | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/lua/cp/config.lua b/lua/cp/config.lua index 786d570..fe58369 100644 --- a/lua/cp/config.lua +++ b/lua/cp/config.lua @@ -68,27 +68,20 @@ local M = {} local constants = require('cp.constants') +local default_cpp_config = { + cpp = { + compile = { 'g++', '-std=c++17', '{source}', '-o', '{binary}' }, + debug = { 'g++', '-std=c++17', '-fsanitize=address,undefined', '{source}', '-o', '{binary}' }, + extension = 'cpp', + }, +} + ---@type cp.Config M.defaults = { contests = { - default = { - cpp = { - compile = { 'g++', '{source}', '-o', '{binary}', '-std=c++17' }, - test = { '{binary}' }, - debug = { - 'g++', - '{source}', - '-o', - '{binary}', - '-std=c++17', - '-g', - '-fsanitize=address,undefined', - }, - }, - python = { - test = { 'python3', '{source}' }, - }, - }, + codeforces = default_cpp_config, + atcoder = default_cpp_config, + cses = default_cpp_config, }, snippets = {}, hooks = {