diff --git a/.config.d/.nl b/.config.d/.nl new file mode 100755 index 0000000..cea768b --- /dev/null +++ b/.config.d/.nl @@ -0,0 +1,2 @@ +./$1 +echo diff --git a/.config.d/color.sh b/.config.d/color.sh new file mode 100755 index 0000000..a6b08ed --- /dev/null +++ b/.config.d/color.sh @@ -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 diff --git a/Makefile b/Makefile index a60ff5b..9da09ef 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CXX = g++ -CXXFLAGS = -Wall -std=c++14 +CXXFLAGS = -g -Wall -std=c++14 all: $(patsubst %.cpp, %.out, $(wildcard *.cpp)) diff --git a/create.sh b/create.sh new file mode 100755 index 0000000..dcf1c38 --- /dev/null +++ b/create.sh @@ -0,0 +1,2 @@ +cp .config.d/template.cpp ${1%.*}.cpp +nvim -s .config.d/cursorpos ${1%.*}.cpp diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..1a7978f --- /dev/null +++ b/run.sh @@ -0,0 +1,4 @@ +make +echo "Compiled..." +./.config.d/color.sh .config.d/.nl ./"${1%.*}.out" +echo diff --git a/setup.sh b/setup.sh index 96350b1..81b7f05 100755 --- a/setup.sh +++ b/setup.sh @@ -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