commit 0380d16266ed81294686f46c18023c5929dbc063 Author: Bryan Ramos Date: Mon Mar 9 17:57:22 2026 -0400 initial diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..be1e34f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "nvim"] + path = nvim + url = https://github.com/itme-brain/nvim.git +[submodule "vim"] + path = vim + url = https://github.com/itme-brain/vim.git +[submodule "git"] + path = git + url = https://github.com/itme-brain/git.git diff --git a/README.md b/README.md new file mode 100644 index 0000000..25dcafe --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# My Dotfiles + +My portable configs — clone everything or just what you need. + +## Quick Install + +```bash +bash <(curl -s https://raw.githubusercontent.com/itme-brain/dotfiles/main/install.sh) +``` + +Interactive menu lets you pick which configs to install. Each one is cloned as its own repo — no dependency on this dotfiles repo. + +## Configs + +| Config | Repo | Location | What it is | +|--------|------|----------|------------| +| **git** | [itme-brain/git](https://github.com/itme-brain/git) | `~/.config/git` | My global git config and ignores | +| **vim** | [itme-brain/vim](https://github.com/itme-brain/vim) | `~/.vim` | Lightweight vim for servers and quick edits. Plugins auto-install on first run | +| **nvim** | [itme-brain/nvim](https://github.com/itme-brain/nvim) | `~/.config/nvim` | Full IDE setup with LSP, treesitter, telescope | + +## Install one at a time + +```bash +git clone git@github.com:itme-brain/git.git ~/.config/git +git clone git@github.com:itme-brain/vim.git ~/.vim +git clone git@github.com:itme-brain/nvim.git ~/.config/nvim +``` + +## Updating + +Each config is its own repo. Just pull: + +```bash +cd ~/.vim && git pull +cd ~/.config/nvim && git pull +cd ~/.config/git && git pull +``` + +## Requirements + +`git` and `curl` diff --git a/git b/git new file mode 160000 index 0000000..b20a21f --- /dev/null +++ b/git @@ -0,0 +1 @@ +Subproject commit b20a21f87988793b2601ec9053871fcd47bdbb99 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..eb46a39 --- /dev/null +++ b/install.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +set -e + +REPO_BASE="git@github.com:itme-brain" + +names=("git" "vim" "nvim") +repos=("$REPO_BASE/git.git" "$REPO_BASE/vim.git" "$REPO_BASE/nvim.git") +targets=("$HOME/.config/git" "$HOME/.vim" "$HOME/.config/nvim") +selected=() + +for i in "${!names[@]}"; do + selected+=("false") +done + +install_config() { + local repo="$1" + local dest="$2" + + if [ -e "$dest" ]; then + echo " Backing up existing: $dest -> ${dest}.bak" + mv "$dest" "${dest}.bak" + fi + + mkdir -p "$(dirname "$dest")" + if ! git clone -q "$repo" "$dest" 2>&1; then + echo " Failed to clone $repo" + return 1 + fi +} + +draw_menu() { + local cursor="$1" + + if [ "$2" = "redraw" ]; then + for _ in "${names[@]}"; do + printf "\033[A" + done + printf "\033[A" + fi + + echo " (↑/↓ navigate, space toggle, enter confirm)" + for i in "${!names[@]}"; do + local marker=" " + if [ "${selected[$i]}" = "true" ]; then + marker="x" + fi + + if [ "$i" -eq "$cursor" ]; then + printf " \033[1m> [%s] %s\033[0m -> %s\n" "$marker" "${names[$i]}" "${targets[$i]}" + else + printf " [%s] %s -> %s\n" "$marker" "${names[$i]}" "${targets[$i]}" + fi + done +} + +echo "Select configs to install:" + +cursor=0 +draw_menu $cursor "first" + +while true; do + IFS= read -rsn1 key + + if [ "$key" = $'\x1b' ]; then + read -rsn2 rest + key="${key}${rest}" + fi + + case "$key" in + $'\x1b[A' | k) + if [ $cursor -gt 0 ]; then + cursor=$((cursor - 1)) + fi + ;; + $'\x1b[B' | j) + if [ $cursor -lt $((${#names[@]} - 1)) ]; then + cursor=$((cursor + 1)) + fi + ;; + " ") + if [ "${selected[$cursor]}" = "true" ]; then + selected[$cursor]="false" + else + selected[$cursor]="true" + fi + ;; + "") + break + ;; + esac + + draw_menu $cursor "redraw" +done + +echo "" + +any_selected=false +for i in "${!names[@]}"; do + if [ "${selected[$i]}" = "true" ]; then + any_selected=true + echo "Installing ${names[$i]}..." + install_config "${repos[$i]}" "${targets[$i]}" + echo "" + fi +done + +if [ "$any_selected" = "false" ]; then + echo "Nothing selected." +fi + +echo "Done." diff --git a/nvim b/nvim new file mode 160000 index 0000000..5c22497 --- /dev/null +++ b/nvim @@ -0,0 +1 @@ +Subproject commit 5c224976d84f72ef3468a6685590a3e50671de05 diff --git a/vim b/vim new file mode 160000 index 0000000..64b4c54 --- /dev/null +++ b/vim @@ -0,0 +1 @@ +Subproject commit 64b4c545481b593d2859bfb3e1c10cd91742213f