Update tech_docs/linux/system_setup.md
This commit is contained in:
@@ -1,203 +1,168 @@
|
||||
Streamlining the guide further, we aim for precision and clarity, targeting users well-versed in Linux environments. The revised guide focuses on setting up i3, TMUX, and Vim on Debian 12, incorporating a clean approach to dotfiles management with GNU Stow.
|
||||
|
||||
# Efficient Setup of i3, TMUX, and Vim on Debian 12
|
||||
|
||||
This guide is tailored for experienced Linux users looking to establish a keyboard-centric development environment on Debian 12 (Bookworm) using i3, TMUX, and Vim, complemented by efficient dotfiles management with GNU Stow.
|
||||
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 Essential Packages:**
|
||||
**Update and Install Core Packages:**
|
||||
|
||||
```bash
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
sudo apt install git curl build-essential stow i3 tmux vim -y
|
||||
sudo apt install git curl build-essential i3 tmux vim -y
|
||||
```
|
||||
|
||||
## Environment Setup
|
||||
## Core Environment Setup
|
||||
|
||||
### i3
|
||||
### i3 Window Manager
|
||||
|
||||
- Install i3 and reload your session. Choose your mod key (usually Super/Windows) when prompted during the first i3 startup.
|
||||
- Customize i3 by editing `~/.config/i3/config`, tailoring keybindings and settings.
|
||||
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)
|
||||
|
||||
### TMUX
|
||||
2. **Basic Configuration:**
|
||||
- Edit `~/.config/i3/config` to customize keybindings and behavior
|
||||
- Focus on keybindings that complement your TMUX and Vim workflow
|
||||
|
||||
- Launch TMUX with `tmux` and configure it by editing `~/.tmux.conf` to fit your workflow, ensuring harmony with i3 keybindings.
|
||||
|
||||
### Vim
|
||||
|
||||
- Start Vim and adjust `~/.vimrc` for your development needs. Consider plugin management solutions like `vim-plug` for extended functionality.
|
||||
|
||||
## Dotfiles Management with GNU Stow
|
||||
|
||||
1. **Organize Configurations**: Create a `~/dotfiles` directory. Inside, segregate configurations into application-specific folders (i3, TMUX, Vim).
|
||||
|
||||
2. **Apply Stow**: Use GNU Stow from the `~/dotfiles` directory to symlink configurations to their respective locations.
|
||||
### 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
|
||||
```
|
||||
|
||||
3. **Version Control**: Initialize a Git repository in `~/dotfiles` for easy management and replication of your configurations.
|
||||
4. **Version Control:**
|
||||
```bash
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Initial dotfiles setup"
|
||||
```
|
||||
|
||||
## Automation
|
||||
## Workflow Integration
|
||||
|
||||
- **Scripting**: Create a `setup.sh` script in `~/dotfiles` to automate the installation and configuration process for new setups. Ensure the script is executable with `chmod +x setup.sh`.
|
||||
### 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
|
||||
|
||||
## Key Tips
|
||||
### 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
|
||||
|
||||
- Use i3 workspaces for project-specific tasks.
|
||||
- Employ TMUX for terminal session management within i3 windows.
|
||||
- Master Vim keybindings for efficient code editing.
|
||||
## Essential Additional Packages
|
||||
|
||||
## Additional Tools
|
||||
**Terminal and System:**
|
||||
```bash
|
||||
sudo apt install htop ranger xclip rofi feh -y
|
||||
```
|
||||
|
||||
Consider enhancing your setup with `i3blocks` or `polybar` for status bar customization, and explore terminal emulators like `gnome-terminal`, `alacritty`, or `urxvt` for better integration with your environment.
|
||||
**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
|
||||
|
||||
Adopting this setup on Debian 12 provides a streamlined, efficient development environment. Leveraging i3, TMUX, and Vim in conjunction with GNU Stow for dotfiles management enhances productivity, offering a powerful, keyboard-driven user experience for seasoned Linux enthusiasts.
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
# Streamlined Guide for Setting Up i3, TMUX, and Vim on Debian 12
|
||||
|
||||
This guide provides a straightforward approach to setting up a highly efficient development environment on Debian 12 (Bookworm) using i3 window manager, TMUX, and Vim. It's tailored for users who value keyboard-driven productivity and minimalism.
|
||||
|
||||
## Initial System Update and Setup
|
||||
|
||||
1. **Update Your System**:
|
||||
Open a terminal and execute the following commands to ensure your system is up to date.
|
||||
```bash
|
||||
sudo apt update && sudo apt upgrade -y
|
||||
```
|
||||
|
||||
2. **Install Required Utilities**:
|
||||
Some utilities like `git`, `curl`, and `build-essential` are essential for the subsequent steps.
|
||||
```bash
|
||||
sudo apt install git curl build-essential -y
|
||||
```
|
||||
|
||||
## Installing and Configuring i3
|
||||
|
||||
1. **Install i3 Window Manager**:
|
||||
```bash
|
||||
sudo apt install i3 -y
|
||||
```
|
||||
Logout and select i3 at your login screen to start your i3 session.
|
||||
|
||||
2. **Basic Configuration**:
|
||||
Upon first login, i3 will ask you to create a configuration file and choose a mod key (typically, the Super/Windows key).
|
||||
|
||||
3. **Customize i3 Config**:
|
||||
Edit the `~/.config/i3/config` file to refine your setup. Start by setting keybindings that complement your workflow with Vim and TMUX.
|
||||
|
||||
## Setting Up TMUX
|
||||
|
||||
1. **Install TMUX**:
|
||||
```bash
|
||||
sudo apt install tmux -y
|
||||
```
|
||||
|
||||
2. **Configure TMUX**:
|
||||
- Create a new configuration file:
|
||||
```bash
|
||||
touch ~/.tmux.conf
|
||||
```
|
||||
- Use the TMUX configuration discussed previously to populate `~/.tmux.conf`.
|
||||
- Remember to adjust the prefix key if it conflicts with i3 or Vim shortcuts.
|
||||
|
||||
3. **Session Management**:
|
||||
Use TMUX for managing terminal sessions within i3 windows. Practice creating, detaching, and attaching sessions as described earlier.
|
||||
|
||||
## Installing and Customizing Vim
|
||||
|
||||
1. **Install Vim**:
|
||||
```bash
|
||||
sudo apt install vim -y
|
||||
```
|
||||
|
||||
2. **Configure Vim**:
|
||||
- Create your Vim configuration file:
|
||||
```bash
|
||||
touch ~/.vimrc
|
||||
```
|
||||
- Implement the Vim settings provided earlier for a solid starting point.
|
||||
- Consider installing Vim plugins like `vim-plug` for extended functionality.
|
||||
|
||||
## Integrating Dotfiles Management
|
||||
|
||||
1. **Manage Configurations**:
|
||||
- Use a Git repository to manage your dotfiles (`i3`, `TMUX`, `Vim`) for easy replication and version control.
|
||||
- Create symbolic links (`ln -s`) from your actual config locations to the files in your dotfiles repository.
|
||||
|
||||
2. **Automate Setup**:
|
||||
- Write shell scripts to automate the installation and configuration process for new machines or fresh installs.
|
||||
|
||||
## Workflow Tips
|
||||
|
||||
- **Leverage i3 for Workspace Management**: Use different i3 workspaces for various tasks and projects.
|
||||
- **Utilize TMUX Within i3**: Run TMUX in your terminals to multiplex inside a clean i3 workspace.
|
||||
- **Vim for Editing**: Within TMUX sessions, use Vim for code editing, ensuring a keyboard-centric development process.
|
||||
|
||||
## Additional Recommendations
|
||||
|
||||
- **Explore i3blocks or polybar**: Enhance your i3 status bar with useful information.
|
||||
- **Learn Vim Keybindings**: Increase your efficiency in Vim by mastering its keybindings and commands.
|
||||
- **Customize Your Terminal**: Use `gnome-terminal`, `alacritty`, or `urxvt` for better integration with i3 and TMUX.
|
||||
|
||||
By following this guide, you'll set up a Debian 12 system optimized for productivity and efficiency, with i3, TMUX, and Vim at the core of your workflow. This setup is ideal for developers and system administrators who prefer a keyboard-driven environment, offering powerful tools for managing windows, terminal sessions, and code editing seamlessly.
|
||||
|
||||
---
|
||||
|
||||
For a robust and efficient i3 window manager setup on Debian, power users often incorporate a variety of packages to enhance functionality, customization, and productivity. Below is a concise list of commonly used packages tailored for such an environment.
|
||||
|
||||
### System Tools and Utilities
|
||||
- **`git`**: Version control system essential for managing codebases and dotfiles.
|
||||
- **`curl` / `wget`**: Tools for downloading files from the internet.
|
||||
- **`build-essential`**: Package containing compilers and libraries essential for compiling software.
|
||||
|
||||
### Terminal Emulation and Shell
|
||||
- **`gnome-terminal`**, **`alacritty`**, or **`urxvt`**: Terminal emulators that offer great customization and integration with i3.
|
||||
- **`zsh`** or **`fish`**: Alternative shells to Bash, known for their enhancements, plugins, and themes.
|
||||
|
||||
### File Management
|
||||
- **`ranger`**: Console-based file manager with VI keybindings.
|
||||
- **`thunar`**: A lightweight GUI file manager if occasional graphical management is preferred.
|
||||
|
||||
### System Monitoring and Management
|
||||
- **`htop`**: An interactive process viewer, superior to `top`.
|
||||
- **`ncdu`**: Disk usage analyzer with an ncurses interface.
|
||||
- **`lm-sensors` / `psensor`**: Hardware temperature monitoring tools.
|
||||
|
||||
### Networking Tools
|
||||
- **`nmap`**: Network exploration tool and security / port scanner.
|
||||
- **`traceroute` / `tracepath`**: Tools to trace the path packets take to a network host.
|
||||
|
||||
### Text Editing and Development
|
||||
- **`vim-gtk3` or `neovim`**: Enhanced versions of Vim, the text editor, with additional features such as clipboard support.
|
||||
- **`tmux`**: Terminal multiplexer, for managing multiple terminal sessions.
|
||||
|
||||
### Appearance and Theming
|
||||
- **`lxappearance`**: GUI tool for changing GTK themes.
|
||||
- **`feh`**: Lightweight image viewer and background setter.
|
||||
- **`nitrogen`**: Background browser and setter for X windows.
|
||||
- **`picom`**: A compositor for Xorg, providing window effects like transparency and shadows.
|
||||
|
||||
### Media and Document Viewing
|
||||
- **`vlc`**: Versatile media player capable of playing most media formats.
|
||||
- **`zathura`**: Highly customizable and functional document viewer, with Vim-like keybindings.
|
||||
- **`imagemagick`**: Software suite to create, edit, compose, or convert bitmap images.
|
||||
|
||||
### Miscellaneous Utilities
|
||||
- **`xclip`** or **`xsel`**: Command line clipboard utilities. Essential for clipboard management within terminal sessions.
|
||||
- **`rofi`** or **`dmenu`**: Application launchers that allow quick finding and launching of applications and commands.
|
||||
|
||||
### Installation Command
|
||||
Combine the installation into a single command for convenience:
|
||||
|
||||
```bash
|
||||
sudo apt update && sudo apt install git curl wget build-essential gnome-terminal alacritty ranger thunar htop ncdu lm-sensors nmap traceroute vim-gtk3 neovim tmux lxappearance feh nitrogen picom vlc zathura imagemagick xclip rofi -y
|
||||
```
|
||||
|
||||
Adjust the list based on your preferences and needs. This setup provides a comprehensive toolset for power users, ensuring a wide range of tasks can be efficiently managed within a Debian-based i3wm environment.
|
||||
Remember: Customize gradually and always backup your configurations before making significant changes.
|
||||
Reference in New Issue
Block a user