# Efficient Setup of i3, TMUX, and Vim on Debian 12

This guide provides a streamlined approach to setting up a keyboard-centric development environment on Debian 12 (Bookworm) using i3 window manager, TMUX, and Vim. It's designed for experienced Linux users who value productivity and minimalism.

**Disclaimer:** Package names and availability may vary. Always verify package names with `apt search <package>` and check official documentation before installation.

## System Preparation

**Update and Install Core Packages:**

```bash
sudo apt update && sudo apt upgrade -y
sudo apt install git curl build-essential i3 tmux vim -y
```

## Core Environment Setup

### i3 Window Manager

1. **Installation and First Run:**
   - After installation, log out of your current session
   - Select i3 from your display manager (GDM, LightDM, etc.)
   - On first login, i3 will prompt you to generate a config file and choose your mod key (typically Super/Windows key)

2. **Basic Configuration:**
   - Edit `~/.config/i3/config` to customize keybindings and behavior
   - Focus on keybindings that complement your TMUX and Vim workflow

### TMUX Terminal Multiplexer

1. **Configuration:**
   ```bash
   # Create TMUX config file
   touch ~/.tmux.conf
   ```
   
2. **Essential Settings:**
   - Configure a prefix key that doesn't conflict with i3 or Vim shortcuts
   - Set up basic keybindings for session and window management
   - Enable mouse support if desired for easier navigation

### Vim Text Editor

1. **Configuration:**
   ```bash
   # Create Vim config file
   touch ~/.vimrc
   ```

2. **Basic Setup:**
   - Configure basic settings like line numbers, syntax highlighting, and indentation
   - Consider a plugin manager like `vim-plug` for extended functionality
   - Ensure keybindings work harmoniously with TMUX prefix keys

## Optional: Dotfiles Management with GNU Stow

> **Why Consider GNU Stow?** Managing configuration files across multiple machines or tracking changes becomes complex with traditional approaches. GNU Stow elegantly manages dotfiles by creating symbolic links from a centralized repository to their target locations, making your configurations portable and version-controllable.

If you want organized, version-controlled configuration management:

1. **Install GNU Stow:**
   ```bash
   sudo apt install stow -y
   ```

2. **Setup Structure:**
   ```bash
   # Create dotfiles directory
   mkdir ~/dotfiles
   cd ~/dotfiles
   
   # Create application-specific directories
   mkdir i3 tmux vim
   
   # Move existing configs (example for i3)
   mv ~/.config/i3/config i3/
   mkdir -p i3/.config/i3
   mv i3/config i3/.config/i3/
   ```

3. **Apply Configurations:**
   ```bash
   # From ~/dotfiles directory
   stow i3 tmux vim
   ```

4. **Version Control:**
   ```bash
   git init
   git add .
   git commit -m "Initial dotfiles setup"
   ```

## Workflow Integration

### Effective Usage Patterns:
- **i3 Workspaces:** Dedicate workspaces to specific projects or tasks
- **TMUX Sessions:** Use within i3 terminals for persistent development sessions
- **Vim Integration:** Launch Vim within TMUX panes for seamless editing

### Sample Workflow:
1. Open i3 workspace dedicated to a project
2. Launch terminal and start TMUX session
3. Create TMUX panes for different tasks (coding, testing, monitoring)
4. Use Vim in coding panes, system commands in others

## Essential Additional Packages

**Terminal and System:**
```bash
sudo apt install htop ranger xclip rofi feh -y
```

**Development Tools:**
```bash
sudo apt install neovim git-gui meld -y
```

**Optional Enhancements:**
```bash
# Status bar improvement
sudo apt install i3blocks -y

# Compositor for visual effects
sudo apt install picom -y

# Alternative terminal (verify availability)
sudo apt install alacritty -y  # May require additional repositories
```

## Key Tips for Success

- **Start Simple:** Begin with basic configurations and gradually add complexity
- **Learn Incrementally:** Master one tool before heavily customizing the next
- **Consistent Keybindings:** Ensure your i3, TMUX, and Vim keybindings don't conflict
- **Document Changes:** Keep notes of your customizations for future reference

## Automation Script

Consider creating a setup script in your dotfiles directory:

```bash
#!/bin/bash
# setup.sh - Automated environment setup

sudo apt update && sudo apt upgrade -y
sudo apt install git curl build-essential i3 tmux vim stow -y

# Apply dotfiles if using Stow
if [ -d "~/dotfiles" ]; then
    cd ~/dotfiles
    stow */
fi

chmod +x setup.sh
```

## Troubleshooting Common Issues

- **i3 not appearing in login:** Ensure your display manager supports i3
- **TMUX key conflicts:** Adjust prefix key in `~/.tmux.conf`
- **Vim clipboard issues:** Install `vim-gtk3` for system clipboard support

## Conclusion

This setup provides a powerful, keyboard-driven development environment optimized for efficiency. The combination of i3's window management, TMUX's session handling, and Vim's editing capabilities creates a cohesive workflow ideal for developers and system administrators who prioritize speed and minimalism.

Remember: Customize gradually and always backup your configurations before making significant changes.