mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 05:59:46 +08:00
Compare commits
5 Commits
96c976637a
...
0da416986a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0da416986a | ||
|
|
8152dc673b | ||
|
|
b696288337 | ||
|
|
f10cd5281d | ||
|
|
d3112d67a3 |
@ -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)
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -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 |
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
alias h='history'
|
||||
alias hl='history | less'
|
||||
alias hs='history | grep'
|
||||
alias hsi='history | grep -i'
|
||||
|
||||
@ -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'
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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. |
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user