1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-19 00:37:35 +08:00

Compare commits

...

4 Commits

Author SHA1 Message Date
whisperity
b0204f7839
feat(git): add gmff, gprum(i), grbum aliases to work with upstream remotes (#11428) 2024-08-15 17:53:03 +02:00
Marc Cornellà
f30df6c855
docs: document disclaimer about theme appearance 2024-08-15 17:04:50 +02:00
Marc Cornellà
c13795d4c4
feat(git)!: ask for confirmation in gpf alias (#10169)
- Rename `git push --force-with-lease ...` to `gpff`
- Add a y/n confirmation prompt to `gpf` before running `git push --force-with-lease ...`

BREAKING CHANGE: this change adds a confirmation prompt to the `gpf` alias before
running the potentially destructive `git push --force-with-lease` command. If you
want to force-run the command without having to confirm it, run `gpff`.
2024-08-15 16:48:03 +02:00
Marc Cornellà
d26c4a2766
chore(tmux): add link to iTerm2 integration docs 2024-08-15 16:26:46 +02:00
4 changed files with 43 additions and 22 deletions

View File

@ -167,7 +167,15 @@ ZSH_THEME="agnoster" # (this is one of the fancy ones)
# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
```
_Note: many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly. Without them, these themes will render [weird prompt symbols](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt)_
> [!NOTE]
> You will many times see screenshots for a zsh theme, and try it out, and find that it doesn't look the same for you.
>
> This is because many themes require installing a [Powerline Font](https://github.com/powerline/fonts) or a [Nerd Font](https://github.com/ryanoasis/nerd-fonts) in order to render properly.
> Without them, these themes will render weird prompt symbols. Check out [the FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-have-a-weird-character-in-my-prompt) for more information.
>
> Also, beware that themes only control what your prompt looks like. This is, the text you see before or after your cursor, where you'll type your commands.
> Themes don't control things such as the colors of your terminal window (known as _color scheme_) or the font of your terminal. These are settings that you can change in your terminal emulator.
> For more information, see [what is a zsh theme](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#what-is-a-zsh-theme).
Open up a new terminal window and your prompt should look something like this:

View File

@ -89,7 +89,7 @@ plugins=(... git)
| `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` |
| `gdt` | `git diff-tree --no-commit-id --name-only -r` |
| `gf` | `git fetch` |
| `gfa` | `git fetch --all --tags --prune` |
| `gfa` | `git fetch --all --tags --prune` |
| `gfo` | `git fetch origin` |
| `gg` | `git gui citool` |
| `gga` | `git gui citool --amend` |
@ -114,6 +114,7 @@ plugins=(... git)
| `gma` | `git merge --abort` |
| `gmc` | `git merge --continue` |
| `gms` | `git merge --squash` |
| `gmff` | `git merge --ff-only` |
| `gmom` | `git merge origin/$(git_main_branch)` |
| `gmum` | `git merge upstream/$(git_main_branch)` |
| `gmtl` | `git mergetool --no-prompt` |
@ -125,6 +126,8 @@ plugins=(... git)
| `gprav` | `git pull --rebase --autostash -v` |
| `gprom` | `git pull --rebase origin $(git_main_branch)` |
| `gpromi` | `git pull --rebase=interactive origin $(git_main_branch)` |
| `gprum` | `git pull --rebase upstream $(git_main_branch)` |
| `gprumi` | `git pull --rebase=interactive upstream $(git_main_branch)` |
| `ggpull` | `git pull origin "$(git_current_branch)"` |
| `ggl` | `git pull origin $(current_branch)` |
| `gluc` | `git pull upstream $(git_current_branch)` |
@ -133,8 +136,10 @@ plugins=(... git)
| `gpd` | `git push --dry-run` |
| `gpf!` | `git push --force` |
| `ggf` | `git push --force origin $(current_branch)` |
| `gpf` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` |
| `gpf` | On Git < 2.30: `git push --force-with-lease` |
| `gpf` | On Git >= 2.30: after confirmation, `git push --force-with-lease --force-if-includes` |
| `gpf` | On Git < 2.30: after confirmation, `git push --force-with-lease` |
| `gpff` | On Git >= 2.30: `git push --force-with-lease --force-if-includes` |
| `gpff` | On Git < 2.30: `git push --force-with-lease` |
| `ggfl` | `git push --force-with-lease origin $(current_branch)` |
| `gpsup` | `git push --set-upstream origin $(git_current_branch)` |
| `gpsupf` | On Git >= 2.30: `git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes` |
@ -154,6 +159,7 @@ plugins=(... git)
| `grbd` | `git rebase $(git_develop_branch)` |
| `grbm` | `git rebase $(git_main_branch)` |
| `grbom` | `git rebase origin/$(git_main_branch)` |
| `grbum` | `git rebase upstream/$(git_main_branch)` |
| `grf` | `git reflog` |
| `gr` | `git remote` |
| `grv` | `git remote --verbose` |

View File

@ -255,6 +255,7 @@ alias gm='git merge'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias gms="git merge --squash"
alias gmff="git merge --ff-only"
alias gmom='git merge origin/$(git_main_branch)'
alias gmum='git merge upstream/$(git_main_branch)'
alias gmtl='git mergetool --no-prompt'
@ -274,6 +275,8 @@ compdef _git ggu=git-checkout
alias gprom='git pull --rebase origin $(git_main_branch)'
alias gpromi='git pull --rebase=interactive origin $(git_main_branch)'
alias gprum='git pull --rebase upstream $(git_main_branch)'
alias gprumi='git pull --rebase=interactive upstream $(git_main_branch)'
alias ggpull='git pull origin "$(git_current_branch)"'
function ggl() {
@ -297,10 +300,13 @@ function ggf() {
}
compdef _git ggf=git-checkout
alias gpf!='git push --force'
alias 'gpf!'='git push --force'
is-at-least 2.30 "$git_version" \
&& alias gpf='git push --force-with-lease --force-if-includes' \
|| alias gpf='git push --force-with-lease'
&& alias gpf='read -k 1 -q "?Continue force-push? [y/N] " && echo && git push --force-with-lease --force-if-includes' \
|| alias gpf='read -k 1 -q "?Continue force-push? [y/N] " && echo && git push --force-with-lease'
is-at-least 2.30 "$git_version" \
&& alias gpff='git push --force-with-lease --force-if-includes' \
|| alias gpff='git push --force-with-lease'
function ggfl() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
@ -337,6 +343,7 @@ alias grbs='git rebase --skip'
alias grbd='git rebase $(git_develop_branch)'
alias grbm='git rebase $(git_main_branch)'
alias grbom='git rebase origin/$(git_main_branch)'
alias grbum='git rebase upstream/$(git_main_branch)'
alias grf='git reflog'
alias gr='git remote'
alias grv='git remote --verbose'

View File

@ -29,18 +29,18 @@ The plugin also supports the following:
## Configuration Variables
| Variable | Description |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) |
| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) |
| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) |
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) |
| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled |
| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) |
| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) |
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) |
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) |
| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
| Variable | Description |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) |
| `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) |
| `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) |
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`, `$XDG_CONFIG_HOME/tmux/tmux.conf`) |
| `ZSH_TMUX_DEFAULT_SESSION_NAME` | Set tmux default session name when autostart is enabled |
| `ZSH_TMUX_AUTONAME_SESSION` | Automatically name new sessions based on the basename of `$PWD` (default: `false`) |
| `ZSH_TMUX_DETACHED` | Set the detached mode (default: `false`) |
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux` if available, `screen` otherwise) |
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` if available, `screen-256color` otherwise) |
| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for [iTerm2 tmux integration](https://iterm2.com/documentation-tmux-integration.html) (default: `false`) |
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |