https://github.com/markshawn2020/zsh-git-relative-path
Zsh Git 相对路径插件 一个简单但实用的 Zsh 插件,它可以在你的命令提示符中显示相对于 Git 项目根目录的当前路径。这个插件是在 AI 的协助下在短短 10 分钟内完成的,展示了 AI 辅助开发的强大能力。
https://github.com/markshawn2020/zsh-git-relative-path
ai cursor git llm oh-my-zsh vscode windsurf zsh
Last synced: about 2 months ago
JSON representation
Zsh Git 相对路径插件 一个简单但实用的 Zsh 插件,它可以在你的命令提示符中显示相对于 Git 项目根目录的当前路径。这个插件是在 AI 的协助下在短短 10 分钟内完成的,展示了 AI 辅助开发的强大能力。
- Host: GitHub
- URL: https://github.com/markshawn2020/zsh-git-relative-path
- Owner: MarkShawn2020
- License: mit
- Created: 2024-12-21T11:52:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-21T14:14:51.000Z (over 1 year ago)
- Last Synced: 2025-08-20T06:08:03.586Z (10 months ago)
- Topics: ai, cursor, git, llm, oh-my-zsh, vscode, windsurf, zsh
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@cs-magic-open/zsh-git-relative-path
- Size: 759 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
zsh-git-relative-path
Show git-relative paths in your ZSH prompt
Oh My Zsh Plugin
Installation •
Usage •
Themes •
Development
---
## Features
- Zero configuration needed
- Works with any oh-my-zsh theme
- Special support for robbyrussell, agnoster, avit themes
- Falls back to normal path when not in a git repo
## Prerequisites
- [Oh My Zsh](https://ohmyz.sh/)
- Node.js >= 14.0.0
## Installation
```bash
npm install -g @cs-magic-open/zsh-git-relative-path
```
Done! The plugin auto-configures itself.
## Usage
```bash
# Before (in /Users/username/projects/my-project/src/components)
username ~/projects/my-project/src/components $
# After (same directory)
username src/components $
```
## Supported Themes
| Theme | Status |
|-------|--------|
| robbyrussell | Native support |
| agnoster | Native support |
| avit | Native support |
| Others | Auto-patched via `%~`, `%c`, `%C` replacement |
## Development
```bash
git clone https://github.com/cs-magic-open/zsh-git-relative-path
cd zsh-git-relative-path
npm install -g .
# Debug mode
ZSH_GIT_PATH_DEBUG=1 source ~/.zshrc
```
## License
MIT