Skip to content

Instantly share code, notes, and snippets.

@CarloCattano
Last active July 4, 2023 09:43
Show Gist options
  • Save CarloCattano/bf81a3ca34c5a0de524d473347294162 to your computer and use it in GitHub Desktop.
Save CarloCattano/bf81a3ca34c5a0de524d473347294162 to your computer and use it in GitHub Desktop.
Install NvChad on School Computers

ACHTUNG! WORK IN PROGRESS, USE AT YOUR OWN RISK AND DON'T RUN THE SCRIPT IN COMMENTS

Install rust on school computer

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Download neovim binaries and add it to your PATH

wget https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz
  • Add it to your PATH, I choose to extract it in this location
export PATH=$HOME/.cargo/nvim-linux64/bin:$PATH

Download nodejs and npm and put it in your PATH

go to https://nodejs.org/en/download and Download the Linux Binaries (x64) We prepend instead of appeand to trick the system into using the newer node and npm not the school PC one. ( I know security risk but yeah....) add this to your ~/.zshrc (replace the path with yours)

export PATH="/absolute/path/to/nodejs/bin:$PATH"
export PATH="/absolute/path/to/nodejs/lib/node_modules/npm/bin:$PATH"

then source your zshrc

source ~/.zshrc 

Install NvChad

git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim

IN CASE you have already configs at ~/.config/nvim just remove them or make a backup and then remove them Run nvim , let it do its thing and close it For hints you can see the cheatsheet with leader(space) + c h

Install fonts (required for icons)

# from your extracted fonts folder
mv *.ttf ~/.fonts
  • Set whatever terminal to use that font , in alacritty for example:
# ~/.config/alacritty/alacritty.yml
font:
 normal:
  family: "UbuntuMonoNerdFontMono"

ripgrep (needed for Telescope)

  • if you installed rust successfully you should be able to :
  cargo install ripgrep
  • this is what my zshrc looks like after all this ride!
export PATH=$HOME/.local/bin/node-v18.12.1-linux-x64/bin:$PATH
export PATH=$PATH:$HOME/.cargo/bin
export PATH=$PATH:$HOME/.local/bin
# I just manually added nvim download to this folder
export PATH=$HOME/.cargo/nvim-linux64/bin:$PATH
@CarloCattano
Copy link
Author

CarloCattano commented Jun 27, 2023

Install script -
Remember to set your terminal font to JetBrains one or it wont show the icons
In settings of your ubuntu terminal manually ( profile) or alacritty in the config file for example

~/.config/alacritty/alacritty.yml
font:
 normal:
  family: "JetBrainsMono"
#!/bin/bash

echo "#Nv Chad Deps" >> ~/.zshrc 

# if $HOME/.config/nvim exists, make a backup and delete it 
if [ -d "$HOME/.config/nvim" ]; then
	echo "nvim folder exists, backing up and deleting"
	mv $HOME/.config/nvim $HOME/.config/old_nvim.bak
fi

echo "42 NvChad INSTALL"
sleep 1

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

wget https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz
tar -xzf nvim-linux64.tar.gz -C $HOME/.local/
rm nvim-linux64.tar.gz

wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz
tar -xJf node-v14.17.0-linux-x64.tar.xz -C $HOME/.local/
rm node-v14.17.0-linux-x64.tar.xz

echo "export PATH=\"$HOME/.local/nvim-linux64/bin:\$PATH\"" >> ~/.zshrc
echo "export PATH=\"$HOME/.local/node-v14.17.0-linux-x64/bin:\$PATH\"" >> ~/.zshrc
echo "export PATH=\"$HOME/.cargo/bin:\$PATH\"" >> ~/.zshrc
echo "export PATH=\"$HOME/.local/bin:\$PATH\"" >> ~/.zshrc

echo "#end of Nv Chad Deps" >> ~/.zshrc

source ~/.zshrc

wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/JetBrainsMono.zip
unzip JetBrainsMono.zip -d $HOME/.fonts/
fc-cache -rv
rm JetBrainsMono.zip
cd $HOME

#required by Telescope 
cargo install ripgrep

# Install NvChad
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 
source $HOME/.zshrc

echo "-----------"
echo "All done , redirecting to nvim for first install"
sleep 1
nvim 

echo "..................."
echo "         :::      ::::::::
       :+:      :+:    :+:
     +:+ +:+         +:+  
   +#+  +:+       +#+     
 +#+#+#+#+#+   +#+        
      #+#    #+#          
     ###   ########.fr"

echo "..................."

echo "42CHAD INSTALL DONE"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment