mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-04-19 18:42:44 +00:00
Merge branch 'ohmyzsh:master' into feat/docker-stats-alias
This commit is contained in:
commit
167e8ffed7
|
@ -26,7 +26,7 @@ autoload -Uz is-at-least
|
||||||
# This API is subject to change and optimization. Rely on it at your own risk.
|
# This API is subject to change and optimization. Rely on it at your own risk.
|
||||||
|
|
||||||
function _omz_register_handler {
|
function _omz_register_handler {
|
||||||
setopt localoptions noksharrays
|
setopt localoptions noksharrays unset
|
||||||
typeset -ga _omz_async_functions
|
typeset -ga _omz_async_functions
|
||||||
# we want to do nothing if there's no $1 function or we already set it up
|
# we want to do nothing if there's no $1 function or we already set it up
|
||||||
if [[ -z "$1" ]] || (( ! ${+functions[$1]} )) \
|
if [[ -z "$1" ]] || (( ! ${+functions[$1]} )) \
|
||||||
|
@ -44,6 +44,7 @@ function _omz_register_handler {
|
||||||
|
|
||||||
# Set up async handlers and callbacks
|
# Set up async handlers and callbacks
|
||||||
function _omz_async_request {
|
function _omz_async_request {
|
||||||
|
setopt localoptions noksharrays unset
|
||||||
local -i ret=$?
|
local -i ret=$?
|
||||||
typeset -gA _OMZ_ASYNC_FDS _OMZ_ASYNC_PIDS _OMZ_ASYNC_OUTPUT
|
typeset -gA _OMZ_ASYNC_FDS _OMZ_ASYNC_PIDS _OMZ_ASYNC_OUTPUT
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ fi
|
||||||
|
|
||||||
# Runs before showing the prompt
|
# Runs before showing the prompt
|
||||||
function omz_termsupport_precmd {
|
function omz_termsupport_precmd {
|
||||||
[[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return
|
[[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return 0
|
||||||
title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE"
|
title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +145,7 @@ esac
|
||||||
# Identifies the directory using a file: URI scheme, including
|
# Identifies the directory using a file: URI scheme, including
|
||||||
# the host name to disambiguate local vs. remote paths.
|
# the host name to disambiguate local vs. remote paths.
|
||||||
function omz_termsupport_cwd {
|
function omz_termsupport_cwd {
|
||||||
|
setopt localoptions unset
|
||||||
# Percent-encode the host and path names.
|
# Percent-encode the host and path names.
|
||||||
local URL_HOST URL_PATH
|
local URL_HOST URL_PATH
|
||||||
URL_HOST="$(omz_urlencode -P $HOST)" || return 1
|
URL_HOST="$(omz_urlencode -P $HOST)" || return 1
|
||||||
|
|
|
@ -62,7 +62,7 @@ function bgnotify_formatted {
|
||||||
function bgnotify_appid {
|
function bgnotify_appid {
|
||||||
if (( ${+commands[osascript]} )); then
|
if (( ${+commands[osascript]} )); then
|
||||||
osascript -e "tell application id \"$(bgnotify_programid)\" to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null
|
osascript -e "tell application id \"$(bgnotify_programid)\" to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null
|
||||||
elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )); then # wayland+sway
|
elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway
|
||||||
local app_id=$(bgnotify_find_sway_appid)
|
local app_id=$(bgnotify_find_sway_appid)
|
||||||
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
|
[[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS
|
||||||
elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then
|
elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then
|
||||||
|
|
|
@ -14,8 +14,8 @@ alias cnl='conda list'
|
||||||
alias cnle='conda list --export'
|
alias cnle='conda list --export'
|
||||||
alias cnles='conda list --explicit > spec-file.txt'
|
alias cnles='conda list --explicit > spec-file.txt'
|
||||||
alias cnr='conda remove'
|
alias cnr='conda remove'
|
||||||
alias cnrn='conda remove -y -all -n'
|
alias cnrn='conda remove -y --all -n'
|
||||||
alias cnrp='conda remove -y -all -p'
|
alias cnrp='conda remove -y --all -p'
|
||||||
alias cnry='conda remove -y'
|
alias cnry='conda remove -y'
|
||||||
alias cnsr='conda search'
|
alias cnsr='conda search'
|
||||||
alias cnu='conda update'
|
alias cnu='conda update'
|
||||||
|
|
|
@ -60,3 +60,46 @@ to `/usr` again.
|
||||||
After that, <kbd>Alt</kbd> + <kbd>Down</kbd> will probably go to `/usr/bin` if `bin` is the first directory in alphabetical
|
After that, <kbd>Alt</kbd> + <kbd>Down</kbd> will probably go to `/usr/bin` if `bin` is the first directory in alphabetical
|
||||||
order (depends on your `/usr` folder structure). <kbd>Alt</kbd> + <kbd>Up</kbd> will return to `/usr`, and once more will get
|
order (depends on your `/usr` folder structure). <kbd>Alt</kbd> + <kbd>Up</kbd> will return to `/usr`, and once more will get
|
||||||
you to the root folder (`/`).
|
you to the root folder (`/`).
|
||||||
|
|
||||||
|
### cde
|
||||||
|
|
||||||
|
This plugin also provides a `cde` alias that allows you to change to a directory without clearing the next directory stack.
|
||||||
|
This changes the default behavior of `dirhistory`, which is to clear the next directory stack when changing directories.
|
||||||
|
|
||||||
|
For example, if the shell was started, and the following commands were entered:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cd ~
|
||||||
|
cd /usr
|
||||||
|
cd share
|
||||||
|
cd doc
|
||||||
|
|
||||||
|
# <Alt + Left>
|
||||||
|
# <Alt + Left>
|
||||||
|
```
|
||||||
|
|
||||||
|
The directory stack would look like this:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
➜ /usr typeset -pm dirhistory_\*
|
||||||
|
typeset -ax dirhistory_past=( /home/user /usr )
|
||||||
|
typeset -ax dirhistory_future=( /usr/share/doc /usr/share )
|
||||||
|
```
|
||||||
|
|
||||||
|
This means that pressing <kbd>Alt</kbd> + <kbd>Right</kbd>, you'd go to `/usr/share` and `/usr/share/doc` (the "future" directories).
|
||||||
|
|
||||||
|
If you run `cd /usr/bin`, the "future" directories will be removed, and you won't be able to access them with <kbd>Alt</kbd> + <kbd>Right</kbd>:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
➜ /u/bin typeset -pm dirhistory_\*
|
||||||
|
typeset -ax dirhistory_past=( /home/user /usr )
|
||||||
|
typeset -ax dirhistory_future=( /usr/bin )
|
||||||
|
```
|
||||||
|
|
||||||
|
If you instead run `cde /usr/bin`, the "future" directories will be preserved:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
➜ /u/bin typeset -pm dirhistory_\*
|
||||||
|
typeset -ax dirhistory_past=( /home/user /usr /usr/bin )
|
||||||
|
typeset -ax dirhistory_future=( /usr/share/doc /usr/share )
|
||||||
|
```
|
||||||
|
|
|
@ -11,9 +11,10 @@ dirhistory_past=($PWD)
|
||||||
dirhistory_future=()
|
dirhistory_future=()
|
||||||
export dirhistory_past
|
export dirhistory_past
|
||||||
export dirhistory_future
|
export dirhistory_future
|
||||||
|
|
||||||
export DIRHISTORY_SIZE=30
|
export DIRHISTORY_SIZE=30
|
||||||
|
|
||||||
|
alias cde='dirhistory_cd'
|
||||||
|
|
||||||
# Pop the last element of dirhistory_past.
|
# Pop the last element of dirhistory_past.
|
||||||
# Pass the name of the variable to return the result in.
|
# Pass the name of the variable to return the result in.
|
||||||
# Returns the element if the array was not empty,
|
# Returns the element if the array was not empty,
|
||||||
|
@ -136,7 +137,11 @@ for keymap in emacs vicmd viins; do
|
||||||
|
|
||||||
case "$TERM_PROGRAM" in
|
case "$TERM_PROGRAM" in
|
||||||
Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app
|
Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app
|
||||||
iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;; # iTerm2
|
ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # ghostty
|
||||||
|
iTerm.app)
|
||||||
|
bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back
|
||||||
|
bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if (( ${+terminfo[kcub1]} )); then
|
if (( ${+terminfo[kcub1]} )); then
|
||||||
|
@ -151,7 +156,11 @@ for keymap in emacs vicmd viins; do
|
||||||
|
|
||||||
case "$TERM_PROGRAM" in
|
case "$TERM_PROGRAM" in
|
||||||
Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app
|
Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app
|
||||||
iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;; # iTerm2
|
ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # ghostty
|
||||||
|
iTerm.app)
|
||||||
|
bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future
|
||||||
|
bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if (( ${+terminfo[kcuf1]} )); then
|
if (( ${+terminfo[kcuf1]} )); then
|
||||||
|
@ -200,6 +209,7 @@ for keymap in emacs vicmd viins; do
|
||||||
case "$TERM_PROGRAM" in
|
case "$TERM_PROGRAM" in
|
||||||
Apple_Terminal) bindkey -M $keymap "^[[A" dirhistory_zle_dirhistory_up ;; # Terminal.app
|
Apple_Terminal) bindkey -M $keymap "^[[A" dirhistory_zle_dirhistory_up ;; # Terminal.app
|
||||||
iTerm.app) bindkey -M $keymap "^[^[[A" dirhistory_zle_dirhistory_up ;; # iTerm2
|
iTerm.app) bindkey -M $keymap "^[^[[A" dirhistory_zle_dirhistory_up ;; # iTerm2
|
||||||
|
ghostty) bindkey -M $keymap "^[[1;3A" dirhistory_zle_dirhistory_up ;; # ghostty
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if (( ${+terminfo[kcuu1]} )); then
|
if (( ${+terminfo[kcuu1]} )); then
|
||||||
|
@ -215,6 +225,7 @@ for keymap in emacs vicmd viins; do
|
||||||
case "$TERM_PROGRAM" in
|
case "$TERM_PROGRAM" in
|
||||||
Apple_Terminal) bindkey -M $keymap "^[[B" dirhistory_zle_dirhistory_down ;; # Terminal.app
|
Apple_Terminal) bindkey -M $keymap "^[[B" dirhistory_zle_dirhistory_down ;; # Terminal.app
|
||||||
iTerm.app) bindkey -M $keymap "^[^[[B" dirhistory_zle_dirhistory_down ;; # iTerm2
|
iTerm.app) bindkey -M $keymap "^[^[[B" dirhistory_zle_dirhistory_down ;; # iTerm2
|
||||||
|
ghostty) bindkey -M $keymap "^[[1;3B" dirhistory_zle_dirhistory_down ;; # ghostty
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if (( ${+terminfo[kcud1]} )); then
|
if (( ${+terminfo[kcud1]} )); then
|
||||||
|
|
|
@ -26,6 +26,7 @@ This plugin supplies one command, `jira`, through which all its features are exp
|
||||||
| `jira new` | Opens a new Jira issue dialogue |
|
| `jira new` | Opens a new Jira issue dialogue |
|
||||||
| `jira ABC-123` | Opens an existing issue |
|
| `jira ABC-123` | Opens an existing issue |
|
||||||
| `jira ABC-123 m` | Opens an existing issue for adding a comment |
|
| `jira ABC-123 m` | Opens an existing issue for adding a comment |
|
||||||
|
| `jira project ABC` | Opens JIRA project summary |
|
||||||
| `jira dashboard [rapid_view]` | Opens your JIRA dashboard |
|
| `jira dashboard [rapid_view]` | Opens your JIRA dashboard |
|
||||||
| `jira mine` | Queries for your own issues |
|
| `jira mine` | Queries for your own issues |
|
||||||
| `jira tempo` | Opens your JIRA Tempo |
|
| `jira tempo` | Opens your JIRA Tempo |
|
||||||
|
|
|
@ -5,6 +5,7 @@ local -a _1st_arguments
|
||||||
_1st_arguments=(
|
_1st_arguments=(
|
||||||
'new:create a new issue'
|
'new:create a new issue'
|
||||||
'mine:open my issues'
|
'mine:open my issues'
|
||||||
|
'project:open the project'
|
||||||
'dashboard:open the dashboard'
|
'dashboard:open the dashboard'
|
||||||
'tempo:open the tempo'
|
'tempo:open the tempo'
|
||||||
'reported:search for issues reported by a user'
|
'reported:search for issues reported by a user'
|
||||||
|
|
|
@ -8,6 +8,7 @@ jira Performs the default action
|
||||||
jira new Opens a new Jira issue dialogue
|
jira new Opens a new Jira issue dialogue
|
||||||
jira ABC-123 Opens an existing issue
|
jira ABC-123 Opens an existing issue
|
||||||
jira ABC-123 m Opens an existing issue for adding a comment
|
jira ABC-123 m Opens an existing issue for adding a comment
|
||||||
|
jira project ABC Opens JIRA project summary
|
||||||
jira dashboard [rapid_view] Opens your JIRA dashboard
|
jira dashboard [rapid_view] Opens your JIRA dashboard
|
||||||
jira mine Queries for your own issues
|
jira mine Queries for your own issues
|
||||||
jira tempo Opens your JIRA Tempo
|
jira tempo Opens your JIRA Tempo
|
||||||
|
@ -88,6 +89,9 @@ function jira() {
|
||||||
elif [[ "$action" == "mine" ]]; then
|
elif [[ "$action" == "mine" ]]; then
|
||||||
echo "Opening my issues"
|
echo "Opening my issues"
|
||||||
open_command "${jira_url}/issues/?filter=-1"
|
open_command "${jira_url}/issues/?filter=-1"
|
||||||
|
elif [[ "$action" == "project" ]]; then
|
||||||
|
echo "Opening project"
|
||||||
|
open_command "${jira_url}/jira/software/c/projects/${2}/summary"
|
||||||
elif [[ "$action" == "dashboard" ]]; then
|
elif [[ "$action" == "dashboard" ]]; then
|
||||||
echo "Opening dashboard"
|
echo "Opening dashboard"
|
||||||
if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
|
if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then
|
||||||
|
|
89
plugins/jj/README.md
Normal file
89
plugins/jj/README.md
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
# jj - Jujutsu CLI
|
||||||
|
|
||||||
|
This plugin provides autocompletion for [jj](https://martinvonz.github.io/jj).
|
||||||
|
|
||||||
|
To use it, add `jj` to the plugins array of your zshrc file:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=(... jj)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Aliases
|
||||||
|
|
||||||
|
| Alias | Command |
|
||||||
|
| ------ | ----------------------------- |
|
||||||
|
| jjc | `jj commit` |
|
||||||
|
| jjcmsg | `jj commit --message` |
|
||||||
|
| jjd | `jj diff` |
|
||||||
|
| jjdmsg | `jj desc --message` |
|
||||||
|
| jjds | `jj desc` |
|
||||||
|
| jje | `jj edit` |
|
||||||
|
| jjgcl | `jj git clone` |
|
||||||
|
| jjgf | `jj git fetch` |
|
||||||
|
| jjgp | `jj git push` |
|
||||||
|
| jjl | `jj log` |
|
||||||
|
| jjla | `jj log -r "all()"` |
|
||||||
|
| jjn | `jj new` |
|
||||||
|
| jjrb | `jj rebase` |
|
||||||
|
| jjrs | `jj restore` |
|
||||||
|
| jjrt | `cd "$(jj root \|\| echo .)"` |
|
||||||
|
| jjsp | `jj split` |
|
||||||
|
| jjsq | `jj squash` |
|
||||||
|
|
||||||
|
## Prompt usage
|
||||||
|
|
||||||
|
Because `jj` has a very powerful [template syntax](https://martinvonz.github.io/jj/latest/templates/), this
|
||||||
|
plugin only exposes a convenience function `jj_prompt_template` to read information from the current change.
|
||||||
|
It is basically the same as `jj log --no-graph -r @ -T $1`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
_my_theme_jj_info() {
|
||||||
|
jj_prompt_template 'self.change_id().shortest(3)'
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='$(_my_theme_jj_info) $'
|
||||||
|
```
|
||||||
|
|
||||||
|
`jj_prompt_template` escapes `%` signs in the output. Use `jj_prompt_template_raw` if you don't want that
|
||||||
|
(e.g. to colorize the output).
|
||||||
|
|
||||||
|
However, because `jj` can be used inside a Git repository, some themes might clash with it. Generally, you can
|
||||||
|
fix it with a wrapper function that tries `jj` first and then falls back to `git` if it didn't work:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
_my_theme_vcs_info() {
|
||||||
|
jj_prompt_template 'self.change_id().shortest(3)' \
|
||||||
|
|| git_prompt_info
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='$(_my_theme_vcs_info) $'
|
||||||
|
```
|
||||||
|
|
||||||
|
You can find an example
|
||||||
|
[here](https://github.com/nasso/omzsh/blob/e439e494f22f4fd4ef1b6cb64626255f4b341c1b/themes/sunakayu.zsh-theme).
|
||||||
|
|
||||||
|
### Performance
|
||||||
|
|
||||||
|
Sometimes `jj` can be slower than `git`.
|
||||||
|
|
||||||
|
If you feel slowdowns, consider using the following:
|
||||||
|
|
||||||
|
```
|
||||||
|
zstyle :omz:plugins:jj ignore-working-copy yes
|
||||||
|
```
|
||||||
|
|
||||||
|
This will add `--ignore-working-copy` to all `jj` commands executed by your prompt. The downside here is that
|
||||||
|
your prompt might be out-of-sync until the next time `jj` gets a chance to _not_ ignore the working copy (i.e.
|
||||||
|
you manually run a `jj` command).
|
||||||
|
|
||||||
|
If you prefer to keep your prompt always up-to-date but still don't want to _feel_ the slowdown, you can make
|
||||||
|
your prompt asynchronous. This plugin doesn't do this automatically so you'd have to hack your theme a bit for
|
||||||
|
that.
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
- [martinvonz/jj](https://github.com/martinvonz/jj)
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
- [nasso](https://github.com/nasso) - Plugin Author
|
53
plugins/jj/jj.plugin.zsh
Normal file
53
plugins/jj/jj.plugin.zsh
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
# if jj is not found, don't do the rest of the script
|
||||||
|
if (( ! $+commands[jj] )); then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the completion file doesn't exist yet, we need to autoload it and
|
||||||
|
# bind it to `jj`. Otherwise, compinit will have already done that.
|
||||||
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_jj" ]]; then
|
||||||
|
typeset -g -A _comps
|
||||||
|
autoload -Uz _jj
|
||||||
|
_comps[jj]=_jj
|
||||||
|
fi
|
||||||
|
|
||||||
|
COMPLETE=zsh jj >| "$ZSH_CACHE_DIR/completions/_jj" &|
|
||||||
|
|
||||||
|
function __jj_prompt_jj() {
|
||||||
|
local -a flags
|
||||||
|
flags=("--no-pager")
|
||||||
|
if zstyle -t ':omz:plugins:jj' ignore-working-copy; then
|
||||||
|
flags+=("--ignore-working-copy")
|
||||||
|
fi
|
||||||
|
command jj $flags "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# convenience functions for themes
|
||||||
|
function jj_prompt_template_raw() {
|
||||||
|
__jj_prompt_jj log --no-graph -r @ -T "$@" 2> /dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
function jj_prompt_template() {
|
||||||
|
local out
|
||||||
|
out=$(jj_prompt_template_raw "$@") || return 1
|
||||||
|
echo "${out:gs/%/%%}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Aliases (sorted alphabetically)
|
||||||
|
alias jjc='jj commit'
|
||||||
|
alias jjcmsg='jj commit --message'
|
||||||
|
alias jjd='jj diff'
|
||||||
|
alias jjdmsg='jj desc --message'
|
||||||
|
alias jjds='jj desc'
|
||||||
|
alias jje='jj edit'
|
||||||
|
alias jjgcl='jj git clone'
|
||||||
|
alias jjgf='jj git fetch'
|
||||||
|
alias jjgp='jj git push'
|
||||||
|
alias jjl='jj log'
|
||||||
|
alias jjla='jj log -r "all()"'
|
||||||
|
alias jjn='jj new'
|
||||||
|
alias jjrb='jj rebase'
|
||||||
|
alias jjrs='jj restore'
|
||||||
|
alias jjrt='cd "$(jj root || echo .)"'
|
||||||
|
alias jjsp='jj split'
|
||||||
|
alias jjsq='jj squash'
|
|
@ -13,6 +13,7 @@ plugins=(... macos)
|
||||||
- [iTerm2](https://iterm2.com/)
|
- [iTerm2](https://iterm2.com/)
|
||||||
- [Hyper](https://hyper.is/)
|
- [Hyper](https://hyper.is/)
|
||||||
- [Tabby](https://tabby.sh/)
|
- [Tabby](https://tabby.sh/)
|
||||||
|
- [Ghostty](https://ghostty.org)
|
||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,12 @@ EOF
|
||||||
tell application "System Events"
|
tell application "System Events"
|
||||||
tell process "Tabby" to keystroke "t" using command down
|
tell process "Tabby" to keystroke "t" using command down
|
||||||
end tell
|
end tell
|
||||||
|
EOF
|
||||||
|
elif [[ "$the_app" == 'ghostty' ]]; then
|
||||||
|
osascript >/dev/null <<EOF
|
||||||
|
tell application "System Events"
|
||||||
|
tell process "Ghostty" to keystroke "t" using command down
|
||||||
|
end tell
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
echo "$0: unsupported terminal app: $the_app" >&2
|
echo "$0: unsupported terminal app: $the_app" >&2
|
||||||
|
@ -139,6 +145,12 @@ EOF
|
||||||
tell application "System Events"
|
tell application "System Events"
|
||||||
tell process "Tabby" to keystroke "D" using command down
|
tell process "Tabby" to keystroke "D" using command down
|
||||||
end tell
|
end tell
|
||||||
|
EOF
|
||||||
|
elif [[ "$the_app" == 'ghostty' ]]; then
|
||||||
|
osascript >/dev/null <<EOF
|
||||||
|
tell application "System Events"
|
||||||
|
tell process "Ghostty" to keystroke "D" using command down
|
||||||
|
end tell
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
echo "$0: unsupported terminal app: $the_app" >&2
|
echo "$0: unsupported terminal app: $the_app" >&2
|
||||||
|
@ -194,6 +206,12 @@ EOF
|
||||||
tell application "System Events"
|
tell application "System Events"
|
||||||
tell process "Tabby" to keystroke "d" using command down
|
tell process "Tabby" to keystroke "d" using command down
|
||||||
end tell
|
end tell
|
||||||
|
EOF
|
||||||
|
elif [[ "$the_app" == 'ghostty' ]]; then
|
||||||
|
osascript >/dev/null <<EOF
|
||||||
|
tell application "System Events"
|
||||||
|
tell process "Ghostty" to keystroke "d" using command down
|
||||||
|
end tell
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
echo "$0: unsupported terminal app: $the_app" >&2
|
echo "$0: unsupported terminal app: $the_app" >&2
|
||||||
|
|
|
@ -146,6 +146,16 @@ case $state in
|
||||||
(help)
|
(help)
|
||||||
_arguments ':feature:__task_list'
|
_arguments ':feature:__task_list'
|
||||||
;;
|
;;
|
||||||
|
(format)
|
||||||
|
_arguments -C \
|
||||||
|
'--check-formatted' \
|
||||||
|
'--dot-formatter' \
|
||||||
|
'--dry-run' \
|
||||||
|
'--force' \
|
||||||
|
'--migrate' \
|
||||||
|
'--no-exit' \
|
||||||
|
'*::file:_files'
|
||||||
|
;;
|
||||||
(test)
|
(test)
|
||||||
_files
|
_files
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -8,7 +8,7 @@ function quote {
|
||||||
|
|
||||||
# Get random quote data
|
# Get random quote data
|
||||||
local data
|
local data
|
||||||
data="$(command curl -s --connect-timeout 2 "http://www.quotationspage.com/random.php" \
|
data="$(command curl -s --connect-timeout 2 "https://www.quotationspage.com/random.php" \
|
||||||
| iconv -c -f ISO-8859-1 -t UTF-8 \
|
| iconv -c -f ISO-8859-1 -t UTF-8 \
|
||||||
| command grep -a -m 1 'dt class="quote"')"
|
| command grep -a -m 1 'dt class="quote"')"
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ The plugin also supports the following:
|
||||||
|
|
||||||
| Variable | Description |
|
| Variable | Description |
|
||||||
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
|
| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `true`) |
|
||||||
| `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) |
|
| `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_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_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) |
|
||||||
|
|
|
@ -15,6 +15,8 @@ fi
|
||||||
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
|
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
|
||||||
# Automatically name the new session based on the basename of PWD
|
# Automatically name the new session based on the basename of PWD
|
||||||
: ${ZSH_TMUX_AUTONAME_SESSION:=false}
|
: ${ZSH_TMUX_AUTONAME_SESSION:=false}
|
||||||
|
# Automatically pick up tmux environments
|
||||||
|
: ${ZSH_TMUX_AUTOREFRESH:=true}
|
||||||
# Set term to screen or screen-256color based on current terminal support
|
# Set term to screen or screen-256color based on current terminal support
|
||||||
: ${ZSH_TMUX_DETACHED:=false}
|
: ${ZSH_TMUX_DETACHED:=false}
|
||||||
# Set detached mode
|
# Set detached mode
|
||||||
|
@ -158,6 +160,15 @@ function _zsh_tmux_plugin_run() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Refresh tmux environment variables.
|
||||||
|
function _zsh_tmux_plugin_preexec()
|
||||||
|
{
|
||||||
|
local -a tmux_cmd
|
||||||
|
tmux_cmd=(command tmux)
|
||||||
|
|
||||||
|
eval $($tmux_cmd show-environment -s)
|
||||||
|
}
|
||||||
|
|
||||||
# Use the completions for tmux for our function
|
# Use the completions for tmux for our function
|
||||||
compdef _tmux _zsh_tmux_plugin_run
|
compdef _tmux _zsh_tmux_plugin_run
|
||||||
# Alias tmux to our wrapper function.
|
# Alias tmux to our wrapper function.
|
||||||
|
@ -184,3 +195,9 @@ if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z
|
||||||
_zsh_tmux_plugin_run
|
_zsh_tmux_plugin_run
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Automatically refresh tmux environments if tmux is running.
|
||||||
|
if [[ -n "$TMUX" && "$ZSH_TMUX_AUTOREFRESH" == "true" ]] && tmux ls >/dev/null 2>/dev/null; then
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
add-zsh-hook preexec _zsh_tmux_plugin_preexec
|
||||||
|
fi
|
||||||
|
|
|
@ -3,6 +3,8 @@ if (( ! ${+commands[uv]} )); then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
alias uv="noglob uv"
|
||||||
|
|
||||||
alias uva='uv add'
|
alias uva='uv add'
|
||||||
alias uvexp='uv export --format requirements-txt --no-hashes --output-file requirements.txt --quiet'
|
alias uvexp='uv export --format requirements-txt --no-hashes --output-file requirements.txt --quiet'
|
||||||
alias uvl='uv lock'
|
alias uvl='uv lock'
|
||||||
|
|
12
themes/nicoulaj.zsh-theme
Normal file → Executable file
12
themes/nicoulaj.zsh-theme
Normal file → Executable file
|
@ -12,12 +12,12 @@
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Customizable parameters.
|
# Customizable parameters.
|
||||||
PROMPT_PATH_MAX_LENGTH=30
|
PROMPT_PATH_MAX_LENGTH=${PROMPT_PATH_MAX_LENGTH:-30}
|
||||||
PROMPT_DEFAULT_END=❯
|
PROMPT_DEFAULT_END=${PROMPT_DEFAULT_END:-❯}
|
||||||
PROMPT_ROOT_END=❯❯❯
|
PROMPT_ROOT_END=${PROMPT_ROOT_END:-❯❯❯}
|
||||||
PROMPT_SUCCESS_COLOR=$FG[071]
|
PROMPT_SUCCESS_COLOR=${PROMPT_SUCCESS_COLOR:-$FG[071]}
|
||||||
PROMPT_FAILURE_COLOR=$FG[124]
|
PROMPT_FAILURE_COLOR=${PROMPT_FAILURE_COLOR:-$FG[124]}
|
||||||
PROMPT_VCS_INFO_COLOR=$FG[242]
|
PROMPT_VCS_INFO_COLOR=${PROMPT_VCS_INFO_COLOR:-$FG[242]}
|
||||||
|
|
||||||
# Set required options.
|
# Set required options.
|
||||||
setopt promptsubst
|
setopt promptsubst
|
||||||
|
|
|
@ -399,8 +399,8 @@ EOF
|
||||||
"$FMT_YELLOW" "$FMT_RESET"
|
"$FMT_YELLOW" "$FMT_RESET"
|
||||||
read -r opt
|
read -r opt
|
||||||
case $opt in
|
case $opt in
|
||||||
y*|Y*|"") ;;
|
[Yy]*|"") ;;
|
||||||
n*|N*) echo "Shell change skipped."; return ;;
|
[Nn]*) echo "Shell change skipped."; return ;;
|
||||||
*) echo "Invalid choice. Shell change skipped."; return ;;
|
*) echo "Invalid choice. Shell change skipped."; return ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user