forked from keflavich/macvim-skim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
macvim-skim-install.sh
executable file
·56 lines (50 loc) · 1.89 KB
/
macvim-skim-install.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# set install path
if [ ! $PREFIX ];
then
PREFIX=$HOME
fi
if [ ! $VIMDIR ];
then
VIMDIR=$HOME/.vim/
fi
# get relevant scripts
# echo "Getting macvim-load-line from googlecode repository"
# curl -s http://agpy.googlecode.com/svn/trunk/macvim-skim/macvim-load-line > ${PREFIX}/macvim-load-line
# chmod +x ${PREFIX}/macvim-load-line
# echo "Getting WhichTab.vim from googlecode repository"
# curl -s http://agpy.googlecode.com/svn/trunk/macvim-skim/WhichTab.vim > ${VIMDIR}/plugin/WhichTab.vim
chmod +x macvim-skim/macvim-load-line
cp macvim-skim/macvim-load-line $PREFIX/bin/
cp plugin/WhichTab.vim $VIMDIR/plugin/
if [ ! $SKIMPATH ];
then
SKIMPATH=/Applications/Skim.app
fi
if [ ! -d $SKIMPATH ]
then
# get Skim.app
# should work, but doesn't curl -L http://sourceforge.net/projects/skim-app/files/latest/download?source=files -o Skim.dmg
echo "Did not find $SKIMPATH. Downloading and installing latest skim."
curl -L "http://downloads.sourceforge.net/project/skim-app/Skim/Skim-1.4.1/Skim-1.4.1.dmg?use_mirror=autoselect" -o Skim.dmg
#curl -L "http://sourceforge.net/projects/skim-app/files/latest/download?source=files" -o Skim.dmg
hdid Skim.dmg
cp -r /Volumes/Skim/Skim.app $SKIMPATH
hdiutil eject /Volumes/Skim
fi
# Add lines to ~/.vim/ftplugin/tex.vim
if [ -e $VIMDIR/ftplugin/tex.vim ];
then
if [[ `grep 'map ,[rvpmt]' ${VIMDIR}/ftplugin/tex.vim` == "" ]];
then
echo "Found a tex.vim in ${VIMDIR}/ftplugin/. Appending to it."
cat ftplugin/tex.vim >> $VIMDIR/ftplugin/tex.vim
else
echo "Found a tex.vim in ${VIMDIR}/ftplugin/, and the Skim bindings appear to already be installed"
fi
else
cp ftplugin/tex.vim $VIMDIR/ftplugin/tex.vim
fi
# set Skim settings
defaults write net.sourceforge.skim-app.skim SKTeXEditorCommand "macvim-load-line"
defaults write net.sourceforge.skim-app.skim SKTeXEditorArguments "'\"%file\" %line'"