diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 171a83c..dd414f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,4 +3,4 @@ repos: rev: v8.18.2 # usa una versión fija hooks: - id: gitleaks - args: ["detect", "--redact"] + args: ["detect", "--redact"] \ No newline at end of file diff --git a/README.md b/README.md index 6bbccd1..013ea4e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ===================================== ``` -My personal Linux/macOS configuration: **Zsh**, **Oh‑My‑Zsh**, terminal tweaks, git config, aliases… +My personal Linux/macOS configuration: **Zsh**, **Oh‑My‑Zsh**, terminal tweaks, git config, aliases… Everything clean, modular, and easy to install. ![Status](https://img.shields.io/badge/Status-Active-brightgreen) @@ -27,20 +27,29 @@ Everything clean, modular, and easy to install. ### 🐚 Zsh Setup - **Theme:** `agnoster` with custom right‑prompt -- Right prompt shows: - - ⚡ *root indicator* - - 💥 *exit code on failures* - - 🐍 *active Python virtualenv* -- Autosuggestions (`zsh-autosuggestions`) -- Syntax highlighting (`zsh-syntax-highlighting`) -- Command execution timer (⏱) -- Clean history settings +- Right prompt shows ⚡ (root), 💥 (exit status), and 🐍 (virtualenv) +- Autosuggestions (`zsh-autosuggestions`) & syntax highlighting (`zsh-syntax-highlighting`) +- Command execution timer (⏱) and tidy history defaults + +### ⌨️ Tmux Profile +- Prefix remapped to `Ctrl+A`, mouse mode, 50k scrollback +- Status bar with CPU/memory, host, date, and session/window info +- TPM + plugins: `sensible`, `resurrect`, `continuum`, `prefix-highlight`, `yank` +- Continuum auto-save/restore enabled out of the box +- **Install plugins:** clone [TPM](https://github.com/tmux-plugins/tpm) once via `git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm`, then inside tmux press `prefix` + `I` to fetch the declared plugins. + +### 💻 VS Code Settings +- User settings synced via symlink (`vscode/settings.json`) +- Auto-save, trimming, JetBrains Mono with ligatures, rulers at 88/120 +- Python defaults (pytest, basic type checking) and terminal profile tweaks +- **Fonts:** best experience with [JetBrains Mono](https://www.jetbrains.com/lp/mono/) or [Fira Code](https://github.com/tonsky/FiraCode); install one of them locally or VS Code will fall back to system defaults. +- **Extensions:** set icon theme assumes the [Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) extension is installed; install it (or change the setting) to avoid fallback warnings. ### 🎮 Extras - `proton-run` function for launching Windows games with persistent Proton prefixes ### 🧰 Git Configuration -Your repository includes an opinionated `.gitconfig` with: +This repo ships an opinionated `.gitconfig` with: - **diff-so-fancy** integration - Rich color configuration @@ -66,7 +75,18 @@ cd dotfiles ./install.sh ``` -The install script symlinks everything safely into `$HOME`. +The installer checks for `fzf`, symlinks all configs (Zsh, Git, tmux, etc.), and links VS Code settings after backing up any local copy. + +--- + +## 🔖 Versioning & Releases + +- Version number lives in the `VERSION` file and is managed by [bumpversion](https://github.com/c4urself/bump2version). +- Install the tool once (e.g. `pip install --user bump2version`). +- To cut a new release: + 1. Decide the part to bump (`patch`, `minor`, or `major`). + 2. Run `bumpversion ` which updates `VERSION`, commits, and tags using `.bumpversion.cfg`. + 3. Push everything: `git push && git push --tags`. --- @@ -85,29 +105,20 @@ The install script symlinks everything safely into `$HOME`. ``` dotfiles/ -├── .bumpversion.cfg -├── .github/ -│ └── workflows/ -│ └── secret-scan.yml -├── .gitignore -├── .pre-commit-config.yaml -├── README.md -├── VERSION ├── git/ -│ ├── gitconfig -│ └── gitconfig_qustodio (optional) +│ └── gitconfig +├── tmux/ +│ └── tmux.conf +├── vscode/ +│ └── settings.json +├── zsh/ +│ └── zshrc ├── install.sh -└── zsh/ - └── zshrc +└── README.md ``` --- -## 🛠️ TODO / Future Ideas -- Add tmux config - ---- - ## 🤝 Contributions While this is a personal setup, PRs with improvements are welcome. diff --git a/install.sh b/install.sh index fa73fa6..eac3e54 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,7 @@ set -euo pipefail # Always work from the directory where this script lives REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -link_optional_config() { +link_config() { local source_path="$1" local target_path="$2" local label="$3" @@ -19,20 +19,41 @@ link_optional_config() { fi } +install_vscode_config() { + local source="$REPO_DIR/vscode/settings.json" + local target="$HOME/.config/Code/User/settings.json" + + if [ ! -f "$source" ]; then + echo "⚪️ Skipping VS Code settings (source file missing)." + return + fi + + mkdir -p "$(dirname "$target")" + + if [ -e "$target" ] && [ ! -L "$target" ]; then + local backup="${target}.bak.$(date +%Y%m%d-%H%M%S)" + mv "$target" "$backup" + echo "💾 Existing VS Code settings moved to $backup" + fi + + ln -sf "$source" "$target" + echo "🔗 VS Code settings linked to $target" +} + if ! command -v fzf >/dev/null 2>&1; then echo "⚠️ Missing dependency: fzf" echo " Please install fzf (e.g., 'sudo pacman -S fzf') and re-run this script." exit 1 fi -echo "🔗 Linking zsh config…" -ln -sf "$REPO_DIR/zsh/zshrc" "$HOME/.zshrc" +link_config "$REPO_DIR/zsh/zshrc" "$HOME/.zshrc" "zsh config" +link_config "$REPO_DIR/git/gitconfig" "$HOME/.gitconfig" "main git config" +link_config "$REPO_DIR/tmux/tmux.conf" "$HOME/.tmux.conf" "tmux config" -echo "🔗 Linking main git config…" -ln -sf "$REPO_DIR/git/gitconfig" "$HOME/.gitconfig" +link_config "$REPO_DIR/git/gitconfig_qustodio" "$HOME/.gitconfig_qustodio" "Qustodio git config" +link_config "$REPO_DIR/git/gitconfig_local" "$HOME/.gitconfig_local" "local git config" +link_config "$REPO_DIR/git/gitignore_global" "$HOME/.gitignore_global" "global gitignore" -link_optional_config "$REPO_DIR/git/gitconfig_qustodio" "$HOME/.gitconfig_qustodio" "Qustodio git config" -link_optional_config "$REPO_DIR/git/gitconfig_local" "$HOME/.gitconfig_local" "local git config" -link_optional_config "$REPO_DIR/git/gitignore_global" "$HOME/.gitignore_global" "global gitignore" +install_vscode_config echo "✨ Done! Reload your shell or start a new terminal." diff --git a/tmux/tmux.conf b/tmux/tmux.conf new file mode 100644 index 0000000..873efc3 --- /dev/null +++ b/tmux/tmux.conf @@ -0,0 +1,55 @@ +set -g @byobu-enable "off" + +# Use Ctrl+A instead of Ctrl+B +set -g prefix C-a +unbind C-b +bind C-a send-prefix + +# Mouse support +set -g mouse on + +# Reload config +bind r source-file ~/.tmux.conf \; display-message "Config reloaded!" + +# Plugin manager setup + +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' +set -g @plugin 'tmux-plugins/tmux-continuum' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'tmux-plugins/tmux-yank' + +run '~/.tmux/plugins/tpm/tpm' + +# Status bar customization +set -g status on +set -g status-interval 5 + +set -g status-bg colour235 +set -g status-fg colour250 + +set-option -g status-left-length 40 +set-option -g status-right-length 120 +set -g status-left ' #[fg=colour250]#S #[fg=colour241]' +set-option -g status-right "#[fg=colour208]🖥️ #(top -bn1 | grep 'Cpu(s)' | awk '{print $2}' | cut -d'%' -f1)% #[fg=colour241]| #[fg=colour33]🧠 #(free | grep '^Mem' | awk '{printf \"%.1f%%\", $3/$2 * 100.0}') #[fg=colour241]| #[fg=colour244]%Y-%m-%d %H:%M #[fg=colour241]| #[fg=green]#H" + +# Dim, simple style for inactive windows +set -g window-status-format " #[fg=colour244]#I:#W " + +# Strong highlight for current window +set -g window-status-current-format " #[bg=colour34,fg=colour0,bold]#I:#W #[default]" + +# Start counting at 1 (nicer UX) +set -g base-index 1 +setw -g pane-base-index 1 +set -g renumber-windows on + +# Bigger scrollback +set -g history-limit 50000 + +# tmux-continuum: auto-save + auto-restore +set -g @continuum-restore 'on' +set -g @continuum-save-interval '15' # minutes + + diff --git a/vscode/settings.json b/vscode/settings.json new file mode 100644 index 0000000..0879c06 --- /dev/null +++ b/vscode/settings.json @@ -0,0 +1,112 @@ +{ + // ============================ + // ==== FILES & AUTO-SAVE ===== + // ============================ + + // Automatically save files after a short delay + "files.autoSave": "afterDelay", + // Delay before auto-saving (in milliseconds) + "files.autoSaveDelay": 1000, + // Remove trailing spaces on save + "files.trimTrailingWhitespace": true, + // Ensure files always end with a newline + "files.insertFinalNewline": true, + + + // ============================ + // ======== APPEARANCE ======== + // ============================ + + // Default dark theme (lightweight and clean) + "workbench.colorTheme": "Default Dark Modern", + // File icons (requires "Material Icon Theme" extension) + "workbench.iconTheme": "material-icon-theme", + // No zoom applied to UI/layout + "window.zoomLevel": 0, + + + // ============================ + // ========= EDITOR =========== + // ============================ + + // Use modern, thin and readable fonts for code + "editor.fontFamily": "JetBrains Mono, Fira Code, Menlo, Monaco, 'Courier New', monospace", + // Enable font ligatures (optional but nice) + "editor.fontLigatures": true, + // Comfortable size for a 3440x1440 monitor + "editor.fontSize": 14, + "editor.lineHeight": 22, + + // Python: always use 4 spaces, never tabs + "editor.tabSize": 4, + "editor.insertSpaces": true, + "editor.detectIndentation": false, + + // Avoid extremely long lines on ultrawide screens + "editor.wordWrap": "bounded", + // Maximum width before wrapping + "editor.wordWrapColumn": 120, + // Visual rulers for Python formatting (PEP8 & Ruff) + "editor.rulers": [88, 120], + + // Clean editor view + "editor.minimap.enabled": false, + "editor.renderWhitespace": "boundary", + "editor.cursorBlinking": "smooth", + "editor.smoothScrolling": true, + "editor.inlineSuggest.enabled": true, + + + // ============================ + // ========= PYTHON =========== + // ============================ + + // Lightweight type checking (not too strict) + "python.analysis.typeCheckingMode": "basic", + // Auto-complete imports + "python.analysis.autoImportCompletions": true, + + // Prefer pytest over unittest + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": ["tests"], + + // Auto-activate virtual environments in integrated terminal + "python.terminal.activateEnvironment": true, + + + // ============================ + // ========= DOCKER =========== + // ============================ + + // Enable Docker explorer sidebar (if extension installed) + "docker.showExplorer": true, + + + // ============================ + // ========= TERMINAL ========= + // ============================ + + // Default shell for Linux + "terminal.integrated.defaultProfile.linux": "bash", + // Slightly smaller terminal font size + "terminal.integrated.fontSize": 14, + + + // ============================ + // ============ GIT =========== + // ============================ + + // Auto-fetch remote changes + "git.autofetch": true, + // Do not ask for confirmation when syncing + "git.confirmSync": false, + + + // ============================ + // ========= COPILOT ========== + // ============================ + + // Keep your Copilot setting + "github.copilot.nextEditSuggestions.enabled": true +}