Created
August 28, 2021 09:24
-
-
Save haile01/6a3660128d2b0a9f5b27782c9c98d7ec to your computer and use it in GitHub Desktop.
Another bash script for terminal + cp enthusiasts. It setups a tmux window with 4 panes as provided configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run cp-tmux.sh <problem-name> | |
# cpp.sh script is here https://gist.github.com/pythagore1123/0962c6f018b153b9697372219d455f68 | |
# The 4 panes of tmux is config as below: | |
# ---------------------------------------- | |
# | | | |
# | .cpp editor | | |
# | | | |
# |--------------------------------------- | |
# | runner | .inp editor | | |
# | + |-------------------| | |
# | compile output | Output watcher | | |
# ---------------------------------------- | |
#!/bin/bash | |
/usr/lib/cpp.sh --prepare $1; | |
path=$(pwd); | |
tmux kill-session -t cp; | |
tmux new-session -d -s cp; | |
tmux splitw -v -t cp:0.0; | |
tmux splitw -h -t cp:0.1; | |
tmux splitw -v -t cp:0.2; | |
tmux send -t cp:0.0 "vim \"$path/$1.cpp\"" ENTER; | |
tmux send -t cp:0.1 "cd \"$path\" && cpp $1" ENTER; | |
tmux send -t cp:0.2 "vim \"$path/$1.inp\"" ENTER; | |
tmux send -t cp:0.3 "tail -vf \"$path/$1.out\"" ENTER; | |
tmux a -t cp; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment