mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-12 05:49:47 +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_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. |
|
| `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. |
|
| `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)
|
### Work in Progress (WIP)
|
||||||
|
|
||||||
|
|||||||
@ -128,11 +128,13 @@ alias gba='git branch --all'
|
|||||||
alias gbd='git branch --delete'
|
alias gbd='git branch --delete'
|
||||||
alias gbD='git branch --delete --force'
|
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() {
|
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
|
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)
|
local default_branch=$(git_main_branch)
|
||||||
(( ! $? )) || default_branch=$(git_develop_branch)
|
(( ! $? )) || default_branch=$(git_develop_branch)
|
||||||
|
|
||||||
|
|||||||
@ -13,5 +13,6 @@ plugins=(... history)
|
|||||||
| Alias | Command | Description |
|
| Alias | Command | Description |
|
||||||
|-------|----------------------|------------------------------------------------------------------|
|
|-------|----------------------|------------------------------------------------------------------|
|
||||||
| `h` | `history` | Prints your command history |
|
| `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 |
|
| `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 |
|
| `hsi` | `history \| grep -i` | Use grep to do a case-insensitive search of your command history |
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
alias h='history'
|
alias h='history'
|
||||||
|
alias hl='history | less'
|
||||||
alias hs='history | grep'
|
alias hs='history | grep'
|
||||||
alias hsi='history | grep -i'
|
alias hsi='history | grep -i'
|
||||||
|
|||||||
@ -162,6 +162,7 @@ alias kdelsa="kubectl delete sa"
|
|||||||
|
|
||||||
# DaemonSet management.
|
# DaemonSet management.
|
||||||
alias kgds='kubectl get daemonset'
|
alias kgds='kubectl get daemonset'
|
||||||
|
alias kgdsa='kubectl get daemonset --all-namespaces'
|
||||||
alias kgdsw='kgds --watch'
|
alias kgdsw='kgds --watch'
|
||||||
alias keds='kubectl edit daemonset'
|
alias keds='kubectl edit daemonset'
|
||||||
alias kdds='kubectl describe daemonset'
|
alias kdds='kubectl describe daemonset'
|
||||||
|
|||||||
@ -13,6 +13,11 @@ function _start_agent() {
|
|||||||
fi
|
fi
|
||||||
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
|
# Set a maximum lifetime for identities added to ssh-agent
|
||||||
local lifetime
|
local lifetime
|
||||||
zstyle -s :omz:plugins:ssh-agent lifetime lifetime
|
zstyle -s :omz:plugins:ssh-agent lifetime lifetime
|
||||||
|
|||||||
@ -31,7 +31,7 @@ the Command Palette via (F1 or ⇧⌘P) and type shell command to find the Shell
|
|||||||
|
|
||||||
## Using multiple flavours
|
## Using multiple flavours
|
||||||
|
|
||||||
If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can
|
If for any reason, you ever require to use multiple flavours of VS Code i.e. VS Code (stable) and VS Code Insiders, you can
|
||||||
manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines).
|
manually specify the flavour's executable. Add the following line to the .zshrc file (between the `ZSH_THEME` and the `plugins=()` lines).
|
||||||
This will make the plugin use your manually defined executable.
|
This will make the plugin use your manually defined executable.
|
||||||
|
|
||||||
@ -53,6 +53,7 @@ source $ZSH/oh-my-zsh.sh
|
|||||||
| Alias | Command | Description |
|
| Alias | Command | Description |
|
||||||
| ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------- |
|
| ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------- |
|
||||||
| vsc | code . | Open the current folder in VS code |
|
| 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 |
|
| 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. |
|
| 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. |
|
| 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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias vsc="$VSCODE ."
|
function vsc {
|
||||||
|
if (( $# )); then
|
||||||
|
$VSCODE $@
|
||||||
|
else
|
||||||
|
$VSCODE .
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
alias vsca="$VSCODE --add"
|
alias vsca="$VSCODE --add"
|
||||||
alias vscd="$VSCODE --diff"
|
alias vscd="$VSCODE --diff"
|
||||||
alias vscg="$VSCODE --goto"
|
alias vscg="$VSCODE --goto"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user