myhome/.config/nvim/installer.sh

88 lines
2.0 KiB
Bash
Raw Normal View History

2022-04-20 20:58:25 +02:00
#!/bin/bash
2022-07-18 21:08:52 +02:00
function timestamp() {
echo "[+] $(date +'%F %T') [INFO] $*"
}
function err() {
echo "[-] $(date +'%F %T') [ERROR] $*" >&2
}
function command_start() {
timestamp "Command $* has been started."
if ! "$*"; then
err "Command $* went wrong."
fi
timestamp "Command $* has been ended."
}
function update_pip() {
python3 -m pip install --upgrade pip --user
}
function install_neovim_module_for_python() {
pip3 install neovim --pre --user --force
}
2022-07-18 21:08:52 +02:00
function install_pyright() {
# Install pyright
sudo npm -g i pyright --force
}
function install_bash-language-server() {
# Install bash-language-server
sudo npm -g i bash-language-server --force
}
function install_yaml-language-server() {
# Install yaml-language-server
sudo npm -g i yaml-language-server --force
}
function install_shfmt() {
# Install shfmt
GO111MODULE=on go install mvdan.cc/sh/v3/cmd/shfmt@latest
}
function install_shellcheck() {
# Install shellcheck
[[ "$(uname)" == "Darwin" ]] && brew install shellcheck
2022-11-08 15:02:14 +01:00
sudo emerge shellcheck-bin
}
2022-07-18 21:08:52 +02:00
function install_gopls() {
# Install gopls
GO111MODULE=on go install golang.org/x/tools/gopls@latest
}
function install_black() {
# Install black
pip install black --pre --user --force
pip3 install black --pre --user --force
}
function install_ansible() {
2022-11-08 15:02:14 +01:00
pip3 install --pre --user ansible ansible-lint ansible-core --force
2022-07-18 21:08:52 +02:00
}
2022-10-09 20:46:39 +02:00
function install_ansible-language-server() {
# Install ansible-language-server
sudo npm -g i @ansible/ansible-language-server --force
sudo npm -g i yaml-language-server --force
}
2022-07-18 21:08:52 +02:00
function main() {
command_start update_pip
2022-07-18 21:08:52 +02:00
command_start install_pyright
command_start install_bash-language-server
command_start install_yaml-language-server
command_start install_ansible-language-server
command_start install_shfmt
command_start install_shellcheck
2022-07-18 21:08:52 +02:00
command_start install_gopls
command_start install_black
command_start install_ansible
2022-07-18 21:08:52 +02:00
}
main