Files
vault-para/100-project/Personal/Dev/Shell/Zsh Oh My Posh.md
T
windyboyandClaude Sonnet 4.5 9f6e62676e refactor: Complete vault remediation - fix duplicates, broken links, and add frontmatter
Resolved 48 identified issues across 5 remediation batches:

Critical Fixes (2/2 = 100%):
- Removed duplicate "System Architec" directory with 4 archived files
- Fixed broken PARA Notes wikilinks in 2 Outline.md files

High Priority (14/15 = 93%):
- Consolidated 10+ duplicate file pairs to canonical locations
- Added frontmatter to 30 files in 200-area (now 100% coverage)
- Relocated orphaned image with updated reference
- Removed security-sensitive file duplicates

Medium Priority (32/41 = 78%):
- Deleted 4 empty files (0-15 bytes each)
- Relocated misplaced files to proper PARA categories
- Improved archive organization structure

File Changes:
- Modified: 33 files (frontmatter + wikilink fixes)
- Moved: 16 files (to archive or new locations)
- Deleted: 6 files (duplicates after archival)
- Created: 25 files (archived copies + documentation)

Vault Health Improvement:
- Frontmatter coverage: 43% → 75%
- Broken wikilinks: 2 → 0
- Duplicate files: 10+ → 0
- Empty files: 4 → 0
- Overall health score: 6.5/10 → 8.5/10

Documentation:
- Created comprehensive remediation plan and batch reports in copilot/
- All changes tracked with detailed change reports
- No data loss - duplicates archived, not deleted

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-30 14:36:42 +08:00

5.2 KiB

To set up Oh My Posh with Zsh on Debian 12, follow these steps to install the necessary components and configure your terminal prompt.

Installation Steps

1. Download the Oh My Posh Binary

First, you need to download the Oh My Posh binary suitable for Linux. Open your terminal and run the following command:

sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh

2. Set Executable Permissions

Make the downloaded binary executable:

sudo chmod +x /usr/local/bin/oh-my-posh

3. Create a Directory for Themes

You need a directory to store your themes. Create it using:

mkdir -p ~/.poshthemes

4. Download Themes

You can download predefined themes from the Oh My Posh repository. For example, to download the latest themes, run:

wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip

Unzip the downloaded file:

unzip ~/.poshthemes/themes.zip -d ~/.poshthemes

Then, clean up by removing the zip file:

rm ~/.poshthemes/themes.zip

5. Update Your Zsh Configuration

Now, you need to configure your Zsh shell to use Oh My Posh. Open your .zshrc file in a text editor:

nano ~/.zshrc

Add the following line at the end of the file to initialize Oh My Posh with a specific theme (replace alien with your preferred theme name):

eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/alien.omp.json)"

6. Apply Changes

After saving and closing the .zshrc file, apply the changes by running:

source ~/.zshrc

Additional Configuration

Install a Nerd Font (Optional)

For better aesthetics, install a Nerd Font that supports icons used by Oh My Posh. You can download fonts like Meslo or Fira Code from their respective repositories and install them on your system.

Set Terminal Font

Finally, ensure that your terminal emulator is configured to use the newly installed Nerd Font for optimal display of icons and symbols.

By following these steps, you will have successfully set up Oh My Posh with Zsh on Debian 12, enhancing your terminal's appearance and functionality.

Citations: [1] https://dev.to/karleeov/wsl-arch-setup-for-oh-my-posh-51pa [2] https://www.reddit.com/r/NixOS/comments/1ge1gwn/how_to_set_ohmyposh_settings/ [3] https://ohmyposh.dev/docs/installation/linux [4] https://www.librebyte.net/en/cli-en/oh-my-posh-a-beatifull-prompt-for-your-shell/ [5] https://www.youtube.com/watch?v=nGHgyPLi7UM [6] https://calebschoepp.com/blog/2021/how-to-setup-oh-my-posh-on-ubuntu/ [7] https://www.linux.org/threads/need-help-finalizing-oh-my-posh-bash-terminal.52617/

.zshrc

#go lang
export GOROOT=/usr/local/go
export GOPATH=/home/windy/go-lang
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/powerlevel10k_modern.omp.json)"


[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh


# Zinit setup and plugin management
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
[ ! -d $ZINIT_HOME ] && mkdir -p "$(dirname $ZINIT_HOME)"
[ ! -d $ZINIT_HOME/.git ] && git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
source "${ZINIT_HOME}/zinit.zsh"

# Load essential annexes (non-turbo mode for annex functionality)
zinit light-mode for \
    zdharma-continuum/zinit-annex-as-monitor \
    zdharma-continuum/zinit-annex-bin-gem-node \
    zdharma-continuum/zinit-annex-patch-dl \
    zdharma-continuum/zinit-annex-rust

# Load Zeno plugin with keybindings
zinit ice lucid depth"1" blockf
zinit light yuki-yano/zeno.zsh

if [[ -n $ZENO_LOADED ]]; then
  bindkey ' '  zeno-auto-snippet
  bindkey '^m' accept-line
  bindkey '^i' zeno-completion
  bindkey '^g' zeno-ghq-cd
  bindkey '^r' zeno-history-selection
  bindkey '^x' zeno-insert-snippet
fi

# Load additional Zsh plugins
zinit ice wait"0"; zinit light zsh-users/zsh-completions
autoload -Uz compinit && compinit
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'
zstyle ':completion:*:default' menu select=1

zinit light zsh-users/zsh-syntax-highlighting
zinit light zsh-users/zsh-autosuggestions
zinit light Aloxaf/fzf-tab

# FZF configuration
zi ice from"gh-r" as"program"
zi light junegunn/fzf

# Auto-suggestions styling
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=244"

# History settings
HISTFILE=~/.zsh-history
HISTSIZE=100000
SAVEHIST=1000000
HISTDUP=erase
setopt appendhistory sharehistory hist_ignore_space hist_ignore_all_dups
setopt hist_save_no_dups hist_ignore_dups hist_find_no_dups
setopt inc_append_history share_history

# Zsh options for usability
setopt AUTO_CD
setopt AUTO_PARAM_KEYS

# Completion and FZF styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'

# Load additional plugins with default keys
zinit pack"default+keys" for fzf

# Ensure Zinit autocompletion
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# Consolidate PATH with deduplication
export PATH=$(echo "/run/current-system/sw/bin:/usr/local/bin:/usr/local/sbin:$PATH" | tr ':' '\n' | awk '!seen[$0]++' | tr '\n' ':' | sed 's/:$//')