[AUTOCONFIG] Add neovim autoconfig from .env
This commit is contained in:
parent
6e0b581da6
commit
93675f81a9
5 changed files with 79 additions and 129 deletions
22
scripts/common.sh
Executable file
22
scripts/common.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
command_exists () {
|
||||
type "$1" &> /dev/null
|
||||
}
|
||||
|
||||
install_package () {
|
||||
if [[ "$PM" == 'pacman' ]]; then
|
||||
sudo pacman -S --noconfirm "$@"
|
||||
echo "[INFO] Finished to install $@"
|
||||
else
|
||||
echo '[ERROR] Package manager not supported' >&2
|
||||
fi
|
||||
}
|
||||
|
||||
remove_package () {
|
||||
if [[ "$PM" == 'pacman' ]]; then
|
||||
sudo pacman -R --noconfirm "$@"
|
||||
echo "[INFO] Finished to remove $@"
|
||||
else
|
||||
echo '[ERROR] Package manager not supported' >&2
|
||||
fi
|
||||
}
|
21
scripts/tools/neovim/install.sh
Executable file
21
scripts/tools/neovim/install.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
source ./scripts/common.sh
|
||||
|
||||
if [[ "$WITH_NEOVIM" == 'yes' ]]; then
|
||||
if ! command_exists nvim; then
|
||||
install_package neovim
|
||||
echo '[INFO] Neovim installed'
|
||||
else
|
||||
echo '[INFO] Neovim already installed'
|
||||
fi
|
||||
|
||||
if [[ ! -d "$HOME/.config/nvim" ]]; then
|
||||
ln -s "$CWD/configs/nvim" "$HOME/.config/nvim"
|
||||
echo "[INFO] Neovim config linked with symbolic link : $CWD/configs/nvim -> $HOME/.config/nvim"
|
||||
|
||||
install_package ripgrep fd dart lazygit rust-analyzer lldb
|
||||
else
|
||||
echo '[INFO] Neovim config already linked'
|
||||
fi
|
||||
else
|
||||
echo '[INFO] WITH_NEOVIM not equals to yes. Ignoring...'
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue