Compare commits

...
Author SHA1 Message Date
02e5c89d20 feat(git): add gan and ganpa aliases for git add --intent-to-add
`gapa` only offers hunks from tracked files. `ganpa` marks untracked
files with intent-to-add first, so new files show up in the patch
prompt too. It needs the `.` pathspec, since `git add --intent-to-add`
with no path adds nothing.

Reapplies #13609, with the pathspec fix from review.

Co-Authored-By: Charles Dunda <241828233+cdunda-perchwell@users.noreply.github.com>
Co-Authored-By: Karl Horky <1935696+karlhorky@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 15:37:56 -08:00
Arbian Shkodra b5cb2fe952 feat(hcloud): add hcloud_prompt_info function (#13535) 2026-11-24 15:32:52 -08:00
4 changed files with 52 additions and 0 deletions

No files matched your search

+2
View File
@@ -18,6 +18,8 @@ plugins=(... git)
| `g` | `git` |
| `ga` | `git add` |
| `gaa` | `git add --all` |
| `gan` | `git add --intent-to-add` |
| `ganpa` | `git add --intent-to-add . && git add --patch` |
| `gapa` | `git add --patch` |
| `gau` | `git add --update` |
| `gav` | `git add --verbose` |
+2
View File
@@ -116,6 +116,8 @@ alias ggpur='ggu'
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gan='git add --intent-to-add'
alias ganpa='git add --intent-to-add . && git add --patch'
alias gapa='git add --patch'
alias gau='git add --update'
alias gav='git add --verbose'
+31
View File
@@ -112,6 +112,37 @@ plugins=(... hcloud)
| hcst | `hcloud server-type list` | List all server types |
| hcit | `hcloud image list --type system` | List all system images |
## Prompt function
This plugin provides `hcloud_prompt_info` which can be added to your prompt to display the current Hetzner Cloud context.
- If `HCLOUD_TOKEN` environment variable is set, it displays `HCLOUD_TOKEN` (indicating direct token usage)
- Otherwise, it displays the active context name
### Usage
Add `$(hcloud_prompt_info)` to your `PROMPT` or `RPROMPT` in your `.zshrc`:
```zsh
RPROMPT='$(hcloud_prompt_info)'
```
### Theme variables
| Variable | Default | Description |
| :----------------------------- | :-------------- | :----------------------------------------------- |
| `ZSH_THEME_HCLOUD_PREFIX` | `<hcloud:` | Prefix before the context name |
| `ZSH_THEME_HCLOUD_SUFFIX` | `>` | Suffix after the context name |
| `ZSH_THEME_HCLOUD_TOKEN_TEXT` | `HCLOUD_TOKEN` | Text shown when `HCLOUD_TOKEN` env var is set |
### Example with custom styling
```zsh
ZSH_THEME_HCLOUD_PREFIX="%{$fg[blue]%}hcloud:("
ZSH_THEME_HCLOUD_SUFFIX=")%{$reset_color%}"
RPROMPT='$(hcloud_prompt_info)'
```
## Requirements
This plugin requires the [Hetzner Cloud CLI](https://github.com/hetznercloud/cli) to be installed.
+17
View File
@@ -131,3 +131,20 @@ alias hcdc='hcloud datacenter list'
alias hcloc='hcloud location list'
alias hcst='hcloud server-type list'
alias hcit='hcloud image list --type system'
# Prompt function to display current hcloud context
# Usage: add $(hcloud_prompt_info) to your PROMPT or RPROMPT
function hcloud_prompt_info() {
# Check if HCLOUD_TOKEN is set (overrides context)
if [[ -n "$HCLOUD_TOKEN" ]]; then
echo "${ZSH_THEME_HCLOUD_PREFIX=<hcloud:}${ZSH_THEME_HCLOUD_TOKEN_TEXT=HCLOUD_TOKEN}${ZSH_THEME_HCLOUD_SUFFIX=>}"
return
fi
# Get active context
local context
context=$(hcloud context active 2>/dev/null)
[[ -n "$context" ]] || return
echo "${ZSH_THEME_HCLOUD_PREFIX=<hcloud:}${context}${ZSH_THEME_HCLOUD_SUFFIX=>}"
}