Source directory creating script for competitive programmers who are using c++ and neovim
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
RinRi eed20429d4 change README 3 年之前
.config.d create unchangable files and add -g flag 3 年之前
Makefile create unchangable files and add -g flag 3 年之前
README.md change README 3 年之前
create.sh create unchangable files and add -g flag 3 年之前
run.sh create unchangable files and add -g flag 3 年之前
setup.sh create unchangable files and add -g flag 3 年之前

README.md

Installation

Clone the repository and make setup.sh executable and run it:

git clone https://git.rinri-d.xyz/rinri/cpsrc.git
cd cpsrc
chmod +x setup.sh
./setup.sh

First, write a template which will be used to create new files. Enter the number of the starting line. That is it!

Usage

To create a new .cpp file, run create.sh with filename argument:

./create.sh 1234a

It will create 1234a.cpp and open neovim. Enter either type 1234a.cpp and 1234a.

To compile and run file, use run.sh with filename(or problem name) as an argument:

./run.sh 1234a.cpp

To compile faster, precompile needed header files in the directory.

# copy libraries
mkdir bits
cd bits
cp /usr/include/c++/10.2.0/x86_64-pc-linux-gnu/bits/stdc++.h .

# compile them and use the same c++ standard as in Makefile
g++ -g -std=c++14 stdc++.h

Don’t forget to use double quotes in the template. GCC uses the local precompiled library first. If there is no local library, it uses system’s one.

#include "bits/stdc++.h"
// "" instead of <>