1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2026-02-12 12:21:00 +01:00

3 Commits

Author SHA1 Message Date
Roeniss Moon
537807c863 feat(alias-finder): use ripgrep if possible (#13043)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2025-07-21 18:58:09 +02:00
jishudashen
e3e468d138 chore: fix typos (#13219) 2025-07-21 18:39:25 +02:00
Bacluc
ff97957f1c feat(tmux): avoid autostart inside zed editor (#13220) 2025-07-21 18:37:09 +02:00
8 changed files with 16 additions and 10 deletions

View File

@@ -40,7 +40,7 @@ fi
# disable named-directories autocompletion
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
# Use caching so that commands like apt and dpkg complete are useable
# Use caching so that commands like apt and dpkg complete are usable
zstyle ':completion:*' use-cache yes
zstyle ':completion:*' cache-path $ZSH_CACHE_DIR

View File

@@ -11,6 +11,8 @@ plugins=(... alias-finder)
To enable it for every single command, set zstyle in your `~/.zshrc`.
If the user has installed `rg`([ripgrep](https://github.com/BurntSushi/ripgrep)), it will be used because it's faster. Otherwise, it will use the `grep` command.
```zsh
# ~/.zshrc
@@ -28,7 +30,7 @@ When you execute a command alias finder will look at your defined aliases and su
Running the un-aliased `git status` command:
```sh
╭─tim@fox ~/repo/gitopolis main
╭─tim@fox ~/repo/gitopolis main
╰─$ git status
gst='git status' # <=== shorter suggestion from alias-finder
@@ -40,7 +42,7 @@ nothing to commit, working tree clean
Running a shorter `git st` alias from `.gitconfig` that it suggested :
```sh
╭─tim@fox ~/repo/gitopolis main
╭─tim@fox ~/repo/gitopolis main
╰─$ git st
gs='git st' # <=== shorter suggestion from alias-finder
## main...origin/main
@@ -48,7 +50,7 @@ gs='git st' # <=== shorter suggestion from alias-finder
Running the shortest `gs` shell alias that it found:
```sh
╭─tim@fox ~/repo/gitopolis main
╭─tim@fox ~/repo/gitopolis main
╰─$ gs
# <=== no suggestions alias-finder because this is the shortest
## main...origin/main

View File

@@ -43,7 +43,11 @@ alias-finder() {
filter="^'?.{1,$((cmdLen - 1))}'?=" # some aliases is surrounded by single quotes
fi
alias | grep -E "$filter" | grep -E "=$finder"
if (( $+commands[rg] )); then
alias | rg "$filter" | rg "=$finder"
else
alias | grep -E "$filter" | grep -E "=$finder"
fi
if [[ $exact == true ]]; then
break # because exact case is only one

View File

@@ -272,7 +272,7 @@ _dnf5-repoquery() {
for v in enhance obsolete provide recommend require suggest supplement; do
opts+=( "--what${v}s=[limit to packages that $v specified capabilities]:list of capability: ")
done
# mutually exclusive formating options
# mutually exclusive formatting options
opts+=(
+ '(format)'
'--conflicts[display capabilities that the package conflicts with]'

View File

@@ -10,7 +10,7 @@ _dotnet_completion() {
compdef _dotnet_completion dotnet
# Aliases bellow are here for backwards compatibility
# Aliases below are here for backwards compatibility
# added by Shaun Tabone (https://github.com/xontab)
alias dn='dotnet new'

View File

@@ -86,7 +86,7 @@ function work_in_progress() {
# Aliases
# (sorted alphabetically by command)
# (order should follow README)
# (in some cases force the alisas order to match README, like for example gke and gk)
# (in some cases force the alias order to match README, like for example gke and gk)
#
alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'

View File

@@ -49,4 +49,4 @@ plugins=(... systemadmin)
| geteip | Gather information regarding an external IP address using [icanhazip.com](https://icanhazip.com) |
| getip | Determine the local IP Address with `ip addr` or `ifconfig` |
| clrz | Clear zombie processes |
| conssec | Show number of concurrent connections per second based on ngnix/access.log file or another log file if specified |
| conssec | Show number of concurrent connections per second based on nginx/access.log file or another log file if specified |

View File

@@ -188,7 +188,7 @@ function _tmux_directory_session() {
alias tds=_tmux_directory_session
# Autostart if not already in tmux and enabled.
if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" ]]; then
if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" && -z "$ZED_TERM" ]]; then
# Actually don't autostart if we already did and multiple autostarts are disabled.
if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]; then
export ZSH_TMUX_AUTOSTARTED=true