91 lines
4.2 KiB
Markdown
91 lines
4.2 KiB
Markdown
|
||
### **📝 Changelog for Alias File Revision**
|
||
#### **Version: Updated Alias File (Current Date: 2024-11-17)**
|
||
|
||
---
|
||
|
||
### **✨ Added**
|
||
- **📁 File and Directory Management:**
|
||
- `..`, `...`, `....`: Navigate up one, two, or three directories.
|
||
- `back`: Go back to the last directory.
|
||
- `la`: List all files (excluding `.` and `..`) with human-readable sizes.
|
||
- `lsd`: List only directories.
|
||
|
||
- **🌟 Git Shortcuts for Productivity:**
|
||
- `gs`: Git status.
|
||
- `ga`: Git add.
|
||
- `gc`: Git commit with a message.
|
||
- `gl`: Pretty Git log (graph format).
|
||
|
||
- **🖥️ System Monitoring & Management:**
|
||
- `dfh`: Disk usage in human-readable format.
|
||
- `duh`: Folder sizes in human-readable format.
|
||
- `journal`: View critical system logs.
|
||
- `meminfo`: View memory usage in MB.
|
||
- `cpuinfo`: Show CPU information.
|
||
|
||
- **⚙️ Configuration Shortcuts:**
|
||
- `bashrc`, `zshrc`, `vimrc`, `profile`: Quickly edit configuration files.
|
||
- `reload`: Reload `.zshrc` file without restarting the shell.
|
||
|
||
- **💡 Quality of Life Improvements:**
|
||
- `cls`: Clear the terminal screen.
|
||
- `now`: Show the current date and time.
|
||
- `cwd`: Copy the current working directory to the clipboard.
|
||
- Fun shortcuts like `shrug` (¯\\\_(ツ)\_/¯), `lenny` ( ͡° ͜ʖ ͡°), `flip` (╯°□°)╯︵ ┻━┻, and `unflip` ┬─┬ ノ( ゜-゜ノ).
|
||
|
||
---
|
||
|
||
### **❌ Removed**
|
||
- **⚠️ Dangerous or Redundant Aliases:**
|
||
- **`del`**: `alias del='mv -t ~/.local/share/Trash'`
|
||
- 🔒 **Reason**: Risk of unintended file deletion by masking commands. Use dedicated trash utilities like `trash-cli` instead.
|
||
- **`cleanup`**: `alias cleanup="paru -Rns $(paru -Qtdq) && paru -Sc"`
|
||
- 🚨 **Reason**: Automatically removing orphaned packages and cache without review is unsafe. Run `paru -Qtdq` manually for review instead.
|
||
- **`flushdns`**: `alias flushdns="sudo systemctl restart systemd-resolved"`
|
||
- ❌ **Reason**: This is specific to `systemd-resolved` and may not apply to all systems. Avoid aliases dependent on a single environment.
|
||
- **`timer`**: A long-running alias that could confuse users:
|
||
```zsh
|
||
alias timer="echo 'Timer started. Stop with Ctrl+C.' && date +%s && while true; do sleep 1; done"
|
||
```
|
||
- 🛑 **Reason**: Infinite loops can cause confusion. Use a script or dedicated timer tool instead.
|
||
|
||
- **🤪 Fun Aliases Removed:**
|
||
- **`party`:** A whimsical alias with no functional use.
|
||
- **Reason**: Focus on meaningful and productive aliases.
|
||
|
||
---
|
||
|
||
### **🔄 Changed**
|
||
- **🚀 System-Specific or Unsafe Aliases Adjusted:**
|
||
- **`rm` command is now safer (not included directly in aliases):**
|
||
- Suggest replacing `rm` with a custom safeguard function (`safe_rm`) to block dangerous commands like `sudo rm -rf /`.
|
||
|
||
- **🛠️ Alias Loading Order Improved:**
|
||
- Plugins and framework sources (`zsh-autosuggestions`, `zsh-syntax-highlighting`) now load **before** aliases and custom functions to avoid conflicts.
|
||
|
||
---
|
||
|
||
### **📚 Reorganized**
|
||
- **🔧 Improved File Structure for Readability:**
|
||
- Organized aliases into **categories**: File Management, Git Shortcuts, System Monitoring, Package Management, Quality of Life, and Fun.
|
||
- Placed system-specific commands (e.g., `paru` aliases) into a dedicated section.
|
||
- Removed ambiguity by grouping similar aliases together for better maintainability.
|
||
|
||
---
|
||
|
||
### **🎯 Why These Changes?**
|
||
1. **🛡️ Safety:** Prevent unintended consequences from ambiguous or dangerous aliases (e.g., `del` and `cleanup`).
|
||
2. **✅ Clarity:** Focus on aliases that are genuinely useful for day-to-day tasks.
|
||
3. **🌐 Compatibility:** Make the alias file system-agnostic by avoiding environment-specific commands (e.g., `systemd-resolved` for `flushdns`).
|
||
4. **⚡ Efficiency:** Provide shortcuts for frequently used tasks without overloading the configuration.
|
||
|
||
---
|
||
|
||
### **🚀 Future Improvements**
|
||
- 🛠️ Add dynamic checks for system-specific commands to prevent sourcing incompatible aliases.
|
||
- 🧹 Introduce more safeguards for dangerous operations (e.g., using `safe_rm` to block destructive file deletions).
|
||
- 🌟 Expand aliases with productivity-enhancing shortcuts for commonly used tools or workflows (e.g., Docker, Kubernetes, etc.).
|
||
|
||
---
|
||
|