1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

install: adding scripts for formatters and LSPs

This commit is contained in:
Henrik Hautakoski 2024-05-18 15:25:20 +02:00
parent 0a1d26d1d9
commit 2a699e2cac
3 changed files with 46 additions and 0 deletions

31
install/nvim-formatters.sh Executable file
View file

@ -0,0 +1,31 @@
#!/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