- Competitive Programming whitout mouse operations.
- Smoothly execute testcases.
- Initialize files with cursor jumps.
- Customizable.
❗❗❗make sure voldikss/vim-floaterm is working❗❗❗
packer.nvim:use 'voldikss/vim-floaterm'
- packer.nvim:
use 'eash-d/CPHelper.nvim'
- init.lua:
require("CPHelper").setup({
result_path = "~/result", -- !!! change to your path
init_file_path = "~/cp/template/init.cpp", -- !!! change to your path
cpp_std = "c++17", -- !!! change to your c++ version
})
`:ExecuteCpp` --> run testcases with cpp.
`:InitFile` --> import your template.
For those two command, you can key map them. Personally, in keymap.lua:
vim.keymap.set("n", "<CR>", ":ExecuteCpp<CR>", {remap=True})
vim.keymap.set("n", "<BS>", ":InitFile<CR>", {remap=True})
As my habit, I can press "Enter"(<CR>) to run testcase, and press "Backspace"(<BS>) to import my template code.
require("CPHelper").setup({
compile_info = "'Compile Passed !'",
separator = "'1i --------'",
result_path = "~/result",
init_file_path = "~/cp/template/init.cpp",
ft_height = "0.999",
ft_width = "0.4",
ft_position = "right",
cpp_std = "c++17",
cursor_row = 0,
cursor_col = 0,
})
require("CPHelper").setup({
compile_info = "'Compile Passed !'",
separator = "'1i --------'",
})
require("CPHelper").setup({
compile_info = "'Thank you !'",
separator = "'1i ++++++++'",
})
Save result of your procedure in `~/path/to/save/result` for display.
Make sure you have PERMISSION to accsee the path.
An example which the content in result:
Refer to floatrem options
Compile options `-std=c++17`.
Path to your initial template.
When you import your initial template, the POSITION of cursor. When you had a really LONG head, that's useful.
`cursor_row = 5`: when you initialize file, CURSOR will be in 5th row.
- Video Tutorial
- More language support