1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 11:24:55 +02:00
dotfiles/install/nvim-formatters.sh

31 lines
694 B
Bash
Executable file

#!/bin/bash
if [ $# -lt 1 ]; then
echo "usage: $0 <formatter>"
exit 1
fi
SELECTED=$@
for sel in "${SELECTED[@]}"; do
case $sel in
"shfmt")
go install mvdan.cc/sh/v3/cmd/shfmt@latest
;;
"prettier")
sudo npm install -g prettier
;;
"stylua")
curl -sL https://github.com/JohnnyMorganz/StyLua/releases/download/v0.20.0/stylua-linux-x86_64.zip |
funzip |
sudo tee /usr/local/bin/stylua >/dev/null |
sudo chmod 755 /usr/local/bin/stylua
;;
"blade")
sudo npm install -g blade-formatter
;;
*)
echo "Unknown option: $sel"
exit 1
;;
esac
done