Update install-nvchad.sh

This commit is contained in:
Ninjdai 2024-03-20 16:21:55 +01:00
parent c2dc38eb0b
commit 10577951d8

View File

@ -4,6 +4,8 @@ NO_FORMAT="\033[0m"
C_RED="\033[38;5;9m" C_RED="\033[38;5;9m"
C_LIME="\033[38;5;10m" C_LIME="\033[38;5;10m"
NVIM_CONFIG=$HOME/.config/nvim/
function main () function main ()
{ {
if [ "$EUID" -eq 0 ] if [ "$EUID" -eq 0 ]
@ -18,6 +20,8 @@ function main ()
check_and_install_nvchad check_and_install_nvchad
customize_nvim
cleanup cleanup
echo -e "${C_LIME}Script has finished running ! Please run source ~/.bashrc or reopen your terminal !${NO_FORMAT}" echo -e "${C_LIME}Script has finished running ! Please run source ~/.bashrc or reopen your terminal !${NO_FORMAT}"
@ -86,7 +90,6 @@ check_and_install_nerdfont ()
check_and_install_nvchad () check_and_install_nvchad ()
{ {
NVIM_CONFIG=$HOME/.config/nvim/
if [ -d "$NVIM_CONFIG" ]; then if [ -d "$NVIM_CONFIG" ]; then
echo "$NVIM_CONFIG already exists, skipping installation..." echo "$NVIM_CONFIG already exists, skipping installation..."
else else
@ -100,6 +103,16 @@ check_and_install_nvchad ()
fi fi
} }
customize_nvim ()
{
if [ -f /tmp/nvchad-installer/JetBrainsMono.zip ]; then
echo "Looks like Neovim is already customized, skipping customization"
else
echo MASON_CONFIG > $NVIM_CONFIG/lua/plugins/custom.lua
echo -e "${C_LIME}Neovim is now customizes !${NO_FORMAT}"
fi
}
cleanup () cleanup ()
{ {
[ -f /tmp/nvchad-installer/JetBrainsMono.zip ] && { [ -f /tmp/nvchad-installer/JetBrainsMono.zip ] && {
@ -108,4 +121,19 @@ cleanup ()
} }
} }
MASON_CONFIG = 'return {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"lua-language-server", "stylua",
"html-lsp", "css-lsp" , "prettier",
"clangd", "clang-format"
},
},
},
}'
main main