-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtex
executable file
·25 lines (23 loc) · 985 Bytes
/
vtex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# script from https://debdeep777.blogspot.de/2015/01/vim-texlive-vim-latex-suite-zathura-pdf.html
#######################################################
# The file called vtex, make it better, make it recognize only tex files
# while pressing
for i in "$@"; do
if [[ ${i} == *.tex ]]; then
fileName=$i;
# Strip off path and extension, and convert to uppercase.
# although there is no need to turn into upper case
serverName=$(sed -e 's:\(.*/\)\?\(.*\)\.tex:\U\2\E:' <<< $i)
break;
fi
done
if [[ ${serverName} == '' ]]; then
echo 'not a tex file or no non-extension part, no server to create'
else
# run in server mode
# now we need to make sure the forward search connects to the right server
# check in .vimrc or tex.vim to see if it is correct
echo 'creating server called $serverName'
exec vim --servername $serverName "$@"
fi
#######################################################