Compare commits

...

37 Commits

Author SHA1 Message Date
Jacopo De Simoi 4b184dd888 Force truecolor in urxvt 3 months ago
Jacopo De Simoi aa6a3ed1f7 Add a comment about dropbox 3 months ago
Jacopo De Simoi e93a52d7e2 Try to push to the fork only when working on the work-tree 3 months ago
Jacopo De Simoi de86cedf5e Force registering of async git_prompt_info 3 months ago
Jacopo De Simoi 963986dc83 Fix theme with the async git prompt 3 months ago
Jacopo De Simoi 6fff6a221f Fix branch not appearing in recent oh-my-zsh versions 3 months ago
Jacopo De Simoi 7375bf183d Push on upgrade 3 months ago
Jacopo De Simoi ad9d179248 Prevent stalling on remote mounts 3 months ago
Jacopo De Simoi a179a700f4 Fix issue with number of jobs not detected anymore 3 months ago
Jacopo De Simoi a3155676f8 Fix whitespace 3 months ago
Jacopo De Simoi aecf6d50f2 Tint the vertical bar according to exit code 3 months ago
Jacopo De Simoi 6af36fc9e6 Fix jobs counting 3 months ago
Jacopo De Simoi 4edbe9df70 Fix another typo (should fixup with previous commit) 3 months ago
Jacopo De Simoi a2fa71d295 Add git_commits_behind 3 months ago
Jacopo De Simoi a748434279 Add todo about exit status 3 months ago
Jacopo De Simoi 37d136dab6 Tint the # if root 3 months ago
Jacopo De Simoi 2a430b0373 add old single-line configuration 3 months ago
Jacopo De Simoi 4e4625c2b7 Use with solarized colorscheme 3 months ago
Jacopo De Simoi 8142ad706b Unsure of what this is 3 months ago
Jacopo De Simoi 04ca090d17 use PoP-like marks for number of jobs 3 months ago
Jacopo De Simoi 9c6d82ef79 Add number of jobs on the right 3 months ago
Jacopo De Simoi 926f87f2b7 Add commits ahead to prompt 3 months ago
Jacopo De Simoi 61bd1ff949 Add variation on gentoo theme 3 months ago
Jacopo De Simoi abdf5fcf8c do not mess with ssh-agent identites 3 months ago
Daniel R. Neal 0f45f82c0a
feat(tmux): add 'to' alias for session attachment (#13479) 3 months ago
bretello 129aeee6bc
feat(clipboard): send value to tmux client when copying (#13451) 3 months ago
dependabot[bot] 3a73094983
chore(deps): bump github/codeql-action from 4.31.8 to 4.31.9 (#13486) 3 months ago
Arvin Verain 95de26572e
revert(git): revert deprecation for `gg*` aliases (#13485) 3 months ago
NanoNova 945d89f7ae
feat(kubectl): add aliases for kustomization directories (#13033) 3 months ago
Yurii Liaskovets 8a231b1930
feat!: unify `auto-approve` aliases in `terraform` and `opentofu` (#12795) 3 months ago
Jérémy 475b18f39a
fix(kubectl)!: change alias from `kl` to `klog` (#13204) 3 months ago
Arvin Verain d4a62a2715
refactor(git)!: remove old deprecated aliases (#13149) 3 months ago
leggatron b5c449e1eb
feat(terraform): add `-parallelism=1` aliases (#13484) 3 months ago
dependabot[bot] 7192af5239
chore(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 (#13480) 3 months ago
dependabot[bot] 1fee750c3b
chore(deps): bump step-security/harden-runner from 2.13.3 to 2.14.0 (#13483) 3 months ago
dependabot[bot] 57781231bb
chore(deps): bump urllib3 in /.github/workflows/dependencies (#13482) 3 months ago
dependabot[bot] a4e15fdb16
chore(deps): bump github/codeql-action from 4.31.7 to 4.31.8 (#13481) 3 months ago
  1. 2
      .github/workflows/dependencies.yml
  2. 2
      .github/workflows/dependencies/requirements.txt
  3. 4
      .github/workflows/installer.yml
  4. 2
      .github/workflows/main.yml
  5. 2
      .github/workflows/project.yml
  6. 6
      .github/workflows/scorecard.yml
  7. 2
      lib/clipboard.zsh
  8. 4
      lib/git.zsh
  9. 45
      plugins/git/README.md
  10. 30
      plugins/git/git.plugin.zsh
  11. 4
      plugins/kubectl/README.md
  12. 6
      plugins/kubectl/kubectl.plugin.zsh
  13. 2
      plugins/opentofu/README.md
  14. 2
      plugins/opentofu/opentofu.plugin.zsh
  15. 1
      plugins/per-directory-history/per-directory-history.plugin.zsh
  16. 149
      plugins/per-directory-history/per-directory-history.plugin.zsh
  17. 6
      plugins/ssh-agent/ssh-agent.plugin.zsh
  18. 6
      plugins/terraform/README.md
  19. 6
      plugins/terraform/terraform.plugin.zsh
  20. 1
      plugins/tmux/README.md
  21. 1
      plugins/tmux/tmux.plugin.zsh
  22. 66
      themes/gentoo-wilder.zsh-theme
  23. 24
      themes/gentoo-wildersingleline.zsh-theme
  24. 6
      tools/upgrade.sh

@ -13,7 +13,7 @@ jobs:
contents: write # this is needed to push commits and branches
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

@ -4,4 +4,4 @@ idna==3.11
PyYAML==6.0.3
requests==2.32.5
semver==3.0.4
urllib3==2.6.0
urllib3==2.6.2

@ -26,7 +26,7 @@ jobs:
- macos-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
@ -47,7 +47,7 @@ jobs:
- test
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

@ -24,7 +24,7 @@ jobs:
if: github.repository == 'ohmyzsh/ohmyzsh'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit

@ -17,7 +17,7 @@ jobs:
if: github.repository == 'ohmyzsh/ohmyzsh'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Authenticate as @ohmyzsh

@ -36,7 +36,7 @@ jobs:
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
@ -53,13 +53,13 @@ jobs:
publish_results: true
- name: "Upload artifact"
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
sarif_file: results.sarif

@ -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() {

@ -162,11 +162,7 @@ if zstyle -t ':omz:alpha:lib:git' async-prompt \
# or any of the other prompt variables
function _defer_async_git_register() {
# Check if git_prompt_info is used in a prompt variable
case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
*(\$\(git_prompt_info\)|\`git_prompt_info\`)*)
_omz_register_handler _omz_git_prompt_info
;;
esac
case "${PS1}:${PS2}:${PS3}:${PS4}:${RPROMPT}:${RPS1}:${RPS2}:${RPS3}:${RPS4}" in
*(\$\(git_prompt_status\)|\`git_prompt_status\`)*)

@ -234,40 +234,26 @@ branch exists. We do this via the function `git_main_branch`.
These are aliases that have been removed, renamed, or otherwise modified in a way that may, or may not,
receive further support.
| Alias | Command | Modification |
| :------- | :-------------------------------------------------------- | :-------------------------------------------------------- |
| `gap` | `git add --patch` | New alias: `gapa`. |
| `gcl` | `git config --list` | New alias: `gcf`. |
| `gdc` | `git diff --cached` | New alias: `gdca`. |
| `gdt` | `git difftool` | No replacement. |
| `ggpull` | `git pull origin $(current_branch)` | New alias: `ggl`. (`ggpull` still exists for now though.) |
| `ggpur` | `git pull --rebase origin $(current_branch)` | New alias: `ggu`. (`ggpur` still exists for now though.) |
| `ggpush` | `git push origin $(current_branch)` | New alias: `ggp`. (`ggpush` still exists for now though.) |
| `gk` | `gitk --all --branches` | Now aliased to `gitk --all --branches`. |
| `glg` | `git log --stat --max-count=10` | Now aliased to `git log --stat --color`. |
| `glgg` | `git log --graph --max-count=10` | Now aliased to `git log --graph --color`. |
| `gwc` | `git whatchanged -p --abbrev-commit --pretty = medium` | New alias: `gwch`. |
| `gup` | `git pull --rebase` | now alias `gpr` |
| `gupv` | `git pull --rebase -v` | now alias `gprv` |
| `gupa` | `git pull --rebase --autostash` | now alias `gpra` |
| `gupav` | `git pull --rebase --autostash -v` | now alias `gprav` |
| `gupom` | `git pull --rebase origin $(git_main_branch)` | now alias `gprom` |
| `gupomi` | `git pull --rebase=interactive origin $(git_main_branch)` | now alias `gpromi` |
| Alias | Command | Modification |
| :------- | :-------------------------------------------------------- | :-----------------------------------------------------|
| `gap` | `git add --patch` | New alias: `gapa` |
| `gcl` | `git config --list` | New alias: `gcf` |
| `gdt` | `git difftool` | No replacement |
## Functions
### Current
| Command | Description |
| :----------------------- | :-------------------------------------------------------------------------------------------------------------- |
| `current_branch` | Returns the name of the current branch. |
| `git_current_user_email` | Returns the `user.email` config value. (Lives in `lib/git.zsh`.) |
| `git_current_user_name` | Returns the `user.name` config value. (Lives in `lib/git.zsh`.) |
| `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 branches |
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
| Command | Description |
| :----------------------- | :------------------------------------------------------------------------------------------------------------- |
| `git_current_branch` | Returns the name of the current branch (Lives in `lib/git.zsh`) |
| `git_current_user_email` | Returns the `user.email` config value (Lives in `lib/git.zsh`) |
| `git_current_user_name` | Returns the `user.name` config value (Lives in `lib/git.zsh`) |
| `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 branches |
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
### Work in Progress (WIP)
@ -287,4 +273,3 @@ Note that `gwip` and `gunwip` are aliases, but are also documented here to group
| Command | Description | Reason |
| :------------------- | :-------------------------------------- | :--------------------------------------------------------------- |
| `current_repository` | Return the names of the current remotes | Didn't work properly. Use `git remote -v` instead (`grv` alias). |

@ -8,14 +8,6 @@ git_version="${${(As: :)$(git version 2>/dev/null)}[3]}"
# (order should follow README)
#
# The name of the current branch
# Back-compatibility wrapper for when this function was defined here in
# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
# to fix the core -> git plugin dependency.
function current_branch() {
git_current_branch
}
# Check for develop and similarly named branches
function git_develop_branch() {
command git rev-parse --git-dir &>/dev/null || return
@ -427,19 +419,13 @@ alias gke='\gitk --all $(git log --walk-reflogs --pretty=%h) &!'
unset git_version
# Logic for adding warnings on deprecated aliases
local old_alias new_alias
for old_alias new_alias (
# TODO(2023-10-19): remove deprecated `git pull --rebase` aliases
gup gpr
gupv gprv
gupa gpra
gupav gprav
gupom gprom
gupomi gpromi
# Logic for adding warnings on deprecated aliases or functions
local old_name new_name
for old_name new_name (
current_branch git_current_branch
); do
aliases[$old_alias]="
print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_alias}%F{yellow}' is a deprecated alias, using '%F{green}${new_alias}%F{yellow}' instead.%f\"
$new_alias"
aliases[$old_name]="
print -Pu2 \"%F{yellow}[oh-my-zsh] '%F{red}${old_name}%F{yellow}' is deprecated, using '%F{green}${new_name}%F{yellow}' instead.%f\"
$new_name"
done
unset old_alias new_alias
unset old_name new_name

@ -16,6 +16,7 @@ plugins=(... kubectl)
| k | `kubectl` | The kubectl command |
| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces |
| kaf | `kubectl apply -f` | Apply a YML file |
| kapk | `kubectl apply -k` | Apply a kustomization directory |
| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container |
| | | **Manage configuration quickly to switch contexts between local, dev and staging** |
| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file |
@ -26,6 +27,7 @@ plugins=(... kubectl)
| | | **General aliases** |
| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector |
| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument |
| kdelk | `kubectl delete -k` | Delete all resources defined in a kustomization directory |
| kge | `kubectl get events --sort-by=".lastTimestamp"` | Get events (sorted by timestamp) |
| kgew | `kubectl get events --watch --sort-by=".lastTimestamp"` | Get events and watch as they occur (sorted by timestamp) |
| | | **Pod management** |
@ -88,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** |
| kl | `kubectl logs` | Print the logs for a container or resource |
| klog | `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 |

@ -21,6 +21,9 @@ alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca'
# Apply a YML file
alias kaf='kubectl apply -f'
# Apply a kustomization directory
alias kapk='kubectl apply -k'
# Drop into an interactive terminal on a container
alias keti='kubectl exec -t -i'
@ -36,6 +39,7 @@ alias kcgc='kubectl config get-contexts'
# General aliases
alias kdel='kubectl delete'
alias kdelf='kubectl delete -f'
alias kdelk='kubectl delete -k'
alias kge='kubectl get events --sort-by=".lastTimestamp"'
alias kgew='kubectl get events --sort-by=".lastTimestamp" --watch'
@ -131,7 +135,7 @@ alias kga='kubectl get all'
alias kgaa='kubectl get all --all-namespaces'
# Logs
alias kl='kubectl logs'
alias klog='kubectl logs'
alias kl1h='kubectl logs --since 1h'
alias kl1m='kubectl logs --since 1m'
alias kl1s='kubectl logs --since 1s'

@ -19,7 +19,7 @@ plugins=(... opentofu)
|--------|------------------------------|
| `tt` | `tofu` |
| `tta` | `tofu apply` |
| `ttaa` | `tofu apply -auto-approve` |
| `tta!` | `tofu apply -auto-approve` |
| `ttc` | `tofu console` |
| `ttd` | `tofu destroy` |
| `ttd!` | `tofu destroy -auto-approve` |

@ -29,7 +29,7 @@ function tofu_version_prompt_info() {
alias tt='tofu'
alias tta='tofu apply'
alias ttaa='tofu apply -auto-approve'
alias tta!='tofu apply -auto-approve'
alias ttc='tofu console'
alias ttd='tofu destroy'
alias ttd!='tofu destroy -auto-approve'

@ -0,0 +1,149 @@
#!/usr/bin/env zsh
#
# This is a implementation of per directory history for zsh, some
# implementations of which exist in bash[1,2]. It also implements
# a per-directory-history-toggle-history function to change from using the
# directory history to using the global history. In both cases the history is
# always saved to both the global history and the directory history, so the
# toggle state will not effect the saved histories. Being able to switch
# between global and directory histories on the fly is a novel feature as far
# as I am aware.
#
#-------------------------------------------------------------------------------
# Configuration
#-------------------------------------------------------------------------------
#
# HISTORY_BASE a global variable that defines the base directory in which the
# directory histories are stored
#
#-------------------------------------------------------------------------------
# History
#-------------------------------------------------------------------------------
#
# The idea/inspiration for a per directory history is from Stewart MacArthur[1]
# and Dieter[2], the implementation idea is from Bart Schaefer on the the zsh
# mailing list[3]. The implementation is by Jim Hester in September 2012.
#
# [1]: http://www.compbiome.com/2010/07/bash-per-directory-bash-history.html
# [2]: http://dieter.plaetinck.be/per_directory_bash
# [3]: http://www.zsh.org/mla/users/1997/msg00226.html
#
################################################################################
#
# Copyright (c) 2012 Jim Hester
#
# This software is provided 'as-is', without any express or implied warranty.
# In no event will the authors be held liable for any damages arising from the
# use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not claim
# that you wrote the original software. If you use this software in a product,
# an acknowledgment in the product documentation would be appreciated but is
# not required.
#
# 2. Altered source versions must be plainly marked as such, and must not be
# misrepresented as being the original software.
#
# 3. This notice may not be removed or altered from any source distribution..
#
################################################################################
#-------------------------------------------------------------------------------
# configuration, the base under which the directory histories are stored
#-------------------------------------------------------------------------------
[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history"
#-------------------------------------------------------------------------------
# toggle global/directory history used for searching - ctrl-G by default
#-------------------------------------------------------------------------------
function per-directory-history-toggle-history() {
if [[ $_per_directory_history_is_global == true ]]; then
_per-directory-history-set-directory-history
print -n "\nusing local history"
else
_per-directory-history-set-global-history
print -n "\nusing global history"
fi
zle .push-line
zle .accept-line
}
autoload per-directory-history-toggle-history
zle -N per-directory-history-toggle-history
bindkey '^G' per-directory-history-toggle-history
#-------------------------------------------------------------------------------
# implementation details
#-------------------------------------------------------------------------------
_per_directory_history_directory="$HISTORY_BASE${PWD:A}/history"
function _per-directory-history-change-directory() {
_per_directory_history_directory="$HISTORY_BASE${PWD:A}/history"
mkdir -p ${_per_directory_history_directory:h}
if [[ $_per_directory_history_is_global == false ]]; then
#save to the global history
fc -AI $HISTFILE
#save history to previous file
local prev="$HISTORY_BASE${OLDPWD:A}/history"
mkdir -p ${prev:h}
fc -AI $prev
#discard previous directory's history
local original_histsize=$HISTSIZE
HISTSIZE=0
HISTSIZE=$original_histsize
#read history in new file
if [[ -e $_per_directory_history_directory ]]; then
fc -R $_per_directory_history_directory
fi
fi
}
function _per-directory-history-addhistory() {
print -Sr -- ${1%%$'\n'}
fc -p $_per_directory_history_directory
}
function _per-directory-history-set-directory-history() {
if [[ $_per_directory_history_is_global == true ]]; then
fc -AI $HISTFILE
local original_histsize=$HISTSIZE
HISTSIZE=0
HISTSIZE=$original_histsize
if [[ -e "$_per_directory_history_directory" ]]; then
fc -R "$_per_directory_history_directory"
fi
fi
_per_directory_history_is_global=false
}
function _per-directory-history-set-global-history() {
if [[ $_per_directory_history_is_global == false ]]; then
fc -AI $_per_directory_history_directory
local original_histsize=$HISTSIZE
HISTSIZE=0
HISTSIZE=$original_histsize
if [[ -e "$HISTFILE" ]]; then
fc -R "$HISTFILE"
fi
fi
_per_directory_history_is_global=true
}
#add functions to the exec list for chpwd and zshaddhistory
chpwd_functions=(${chpwd_functions[@]} "_per-directory-history-change-directory")
zshaddhistory_functions=(${zshaddhistory_functions[@]} "_per-directory-history-addhistory")
#start in directory mode
mkdir -p ${_per_directory_history_directory:h}
_per_directory_history_is_global=true
_per-directory-history-set-directory-history

@ -74,8 +74,8 @@ function _add_identities() {
fi
# pass extra arguments to ssh-add
local args
zstyle -a :omz:plugins:ssh-agent ssh-add-args args
# local args
# zstyle -a :omz:plugins:ssh-agent ssh-add-args args
# if ssh-agent quiet mode, pass -q to ssh-add
zstyle -t :omz:plugins:ssh-agent quiet && args=(-q $args)
@ -93,7 +93,7 @@ function _add_identities() {
fi
fi
ssh-add "${args[@]}" ${^not_loaded}
# Ssh-add "${args[@]}" ${^not_loaded}
}
# Add a nifty symlink for screen/tmux if agent forwarding is enabled

@ -16,13 +16,15 @@ plugins=(... terraform)
## Aliases
| Alias | Command |
| ------- | -------------------------------------- |
|---------|----------------------------------------|
| `tf` | `terraform` |
| `tfa` | `terraform apply` |
| `tfaa` | `terraform apply -auto-approve` |
| `tfa!` | `terraform apply -auto-approve` |
| `tfap` | `terraform apply -parallelism=1` |
| `tfc` | `terraform console` |
| `tfd` | `terraform destroy` |
| `tfd!` | `terraform destroy -auto-approve` |
| `tfdp` | `terraform destroy -parallelism=1` |
| `tff` | `terraform fmt` |
| `tffr` | `terraform fmt -recursive` |
| `tfi` | `terraform init` |

@ -17,10 +17,12 @@ function tf_version_prompt_info() {
alias tf='terraform'
alias tfa='terraform apply'
alias tfaa='terraform apply -auto-approve'
alias tfa!='terraform apply -auto-approve'
alias tfap='terraform apply -parallelism=1'
alias tfc='terraform console'
alias tfd='terraform destroy'
alias 'tfd!'='terraform destroy -auto-approve'
alias tfd!='terraform destroy -auto-approve'
alias tfdp='terraform destroy -parallelism=1'
alias tff='terraform fmt'
alias tffr='terraform fmt -recursive'
alias tfi='terraform init'

@ -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 |

@ -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"

@ -0,0 +1,66 @@
#! /bin/zsh
jobs_marker=( )
# Solarized
solarized_base03=$'\e[1;30m'
solarized_base02=$'\e[0;30m'
solarized_base01=$'\e[1;32m'
solarized_base00=$'\e[1;33m'
solarized_base0=$'\e[1;34m'
solarized_base1=$'\e[1;36m'
solarized_base2=$'\e[0;37m'
solarized_base3=$'\e[1;37m'
solarized_yellow=$'\e[0;33m'
solarized_orange=$'\e[1;31m'
solarized_red=$'\e[0;31m'
solarized_magenta=$'\e[0;35m'
solarized_violet=$'\e[1;35m'
solarized_blue=$'\e[0;34m'
solarized_cyan=$'\e[0;36m'
solarized_green=$'\e[0;32m'
dir_tint=$solarized_blue
jobs_tint=$solarized_green
root_tint=$solarized_magenta
function prompt_char {
if [ $UID -eq 0 ]; then echo "%{$root_tint%}#%{$reset_color%}" && return;
fi
is_curr_dir_remote || {git branch >/dev/null 2>/dev/null && echo '±' && return}
echo '%#'
}
function is_curr_dir_remote {
[[ $(pwd) =~ .*nextcloud.* ]] # || [[ $(pwd) =~ .*dropbox.* ]]
}
function git_stuff {
is_curr_dir_remote || echo -n $(git_prompt_info)$(git_commits_ahead)$(git_commits_behind)
}
# newline ⎡⎧⎛⎢
return_code_vertical_top="%(?.%{$reset_color%}.%{$solarized_magenta%})⎥%{$reset_color%} "
return_code_vertical="%(?.%{$reset_color%}.%{$solarized_magenta%})⎥%{$reset_color%} "
PROMPT="
$return_code_vertical_top"
# add username only from remote
[[ "$SSH_CONNECTION" != '' ]] && PROMPT+=$'%(!.%{\e[0;34m%}%}.%{\e[0;32m%}%}%n@)%m '
PROMPT+=$'%{$dir_tint%}%(!.%1~.%~)%{$reset_color%}$(git_stuff)
${return_code_vertical}$(prompt_char)%{$reset_color%} '
RPROMPT=$'%{$jobs_tint%}$jobs_marker[${(%):-%j}]%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{\033[1;32m%} · %{\033[0;36m%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[blue]%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{\e[0;35m%} !"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX="%{\033[0;36m%} "
ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX="↑%{$fg_bold[blue]%}"
ZSH_THEME_GIT_COMMITS_BEHIND_PREFIX="%{\033[0;36m%} "
ZSH_THEME_GIT_COMMITS_BEHIND_SUFFIX="↓%{$fg_bold[blue]%}"

@ -0,0 +1,24 @@
function prompt_char {
if [ $UID -eq 0 ]; then echo "#" && return;
fi
git branch >/dev/null 2>/dev/null && echo '±' && return
echo '%#'
}
function get_nr_jobs() {
repeat $(jobs | wc -l) printf '▶'
}
PROMPT='
%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%}%n@)%m %{$fg_bold[blue]%}%(!.%1~.%~)$(git_prompt_info)$(git_commits_ahead)
$(prompt_char)%{$reset_color%} '
RPROMPT='%{$fg_bold[green]%}$(get_nr_jobs)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{\033[0;36m%}·"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg_bold[blue]%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_GIT_COMMITS_AHEAD_PREFIX="%{\033[0;36m%} "
ZSH_THEME_GIT_COMMITS_AHEAD_SUFFIX="↑%{$fg_bold[blue]%}"

@ -134,6 +134,7 @@ supports_truecolor() {
tmux-truecolor |\
linux-truecolor |\
xterm-truecolor |\
rxvt-unicode |\
screen-truecolor) return 0 ;;
esac
@ -252,6 +253,11 @@ if LANG= git pull --quiet --rebase $remote $branch; then
# Save the commit prior to updating
git config oh-my-zsh.lastVersion "$last_commit"
# Push to fork
if [[ $remote == upstream ]]; then
git push --force origin $branch
fi
# Print changelog to the terminal
if [[ $interactive == true && $verbose_mode == default ]]; then
ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" HEAD "$last_commit"

Loading…
Cancel
Save