Compare commits

..
Author SHA1 Message Date
d793da180e feat(git): add grbia alias for interactive rebase with autosquash
`grbia` runs `git rebase --interactive --autosquash`, following the
existing `grbmia` naming. It has been proposed several times over the
years; this lands it and credits everyone who tried.

Fixes #13865

Co-authored-by: Tushar Mathur <194482+tusharmath@users.noreply.github.com>
Co-authored-by: Thomas Raimond <10564970+ThamosIO@users.noreply.github.com>
Co-authored-by: Clément <59260989+clegoffic@users.noreply.github.com>
Co-authored-by: Gaurav Yadav <160158213+MeGaurav4@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:25:45 -07:00
Rasmus Skovgaard Lauritsen 9f9b28a13d feat(logcli): add completion plugin (#14158) 2026-10-08 16:49:20 -07:00
Zhiqi Zhang 361fb5c1ac fix(python): match two-digit minor versions in pyuserpaths (#14161)
The version pattern used the shortest match (#), so "Python 3.11.4"
was truncated to 3.1 and the ~/.local/lib/python3.11/site-packages
check never matched on python >= 3.10, leaving pyuserpaths a no-op.
Use a longest match (##) so the whole minor version is kept.
2026-10-08 16:46:10 -07:00
tuzi3040 3d9b557be3 fix(battery): make macOS regexes compatible with GNU grep (#14163)
* fix(battery): remove unnecessary whitespace escapes in macOS battery parsing

Remove unnecessary `\ ` escapes in the macOS battery plugin's `grep` and `sed` expressions.

* fix(battery): replace \d with [0-9] for GNU grep compatibility
2026-10-08 16:45:21 -07:00
JackLee992 60c9a7a839 fix(emacs): resolve "closing brace expected" syntax error (#14157)
Fixes #14156
2026-10-06 11:06:45 +02:00
7 changed files with 46 additions and 7 deletions

No files matched your search

+5 -5
View File
@@ -25,10 +25,10 @@ if [[ "$OSTYPE" = darwin* ]]; then
echo "$(ioreg -rc AppleSmartBattery | grep -o '"Watts"=[0-9]\+' | head -1 | grep -o '[0-9]\+')W "
}
function battery_is_charging() {
ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes'
ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected" = Yes'
}
function battery_pct() {
pmset -g batt | grep -Eo "\d+%" | cut -d% -f1
pmset -g batt | grep -Eo "[0-9]+%" | cut -d% -f1
}
function battery_pct_remaining() {
if battery_is_charging; then
@@ -39,8 +39,8 @@ if [[ "$OSTYPE" = darwin* ]]; then
}
function battery_time_remaining() {
local smart_battery_status="$(ioreg -rc "AppleSmartBattery")"
if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected"\ =\ No') -eq 1 ]]; then
timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty"\ =\ ' | sed -e 's/^.*"AvgTimeToEmpty"\ =\ //')
if [[ $(echo $smart_battery_status | command grep -c '^.*"ExternalConnected" = No') -eq 1 ]]; then
timeremaining=$(echo $smart_battery_status | command grep '^.*"AvgTimeToEmpty" = ' | sed -e 's/^.*"AvgTimeToEmpty" = //')
if [ $timeremaining -gt 720 ]; then
echo "::"
else
@@ -52,7 +52,7 @@ if [[ "$OSTYPE" = darwin* ]]; then
}
function battery_pct_prompt () {
local battery_pct color
if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ No'; then
if ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected" = No'; then
battery_pct=$(battery_pct_remaining)
if [[ $battery_pct -gt 50 ]]; then
color='green'
+2 -1
View File
@@ -36,7 +36,8 @@ alias eframe='emacsclient --alternate-editor="" --create-frame'
# Emacs ANSI Term tracking
local excluded_terms=(vterm ghostel)
if [[ -n "$INSIDE_EMACS" ]] && (( ! ${excluded_terms[(Ie)${INSIDE_EMACS%%,*}]} )); then
local current_term="${INSIDE_EMACS%%,*}"
if [[ -n "$INSIDE_EMACS" ]] && (( ! ${excluded_terms[(Ie)$current_term]} )); then
chpwd_emacs() { print -P "\033AnSiTc %d"; }
print -P "\033AnSiTc %d" # Track current working directory
print -P "\033AnSiTu %n" # Track username
+1
View File
@@ -156,6 +156,7 @@ plugins=(... git)
| `grba` | `git rebase --abort` |
| `grbc` | `git rebase --continue` |
| `grbi` | `git rebase --interactive` |
| `grbia` | `git rebase --interactive --autosquash` |
| `grbmi` | `git rebase $(git_main_branch) --interactive` |
| `grbmia` | `git rebase $(git_main_branch) --interactive --autosquash` |
| `grbo` | `git rebase --onto` |
+1
View File
@@ -357,6 +357,7 @@ alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase --interactive'
alias grbia='git rebase --interactive --autosquash'
alias grbo='git rebase --onto'
alias grbs='git rebase --skip'
alias grbd='git rebase $(git_develop_branch)'
+18
View File
@@ -0,0 +1,18 @@
# logcli plugin
This plugin adds completion for [Grafana Loki's logcli](https://grafana.com/docs/loki/latest/query/logcli/).
To use it, add `logcli` to the plugins array in your zshrc file:
```zsh
plugins=(... logcli)
```
This plugin does not add any aliases.
## Cache
This plugin caches the completion script and automatically updates it when the
plugin is loaded, which is usually when you start a new terminal emulator.
The cache is stored at `$ZSH_CACHE_DIR/completions/_logcli`.
+18
View File
@@ -0,0 +1,18 @@
# Autocompletion for Grafana Loki's CLI (logcli).
if (( ! $+commands[logcli] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `logcli`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_logcli" ]]; then
typeset -g -A _comps
autoload -Uz _logcli
_comps[logcli]=_logcli
fi
zmodload -F zsh/files b:zf_mv
() {
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._logcli"
zf_mv -f -- =( logcli --completion-script-zsh ) "$ZSH_CACHE_DIR/completions/_logcli"
} &|
+1 -1
View File
@@ -29,7 +29,7 @@ function pyuserpaths() {
# Get minor release version.
# The patch version is variable length, truncate it.
version=${(M)${"$($python -V 2>&1)":7}#[^.]##.[^.]##}
version=${(M)${"$($python -V 2>&1)":7}##[^.]##.[^.]##}
# Add version specific path, if:
# - it exists in the filesystem