Skip to content

Arups-Experiments/zshrc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 

Repository files navigation

🐚 ZSH Configuration

This is a custom .zshrc configuration optimized for development productivity using Oh My Zsh, enhanced plugins, and convenient aliases. It is designed to work well on Linux-based systems with support for Git, Node.js, and shell improvements.


🚀 Features

  • Oh My Zsh with the miloshadzic theme.
  • Lazy loading for faster startup (especially for nvm).
  • Custom prompt with hostname and current directory.
  • Enhanced command-line experience via:
    • zsh-autosuggestions
    • zsh-syntax-highlighting
  • Optimized PATH for tools like Yarn and Neovim.
  • Useful aliases for Git, system control, clipboard utilities, and more.
  • History configuration with a large buffer size.
  • Helper functions for system update and Git log visualization.

📦 Prerequisites

Before using this configuration, ensure you have:


🛠️ Plugin Configuration

plugins=(
  npm
  yarn
  git
  zsh-syntax-highlighting
  zsh-autosuggestions
)

Plugin settings:

  • nvm: lazy loading enabled to reduce shell startup time.
  • yarn: avoids using global path detection to reduce conflicts.
  • Autosuggestions styled with underline, bold, and color.

🎨 Prompt Style

PROMPT='%F{240}%n%F{red}@%F{green}%m:%F{141}%d$ %F{reset}'

This provides a clean and colorful shell prompt showing:

  • Username
  • Hostname
  • Current directory

🧩 Useful Aliases

Alias Description
tmux Start tmux with UTF-8 support
pbcopy Copy from stdin to clipboard (xclip)
pbpaste Paste from clipboard
python Maps to python3
reboot Reboot system using systemd
shutdown Shutdown system immediately
*.txt Open .txt files with vim

⚙️ Helper Functions

timezsh

Benchmark zsh startup time by running it 10 times:

timezsh

runpreload

Start preload daemon (if installed):

runpreload

sysupgrade

Update and upgrade all system packages:

sysupgrade

gitlog

Display a clean and colorful Git commit graph:

gitlog

📝 History Settings

HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000

This ensures up to 10,000 past commands are preserved across sessions.


🧠 Tips for Customization

  • To add more plugins, place them in the plugins=(...) array.
  • For a random theme every startup, set ZSH_THEME="random" and optionally define ZSH_THEME_RANDOM_CANDIDATES.
  • Define personal aliases in the ZSH_CUSTOM directory or inside .zshrc directly.
  • Customize prompt or theme using Oh My Zsh Themes Wiki.

📂 Path Adjustments

export PATH="$PATH:$(yarn global bin)"
PATH+="$PATH:/opt/nvim-linux64/bin"

Adds Yarn global binaries and Neovim to your executable search path.


🔌 NVM Initialization

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"

Ensures Node Version Manager (NVM) is available in your shell.


✅ Final Load

At the end, the config sources oh-my-zsh:

source $ZSH/oh-my-zsh.sh

📤 Contribution

Feel free to fork or copy this .zshrc to build your own custom configuration.

Releases

No releases published

Packages

No packages published

Languages