Skip to content

Instantly share code, notes, and snippets.

@johanneshiry
Last active June 20, 2021 11:48
Show Gist options
  • Select an option

  • Save johanneshiry/864a293adf7c7ef9a78e18cd11f219bd to your computer and use it in GitHub Desktop.

Select an option

Save johanneshiry/864a293adf7c7ef9a78e18cd11f219bd to your computer and use it in GitHub Desktop.
Install SublimeText with LaTeX support + required fixes for additional packages
#!/bin/bash
# requires xcode installed + working incl. command line tools
# update perl version
brew install perl
# set xcode
sudo xcode-select --switch /Library/Developer/CommandLineTools
# install cpan packages
sudo cpan App::cpanminus
# re-install latexindent
sudo tlmgr option repository ctan
sudo tlmgr update --self
sudo tlmgr install latexindent
# fix missing dependencies
git clone https://github.com/cmhughes/latexindent.pl.git /tmp/latexindent && \
cd /tmp/latexindent/helper-scripts && \
sudo perl latexindent-module-installer.pl && \
rm -rf /tmp/
# further install missing packages
sudo cpan Mac::SystemDirectory
sudo cpan File::HomeDir
sudo cpan YAML::Tiny
sudo cpan Unicode::GCString
#!/bin/bash
# install homebrew if not available
if ! command -v brew &> /dev/null
then
printf "Installing Homebrew ...\n"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# install sublime text
brew install --cask sublime-text
# install skim
brew install --cask skim
# install mactex
brew install --cask mactex
# configure sublime text
INST_PACKAGES_PATH=$HOME/Library/Application\ Support/Sublime\ Text/Installed\ Packages
PACKAGES_PATH=$HOME/Library/Application\ Support/Sublime\ Text/Packages
## package control addon
(cd "$INST_PACKAGES_PATH" && curl -o "Package Control.sublime-package" https://packagecontrol.io/Package%20Control.sublime-package)
## LaTexTools addon
[ -d "$PACKAGES_PATH/LaTeXTools" ] && rm -rf "$PACKAGES_PATH/LaTeXTools"
(cd "$PACKAGES_PATH" && curl -OL https://github.com/SublimeText/LaTeXTools/archive/master.zip \
&& unzip master.zip \
&& mv LaTeXTools-master LaTeXTools \
&& rm master.zip)
# LaTeX-cwl addon (autcomplete)
[ -d "$PACKAGES_PATH/LaTeX-cwl" ] && rm -rf "$PACKAGES_PATH/LaTeX-cwl"
(cd "$PACKAGES_PATH" && git clone https://github.com/LaTeXing/LaTeX-cwl.git)
# BeautifyLatex addon
[ -d "$PACKAGES_PATH/BeautifyLatex" ] && rm -rf "$PACKAGES_PATH/BeautifyLatex"
(cd "$PACKAGES_PATH" && git clone https://github.com/flipphillips/BeautifyLatex.git)
# SideBarEnhancements addon
[ -d "$PACKAGES_PATH/SideBarEnhancements" ] && rm -rf "$PACKAGES_PATH/SideBarEnhancements"
(cd "$PACKAGES_PATH" && git clone https://github.com/titoBouzout/SideBarEnhancements.git)
# FixMacPath addon
[ -d "$PACKAGES_PATH/SublimeFixMacPath" ] && rm -rf "$PACKAGES_PATH/SublimeFixMacPath"
(cd "$PACKAGES_PATH" && git clone https://github.com/int3h/SublimeFixMacPath.git)
# smart quotes addon
[ -d "$PACKAGES_PATH/sublime-text-latex-smart-quotes" ] && rm -rf "$PACKAGES_PATH/sublime-text-latex-smart-quotes"
(cd "$PACKAGES_PATH" && git clone https://github.com/r-stein/sublime-text-latex-smart-quotes.git)
# bracket highlighter
[ -d "$PACKAGES_PATH/BracketHighlighter" ] && rm -rf "$PACKAGES_PATH/BracketHighlighter"
(cd "$PACKAGES_PATH" && git clone https://github.com/facelessuser/BracketHighlighter.git)
# non text files
[ -d "$PACKAGES_PATH/sublime-non-text-files" ] && rm -rf "$PACKAGES_PATH/sublime-non-text-files"
(cd "$PACKAGES_PATH" && git clone https://github.com/bordaigorl/sublime-non-text-files.git)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment