diff --git a/colors.sh b/colors.sh new file mode 100755 index 0000000..b29e75d --- /dev/null +++ b/colors.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# ------------- 16 STANDARD COLORS ------------- +reset='\e[0m' # everything off + +# normal intensity +black='\e[30m'; red='\e[31m'; green='\e[32m'; yellow='\e[33m' +blue='\e[34m'; purple='\e[35m'; cyan='\e[36m'; white='\e[37m' + +# background equivalents (40–47 and 100–107) +on_black='\e[40m'; on_red='\e[41m'; on_green='\e[42m'; on_yellow='\e[43m' +on_blue='\e[44m'; on_purple='\e[45m'; on_cyan='\e[46m'; on_white='\e[47m' + + +printf "%b\n" "${on_red}On red:${reset} watafa" +printf "%b\n" "${on_black}On black:${reset} watafa" +printf "%b\n" "${on_purple}On purple:${reset} ${purple}watafa" diff --git a/macos-first-install.sh b/macos-first-install.sh index 4c7e43d..3fc1853 100755 --- a/macos-first-install.sh +++ b/macos-first-install.sh @@ -22,6 +22,8 @@ echo "✅ Ohmyzsh installed, .zshrc created, zsh-autosuggestions installed" brew install z echo "✅ Z installed" +source ~/.zshrc + # Installing neovim and config brew install neovim mkdir -p ~/.config/nvim diff --git a/nvim-install.sh b/nvim-install.sh index 19ece02..1244a81 100755 --- a/nvim-install.sh +++ b/nvim-install.sh @@ -1,27 +1,61 @@ #!/bin/bash -# Step 1: Install Neovim using pacman -sudo pacman -Sy --noconfirm neovim +# Step 0. Detect the OS +if [[ "$OSTYPE" == "darwin"* ]]; then + OS="macos" +elif [[ -f /etc/os-release ]]; then + # shellcheck disable=SC1091 + . /etc/os-release + case "$ID" in + ubuntu|pop|linuxmint|zorin|elementary|kdeneon) + OS="ubuntu" + ;; + arch|manjaro|endeavouros|garuda|artix) + OS="arch" + ;; + *) + err "Unsupported Linux distribution: $ID" + exit 1 + ;; + esac +else + err "Cannot determine OS." + exit 1 +fi + +echo "🔎 Determined OS: $OS" + +# Step 1: Install Neovim +if [[$OS == "macos"]]; then + brew install neovim +elif [[$OS == "ubuntu"]]; then + sudo apt install neovim -y +elif [[$OS == "arch"]]; then + sudo pacman -Sy --noconfirm neovim +fi + echo "✅ Neovim installed" # Step 2: Create the Neovim config directory -mkdir -p ~/.config/nvim +CONFIG_DIR = ~/.config/nvim +CONFIG = $CONFIG_DIR/init.lua +mkdir -p $CONFIG_DIR # Step 3: Write your custom init.lua configuration -cat < ~/.config/nvim/init.lua +cat < $CONFIG vim.cmd("set expandtab") -vim.cmd("set tabstop=2") -vim.cmd("set softtabstop=2") -vim.cmd("set shiftwidth=2") +vim.cmd("set tabstop=4") +vim.cmd("set softtabstop=4") +vim.cmd("set shiftwidth=4") vim.cmd("set number relativenumber") vim.cmd("highlight Normal guibg=transparent") vim.opt.clipboard = "unnamedplus" +-- Clipboard alternative fix +vim.g.mapleader = " " +vim.keymap.set({"n", "v"}, "y", "\"+y") +vim.keymap.set({"n", "v"}, "p", "\"+p") EOF -echo "✅ Config written (~/.config/nvim/init.lua)" - -# Step 4: Install clipboard manager -sudo pacman -S wl-clipboard -echo "✅ Clipboard manager installed" +echo "✅ Config written ($CONFIG)" # Step 4: Notify user of success -echo "All done! You can now open Neovim with 'nvim' command" +echo "All done! You can now open Neovim with the 'nvim' command"