1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-15 23:08:16 +08:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Adam Šír
bc59fee62e
Merge a4a8968be1 into a79b37b954 2026-01-02 16:12:20 +01:00
Marc Cornellà
a79b37b954 Revert "fix(kubectl)!: change alias from kl to klog (#13204)"
This reverts commit 475b18f39a.
2025-12-30 09:48:43 +01:00
Daniel R. Neal
0f45f82c0a
feat(tmux): add 'to' alias for session attachment (#13479) 2025-12-22 13:31:21 +01:00
bretello
129aeee6bc
feat(clipboard): send value to tmux client when copying (#13451) 2025-12-22 13:20:24 +01:00
dependabot[bot]
3a73094983
chore(deps): bump github/codeql-action from 4.31.8 to 4.31.9 (#13486)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b168cd394...5d4e8d1aca)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-21 14:07:16 +01:00
Adam Šír
a4a8968be1
Merge branch 'ohmyzsh:master' into adamsir/git-checkout-interactive 2025-06-26 11:19:23 +02:00
Adam Šír
1b4703387d
Merge branch 'ohmyzsh:master' into adamsir/git-checkout-interactive 2024-05-09 12:07:54 +02:00
Adam Šír
2cf9ad072d
Update plugins/git-checkout-interactive/README.md
Co-authored-by: Olivia (Zoe) <zoe.i2k1@gmail.com>
2024-05-09 12:07:06 +02:00
Adam Sir
7ab8271cd9
limit output to 10 last branches; configurable 2024-02-28 11:28:36 +01:00
Adam Sir
09976595be
feat(plugin): git checkout interactive 2023-11-01 12:37:17 +01:00
8 changed files with 78 additions and 4 deletions

View File

@ -60,6 +60,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1b168cd39490f61582a9beae412bb7057a6b2c4e # v4.31.8
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
sarif_file: results.sarif

View File

@ -82,7 +82,7 @@ function detect-clipboard() {
function clipcopy() { cat "${1:-/dev/stdin}" | termux-clipboard-set; }
function clippaste() { termux-clipboard-get; }
elif [ -n "${TMUX:-}" ] && (( ${+commands[tmux]} )); then
function clipcopy() { tmux load-buffer "${1:--}"; }
function clipcopy() { tmux load-buffer -w "${1:--}"; }
function clippaste() { tmux save-buffer -; }
else
function _retry_clipboard_detection_or_fail() {

View File

@ -0,0 +1,15 @@
# lol
This plugin adds a command that lets you interactively switch between branches.
To use it, add `git-checkout-interactive` to the plugins array in your `.zshrc` file:
```zsh
plugins=(... git-checkout-interactive)
```
## Usage Examples
```sh
gci
```

View File

@ -0,0 +1,57 @@
#######################################
# git checkout interactive #
#######################################
function git-checkout-interactive() {
local ITEMS_TO_SHOW=10
# Get all branches sorted by committer date, along with their last commit hash
local branches
branches=$(git for-each-ref --count="$ITEMS_TO_SHOW" --sort=-committerdate --format='%(refname:short) %(objectname:short)' refs/heads/)
# Parse branches
local branch_list=()
local current_branch
current_branch=$(git rev-parse --abbrev-ref HEAD)
if [[ "$current_branch" == "" ]]; then
return 0
fi
while read -r branch hash; do
if [[ "$branch" == "$current_branch" ]]; then
echo "On branch $branch \n"
else
branch_list+=("$branch ($hash)")
fi
done <<< "$branches"
if (( ${#branch_list} == 0 )); then
echo "No other branches available."
return 0
else
echo "Select a branch to switch to:\n"
fi
# Display menu
local i=1
for branch in "${branch_list[@]}"; do
echo "($i) $branch"
((i++))
done
echo -n "\nPlease enter your choice: "
# Handle user input
while :; do
local choice
read -r choice
if (( choice > 0 && choice <= ${#branch_list[@]} )); then
local selected_branch="${branch_list[$((choice))]}"
local target_branch="${selected_branch//->}"
target_branch="${target_branch%% *}"
git checkout "$target_branch"
break
else
break
fi
done
}
alias gci="git-checkout-interactive || return 0"

View File

@ -90,7 +90,7 @@ plugins=(... kubectl)
| kga | `kubectl get all` | List all resources in ps format |
| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces |
| | | **Logs** |
| klog | `kubectl logs` | Print the logs for a container or resource |
| kl | `kubectl logs` | Print the logs for a container or resource |
| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) |
| | | **File copy** |
| kcp | `kubectl cp` | Copy files and directories to and from containers |

View File

@ -135,7 +135,7 @@ alias kga='kubectl get all'
alias kgaa='kubectl get all --all-namespaces'
# Logs
alias klog='kubectl logs'
alias kl='kubectl logs'
alias kl1h='kubectl logs --since 1h'
alias kl1m='kubectl logs --since 1m'
alias kl1s='kubectl logs --since 1s'

View File

@ -23,6 +23,7 @@ The plugin also supports the following:
| `tkss` | tmux kill-session -t | Terminate named running tmux session |
| `tksv` | tmux kill-server | Terminate all running tmux sessions |
| `tl` | tmux list-sessions | Displays a list of running tmux sessions |
| `to` | tmux new-session -A -s | Create or attach to a named tmux session |
| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session |
| `tmuxconf` | `$EDITOR $ZSH_TMUX_CONFIG` | Open .tmux.conf file with an editor |
| `ts` | tmux new-session -s | Create a new named tmux session |

View File

@ -81,6 +81,7 @@ alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
_build_tmux_alias "ta" "attach" "-t"
_build_tmux_alias "tad" "attach -d" "-t"
_build_tmux_alias "to" "new-session -A" "-s"
_build_tmux_alias "ts" "new-session" "-s"
_build_tmux_alias "tkss" "kill-session" "-t"