So, I wrote next bash script:
#!/bin/bash
if [ "$#" -gt 1 ]; then
path=$1
else
path=$(cat subject.txt | tr -d '\n')
fi
nvim -p 1 "setup/$path/body.tex" -p 1 preamble/preamble.tex -p 1 -O 1 homework.tex -o 1 setup.tex variables/variables.tex
By the
nvim -p 1 "setup/$path/body.tex" -p 1 preamble/preamble.tex -p 1 -O 1 homework.tex -o 1 setup.tex variables/variables.tex
I mean:
-p 1
- create one tab and open"setup/$path/body.tex"
int it (so that tab is taken), then do-p 1
- openpreamble/preamble.tex
in second tab so second tab is also taken, then do-p 1 -O 1
- create third tab and vertically divide it into two windows, in first vertical window we should openhomework.tex
then divide second window horizontally and in first half of second vertical window we should opensetup.tex
and in the second half of second vertical window we should openvariables/variables.tex
.
So, as a result of these simple operations we should have the next:
But, instead I get:
How to open files from terminal in desired pattern?