~grauwoelfchen/.zsh

Personal .zsh configuration and scripts
Update .zshenv
Update .zshrc

refs

trunk
browse  log 

clone

read-only
https://git.sr.ht/~grauwoelfchen/.zsh
read/write
git@git.sr.ht:~grauwoelfchen/.zsh

You can also use your local clone with git send-email.

#.zsh

Personal .zshrc, .zshenv, scripts and settings.

#Repository

https://gitlab.com/grauwoelfchen/DotZsh

#Setup

% cd
% mkdir ~/.zfunc
% git clone git@gitlab.com:grauwoelfchen/dotzsh.git && cd .zsh
% git submodule update --init

#Prompt

Let's use seasonal prompt! See ~/.zshrc.

# winter
PROMPT="%F{239}%m%f %F{105}%~%f \$(git_prompt)\$(uptime | \
awk -F': ' '{ print \$2 }')
%F{153}❯❯❯%f "
# spring
PROMPT="%F{029}%m%f %F{077}%~%f \$(git_prompt)\$(uptime | awk -F'  ' '{ print \$4 }')
#%F{219}❯❯❯%f "
# summer
PROMPT="%F{026}%m%f %F{074}%~%f \$(git_prompt)\$(uptime | awk -F'  ' '{ print \$4 }')
#%F{103}❯❯❯%f "

It will be something like this:

stockhorn ~/.atelier/usr/share/path/to/a/repository/ master 0.21, 0.28, 0.17
❯❯❯ _

or just use gentoo like prompt.

# gentoo
autoload -U promptinit
promptinit
prompt gentoo

#Note

#Private .zshrc

Put .zshrc.private into .zsh directory, if you want to put sensitive value in zshrc.

#.sh.d

Shared scripts in .sh.d directory are universal. (zsh, bash)

#.env autoloading

The astostash/stash/unstash functions are available by zsh-autoenv. To load environment variables from .env, put .autoenv.zsh like this:

while read -r line; do; local var=$(echo "$(eval echo $line)"); autostash $var; done < ./.env

See .autoenv.zsh.sample or use direnv.

#Startup files

The files will be loaded by following order.

  1. /etc/zsh/zshenv
  2. $HOME/.zshenv
  3. /etc/zsh/zprofile and $HOME/.zprofile
  4. /etc/zshrc and $HOME/.zshrc
  5. /etc/zsh/zlogin and $HOME/.zlogin

#unset

/etc/zsh/zprofile of Gentoo clears environment variables with unset.

% sudo mv /etc/zsh/{zprofile,zprofile.orig}

#License

Copyright (c) 2013-2024 Yasha

This is free software: You can redistribute it and/or modify it under the terms of the GUN General Public License as published by the Free Software Foundation.

See LICENSE. (GPL-2.0)