From 6a86ee71b635d7db9cd1c46ccc93dce80209af9e Mon Sep 17 00:00:00 2001 From: subcrip Date: Mon, 6 May 2024 18:05:07 +0800 Subject: [PATCH] backup --- .nvim.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .nvim.lua diff --git a/.nvim.lua b/.nvim.lua new file mode 100644 index 0000000..d406061 --- /dev/null +++ b/.nvim.lua @@ -0,0 +1,25 @@ +vim.api.nvim_create_autocmd("FileType", { + pattern = "cpp", + callback = function() + vim.api.nvim_buf_set_keymap(0, 'n', "b", '10spte ctext -i $(gcc -xc++ /dev/null -E -Wp,-v 2>&1 | sed -n "s,^ ,,p" | tr "\\n" ",") < % > ctext_out.cc && clang++ -std=c++17 -DONLINE_JUDGE -Wl,-z,stack-size=268435456 -Wall -Ofast -g -fsanitize=address -fsanitize=undefined ctext_out.cc && ./a.out < std.ini', { + silent = true, + noremap = true + }) + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = "python", + callback = function() + vim.api.nvim_buf_set_keymap(0, 'n', "b", "10spte python3 %i", { + silent = true, + noremap = true + }) + end, +}) + +vim.keymap.set('n', 'y', '!ctext -i $(gcc -xc++ /dev/null -E -Wp,-v 2>&1 | sed -n "s,^ ,,p" | tr "\\n" ",") < % > ctext_out.ccsplit ctext_out.cc:%%y+q') +vim.keymap.set('n', '1', 'CphReceive'); +vim.keymap.set('n', '2', 'CphTest'); +vim.keymap.set('n', '3', 'r ~/RustIsBestLang/src/bin/template.ccG'); +vim.keymap.set('n', 'l', '40vs std.in')