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.

README.md 1.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Installation
  2. Clone the repository and make setup.sh executable and run it:
  3. ```shell
  4. git clone https://git.rinri-d.xyz/rinri/cpsrc.git
  5. cd cpsrc
  6. chmod +x setup.sh
  7. ./setup.sh
  8. ```
  9. First, write a template which will be used to create new files. Enter the number of the starting line. That is it!
  10. # Usage
  11. To create a new .cpp file, run create.sh with filename argument:
  12. ```shell
  13. ./create.sh 1234a
  14. ```
  15. It will create 1234a.cpp and open neovim. Enter either type 1234a.cpp and 1234a.
  16. To compile and run file, use run.sh with filename(or problem name) as an argument:
  17. ```shell
  18. ./run.sh 1234a.cpp
  19. ```
  20. To compile faster, precompile needed header files in the directory.
  21. ```shell
  22. # copy libraries
  23. mkdir bits
  24. cd bits
  25. cp /usr/include/c++/10.2.0/x86_64-pc-linux-gnu/bits/stdc++.h .
  26. # compile them and use the same c++ standard as in Makefile
  27. g++ -g -std=c++14 stdc++.h
  28. ```
  29. 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.
  30. ```c++
  31. #include "bits/stdc++.h"
  32. // "" instead of <>
  33. ```