1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-02-13 05:59:46 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Vishal Sharma
0da416986a
fix(ssh-agent): add error message if ~/.ssh is not found (#11929)
Closes #11829 

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2023-10-18 20:14:47 +02:00
Marc Cornellà
8152dc673b
fix(git): move squash-merged branch deletion from gbda to gbds function (#11991) 2023-10-18 20:01:58 +02:00
Jérémy
b696288337
feat(kubectl): add kgdsa alias (#11863) 2023-10-18 19:27:47 +02:00
Patryk Krawaczyński
f10cd5281d
feat(history): add hl alias (#11990) 2023-10-18 13:59:28 +02:00
Vyacheslav Scherbinin
d3112d67a3
feat(vscode): allow arguments to vsc alias (#11903)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
2023-10-18 09:18:05 +02:00
8 changed files with 24 additions and 5 deletions

View File

@ -250,7 +250,8 @@ receive further support.
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. |
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. |
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
| `gbda` | Deletes all merged and squash-merged branches |
| `gbda` | Deletes all merged branches |
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
### Work in Progress (WIP)

View File

@ -128,11 +128,13 @@ alias gba='git branch --all'
alias gbd='git branch --delete'
alias gbD='git branch --delete --force'
# Copied and modified from James Roeder (jmaroeder) under MIT License
# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish
function gbda() {
git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null
}
# Copied and modified from James Roeder (jmaroeder) under MIT License
# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish
function gbds() {
local default_branch=$(git_main_branch)
(( ! $? )) || default_branch=$(git_develop_branch)

View File

@ -13,5 +13,6 @@ plugins=(... history)
| Alias | Command | Description |
|-------|----------------------|------------------------------------------------------------------|
| `h` | `history` | Prints your command history |
| `hl` | `history \| less` | Pipe history output to less to search and navigate it easily |
| `hs` | `history \| grep` | Use grep to search your command history |
| `hsi` | `history \| grep -i` | Use grep to do a case-insensitive search of your command history |

View File

@ -1,3 +1,4 @@
alias h='history'
alias hl='history | less'
alias hs='history | grep'
alias hsi='history | grep -i'

View File

@ -162,6 +162,7 @@ alias kdelsa="kubectl delete sa"
# DaemonSet management.
alias kgds='kubectl get daemonset'
alias kgdsa='kubectl get daemonset --all-namespaces'
alias kgdsw='kgds --watch'
alias keds='kubectl edit daemonset'
alias kdds='kubectl describe daemonset'

View File

@ -13,6 +13,11 @@ function _start_agent() {
fi
fi
if [[ ! -d "$HOME/.ssh" ]]; then
echo "[oh-my-zsh] ssh-agent plugin requires ~/.ssh directory"
return 1
fi
# Set a maximum lifetime for identities added to ssh-agent
local lifetime
zstyle -s :omz:plugins:ssh-agent lifetime lifetime

View File

@ -53,6 +53,7 @@ source $ZSH/oh-my-zsh.sh
| Alias | Command | Description |
| ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| vsc | code . | Open the current folder in VS code |
| vsc `dir` | code `dir` | Open passed folder in VS code |
| vsca `dir` | code --add `dir` | Add folder(s) to the last active window |
| vscd `file` `file` | code --diff `file` `file` | Compare two files with each other. |
| vscg `file:line[:char]` | code --goto `file:line[:char]` | Open a file at the path on the specified line and character position. |

View File

@ -23,7 +23,14 @@ if [[ -z "$VSCODE" ]]; then
fi
fi
alias vsc="$VSCODE ."
function vsc {
if (( $# )); then
$VSCODE $@
else
$VSCODE .
fi
}
alias vsca="$VSCODE --add"
alias vscd="$VSCODE --diff"
alias vscg="$VSCODE --goto"