Zsh settings
Zsh is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting
Reasoning
Section titled “Reasoning”By default we get access to the bash terminal, (bash) which has its own scripting
language and login shell. But it has short-comings when it comes to speed besides
other quality of life improvements zsh comes with out the box. Mainly I like the
auto-completion it has, on top of its speed, and when scripting with zsh
we get nice additions that I sometimes leverage.
Settings rundown
Section titled “Settings rundown”These are settings that live (on linux) under ~/.zshrc. This file will run before
zsh starts so you can extend behavior here.
# Add deno completions to search pathif [[ ":$FPATH:" != *{DENO_COMPLETIONS}* ]]; then export FPATH={DENO_FPATH}; fi
# Autostart() { setopt LOCAL_OPTIONS NO_MONITOR fcitx5 -d &> /dev/null & wait}
# Use powerlineUSE_POWERLINE="true"# Has weird character width# Example:# is not a diamondHAS_WIDECHARS="false"# Source manjaro-zsh-configurationif [[ -e /usr/share/zsh/manjaro-zsh-config ]]; then source /usr/share/zsh/manjaro-zsh-configfi# Use manjaro zsh promptif [[ -e /usr/share/zsh/manjaro-zsh-prompt ]]; then source /usr/share/zsh/manjaro-zsh-promptfi
# nvmexport NVM_DIR="$HOME/.nvm"[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Load Angular CLI autocompletion.export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
# pnpmexport PNPM_HOME={PNPM}case ":$PATH:" in *":$PNPM_HOME:"*) ;; *) export PATH="$PNPM_HOME:$PATH" ;;esac# pnpm end
# Aliases
alias waifu={WAIFU}alias lasf="ls -laF"alias prx={PRX}alias lesgow={LESGOW}alias jpmu={JPMU}alias jpmuU={JPMUU}
# Shell function aliasesraku() { {RAKU}}
# bun completions[ -s {BUN} ] && source {BUN}
# bunexport BUN_INSTALL="$HOME/.bun"export PATH="$BUN_INSTALL/bin:$PATH"
# Alacrittyfpath+=${ZDOTDIR:-~}/.zsh_functions
# Cool startfastfetch
# Go Path
export GOPATH="$HOME/go"
# Deno Pathexport PATH="$GOPATH/bin:$PATH"{DENO}
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.export PATH="$PATH:$HOME/.rvm/bin"[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"The rundown is as follows:
- There’s some deno completions so that the terminal picks them up
- This is part of the japanese keyboard setup, in short we
set up
fcitx5to run as a demon so that we can access the respective keyboard emulator the moment the system boots up. (otherwise we would have to manually initialite it always) - Pretty sure so that we don’t see weird symbols there’s this the whole chunk of code
with
powerline,HAS_WIDECHARSand other manjaro-zsh stuff. (Some of it might also be auto-generated). - NVM configurations that are also auto-added when installing nvm
- A section that allows to add the dotnet space to the machine’s
path - Another auto-generated section probably, this points to the local directory for
pnpm - Aliases for things I want such as:
- There’s a program to scale images (don’t ask why I need this), this opens it up with one command
- An alias to list files in a directory well formatted (it will pick-up hidden files as well)
- An alias to jump into a projects folder
- An alias to jump into a GO Lang working folder
- An alias to run a go program that is a menu to open up games (personal unreleased project)
- An alias to build, copy the executable to a specific directory and run the menu to open up games
- This ties into the custom scripts maintenance file, with this
alias I can run the update
shscript - Bun auto-generated completions
- So that alacritty has access to cool
zshauto-completions we add them to its path - I like to see the system health when opening a new terminal session so
fastfetchis run here - Setting up a go path for working with it
- Auto-generated deno path export
- RVM export, (I use ruby solely for an asciidoc tool nothing else)
A variable file
Section titled “A variable file”Already explained in the README.md of the respective repository,
but in short, a .vars file should have inside respective values to then parse
onto the respective .zshrc file when passing this onto a new machine. For security reasons
the values are obscured.
Custom scripts
Section titled “Custom scripts”For now there’s one utility script that I use which is maintenance.sh. This
takes care of just vacumming logs, clearing caches and the like, but by sending a
--upgrade flag it will actually run a full yay -Syu command on top of running
a script for pnpm to auto-update. You can read it in its repository,
it’s a bit long, so it won’t be explained here that much in detail. (Besides, it’s
well commented).
Wrapper scripts
Section titled “Wrapper scripts”A good way to bubble up aliases to sudo, is to instead of writing an alias under
~/.zshrc you can create a wrapper script at a specific location, e.g.,
sudo nano /usr/local/bin/hx
#!/bin/shexec helix "$@"
sudo chmod +x /usr/local/bin/hxThis is a specific use case for helix, since I had installed it but it would only
open up with helix ..., where as the titular hx is shorter. And so I simply created
this file, and even when editing files that require sudo, sudo hx file and
hx file all work just fine.
Status Bar
Section titled “Status Bar”By default Manjaro’s comes with pk10, and you can use its CLI tool to auto-generate
a dotfile that fits to your liking and customizes the terminal’s status bar look
and feel. Guide.
My personal preference:

- The path
- Git branch name
- The time at the right end
That’s it.