Browse Source

create unchangable files and add -g flag

master
RinRi 3 years ago
parent
commit
8382d3ab2e
6 changed files with 16 additions and 15 deletions
  1. +2
    -0
      .config.d/.nl
  2. +7
    -0
      .config.d/color.sh
  3. +1
    -1
      Makefile
  4. +2
    -0
      create.sh
  5. +4
    -0
      run.sh
  6. +0
    -14
      setup.sh

+ 2
- 0
.config.d/.nl View File

@@ -0,0 +1,2 @@
./$1
echo

+ 7
- 0
.config.d/color.sh View File

@@ -0,0 +1,7 @@
echo -en "" ## red
eval $* | while read line; do
echo -en "" ## blue
echo $line
echo -en "" ## red
done
echo -en "" ## reset color

+ 1
- 1
Makefile View File

@@ -1,5 +1,5 @@
CXX = g++
CXXFLAGS = -Wall -std=c++14
CXXFLAGS = -g -Wall -std=c++14

all: $(patsubst %.cpp, %.out, $(wildcard *.cpp))



+ 2
- 0
create.sh View File

@@ -0,0 +1,2 @@
cp .config.d/template.cpp ${1%.*}.cpp
nvim -s .config.d/cursorpos ${1%.*}.cpp

+ 4
- 0
run.sh View File

@@ -0,0 +1,4 @@
make
echo "Compiled..."
./.config.d/color.sh .config.d/.nl ./"${1%.*}.out"
echo

+ 0
- 14
setup.sh View File

@@ -1,8 +1,3 @@
mkdir .config.d

# create.sh
echo $'cp .config.d/template.cpp ${1%.*}.cpp\nnvim -s .config.d/cursorpos ${1%.*}.cpp' > create.sh

# template
read -n 1 -r -s -p $'Press any key to create template file...\n'
nvim .config.d/template.cpp
@@ -12,15 +7,6 @@ read -p $'Enter starting line of cursor:\n' line
((line=line-1))
echo "$line"gg > .config.d/cursorpos

# color.sh
echo $'echo -en "\033[31m" ## red\neval $* | while read line; do\necho -en "\033[36m" ## blue\necho $line\necho -en "\033[31m" ## red\ndone\necho -en "\033[0m" ## reset color' > .config.d/color.sh

# run.sh
echo $'make\necho "Compiled..."\n./.config.d/color.sh .config.d/.nl ./"${1%.*}.out"\necho' > run.sh

# .nl
echo $'./$1\necho' > .config.d/.nl

# make all executable
chmod +x create.sh
chmod +x run.sh


Loading…
Cancel
Save