seyyeDevops / My_ZSH

Comprehensive guide for setting up ZSH with Oh My ZSH and Powerlevel10k theme on Ubuntu/Debian systems. Includes installation steps, essential plugins setup, Tmux configuration, and troubleshooting tips.
1 stars 0 forks source link

Doc requires update #1

Open seyyeDevops opened 1 day ago

seyyeDevops commented 1 day ago

in the .zshrc there are some bugs also add hstr: bash and zsh shell history suggest box

seyyeDevops commented 16 hours ago

.zshrc

Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.

if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi

Path to your Oh My Zsh installation.

export ZSH="$HOME/.oh-my-zsh"

Tmux Autostart Configuration

ZSH_TMUX_AUTOSTART=true ZSH_TMUX_DEFAULT_SESSION_NAME=Working

Autostart Tmux if it's not already running

if command -v tmux &> /dev/null; then if [[ -z "$TMUX" ]]; then tmux new-session -A -s "$ZSH_TMUX_DEFAULT_SESSION_NAME" fi fi

Set name of the theme to load

ZSH_THEME="powerlevel10k/powerlevel10k"

Plugins to load

plugins=(git zsh-autosuggestions zsh-syntax-highlighting fast-syntax-highlighting zsh-autocomplete colored-man-pages) source $ZSH/oh-my-zsh.sh

User configuration

Use exa as ls if installed

if [ -x "$(command -v exa)" ]; then alias ls="exa" alias la="exa --long --all --group" fi

To customize prompt, run p10k configure or edit ~/.p10k.zsh.

[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

export http_proxy='http://192.168.254.1:3128' export https_proxy='http://192.168.254.1:3128'

HSTR configuration - add this to ~/.zshrc

alias hh=hstr # hh to be alias for hstr setopt histignorespace # skip cmds w/ leading space from history export HSTR_CONFIG=hicolor # get more colors bindkey -s "\C-r" "\C-a hstr -- \C-j" # bind hstr to Ctrl-r (for Vi mode check doc)