mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 15:34:50 +08:00
Compare commits
6 Commits
cfdd3c8dd8
...
b721053c87
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b721053c87 | ||
|
|
25d0b2dfbd | ||
|
|
fcd0747bc1 | ||
|
|
d8f674cc8e | ||
|
|
31c2dc32c2 | ||
|
|
9050ed34d1 |
@ -36,5 +36,4 @@ setopt hist_expire_dups_first # delete duplicates first when HISTFILE size excee
|
|||||||
setopt hist_ignore_dups # ignore duplicated commands history list
|
setopt hist_ignore_dups # ignore duplicated commands history list
|
||||||
setopt hist_ignore_space # ignore commands that start with space
|
setopt hist_ignore_space # ignore commands that start with space
|
||||||
setopt hist_verify # show command with history expansion to user before running it
|
setopt hist_verify # show command with history expansion to user before running it
|
||||||
setopt inc_append_history # add commands to HISTFILE in order of execution
|
|
||||||
setopt share_history # share command history data
|
setopt share_history # share command history data
|
||||||
|
|||||||
@ -22,7 +22,7 @@ plugins=(... git)
|
|||||||
| gb | git branch |
|
| gb | git branch |
|
||||||
| gba | git branch -a |
|
| gba | git branch -a |
|
||||||
| gbd | git branch -d |
|
| gbd | git branch -d |
|
||||||
| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*(master\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d |
|
| gbda | git branch --no-color --merged \| command grep -vE "^(\+\|\*\|\s*(master\|development\|develop\|dev)\s*$)" \| command xargs -n 1 git branch -d |
|
||||||
| gbD | git branch -D |
|
| gbD | git branch -D |
|
||||||
| gbl | git blame -b -w |
|
| gbl | git blame -b -w |
|
||||||
| gbnm | git branch --no-merged |
|
| gbnm | git branch --no-merged |
|
||||||
|
|||||||
@ -42,7 +42,7 @@ alias gap='git apply'
|
|||||||
alias gb='git branch'
|
alias gb='git branch'
|
||||||
alias gba='git branch -a'
|
alias gba='git branch -a'
|
||||||
alias gbd='git branch -d'
|
alias gbd='git branch -d'
|
||||||
alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
|
alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|development|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
|
||||||
alias gbD='git branch -D'
|
alias gbD='git branch -D'
|
||||||
alias gbl='git blame -b -w'
|
alias gbl='git blame -b -w'
|
||||||
alias gbnm='git branch --no-merged'
|
alias gbnm='git branch --no-merged'
|
||||||
|
|||||||
@ -19,6 +19,7 @@ jira # performs the default action
|
|||||||
|
|
||||||
jira new # opens a new issue
|
jira new # opens a new issue
|
||||||
jira dashboard # opens your JIRA dashboard
|
jira dashboard # opens your JIRA dashboard
|
||||||
|
jira tempo # opens your JIRA Tempo
|
||||||
jira reported [username] # queries for issues reported by a user
|
jira reported [username] # queries for issues reported by a user
|
||||||
jira assigned [username] # queries for issues assigned to a user
|
jira assigned [username] # queries for issues assigned to a user
|
||||||
jira myissues # queries for you own issues
|
jira myissues # queries for you own issues
|
||||||
|
|||||||
@ -5,6 +5,7 @@ local -a _1st_arguments
|
|||||||
_1st_arguments=(
|
_1st_arguments=(
|
||||||
'new:create a new issue'
|
'new:create a new issue'
|
||||||
'dashboard:open the dashboard'
|
'dashboard:open the dashboard'
|
||||||
|
'tempo:open the tempo'
|
||||||
'reported:search for issues reported by a user'
|
'reported:search for issues reported by a user'
|
||||||
'assigned:search for issues assigned to a user'
|
'assigned:search for issues assigned to a user'
|
||||||
'branch:open the issue named after the git branch of the current directory'
|
'branch:open the issue named after the git branch of the current directory'
|
||||||
|
|||||||
@ -54,6 +54,9 @@ function jira() {
|
|||||||
else
|
else
|
||||||
open_command "${jira_url}/secure/Dashboard.jspa"
|
open_command "${jira_url}/secure/Dashboard.jspa"
|
||||||
fi
|
fi
|
||||||
|
elif [[ "$action" == "tempo" ]]; then
|
||||||
|
echo "Opening tempo"
|
||||||
|
open_command "${jira_url}/secure/Tempo.jspa"
|
||||||
elif [[ "$action" == "dumpconfig" ]]; then
|
elif [[ "$action" == "dumpconfig" ]]; then
|
||||||
echo "JIRA_URL=$jira_url"
|
echo "JIRA_URL=$jira_url"
|
||||||
echo "JIRA_PREFIX=$jira_prefix"
|
echo "JIRA_PREFIX=$jira_prefix"
|
||||||
|
|||||||
@ -16,16 +16,22 @@ man-command-line() {
|
|||||||
# if there is no command typed, use the last command
|
# if there is no command typed, use the last command
|
||||||
[[ -z "$BUFFER" ]] && zle up-history
|
[[ -z "$BUFFER" ]] && zle up-history
|
||||||
|
|
||||||
# prepend man to only the first part of the typed command
|
# if typed command begins with man, do nothing
|
||||||
|
[[ "$BUFFER" = man\ * ]] && return
|
||||||
|
|
||||||
|
# get command and possible subcommand
|
||||||
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
|
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
|
||||||
[[ "$BUFFER" != man\ * ]] && BUFFER="man ${${(Az)BUFFER}[1]}"
|
local -a args
|
||||||
|
args=(${${(Az)BUFFER}[1]} ${${(Az)BUFFER}[2]})
|
||||||
|
|
||||||
|
# check if man page exists for command and first argument
|
||||||
|
if man "${args[1]}-${args[2]}" >/dev/null 2>&1; then
|
||||||
|
BUFFER="man $args"
|
||||||
|
else
|
||||||
|
BUFFER="man ${args[1]}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
zle -N man-command-line
|
zle -N man-command-line
|
||||||
# Defined shortcut keys: [Esc]man
|
# Defined shortcut keys: [Esc]man
|
||||||
bindkey "\e"man man-command-line
|
bindkey "\e"man man-command-line
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
|
||||||
# Also, you might want to use man-preview included in 'osx' plugin
|
|
||||||
# just substitute "man" in the function with "man-preview" after you included OS X in
|
|
||||||
# the .zshrc
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ compdef _pipenv pipenv
|
|||||||
# Automatic pipenv shell activation/deactivation
|
# Automatic pipenv shell activation/deactivation
|
||||||
_togglePipenvShell() {
|
_togglePipenvShell() {
|
||||||
# deactivate shell if Pipfile doesn't exist and not in a subdir
|
# deactivate shell if Pipfile doesn't exist and not in a subdir
|
||||||
if [[ ! -a "$PWD/Pipfile" ]]; then
|
if [[ ! -f "$PWD/Pipfile" ]]; then
|
||||||
if [[ "$PIPENV_ACTIVE" == 1 ]]; then
|
if [[ "$PIPENV_ACTIVE" == 1 ]]; then
|
||||||
if [[ "$PWD" != "$pipfile_dir"* ]]; then
|
if [[ "$PWD" != "$pipfile_dir"* ]]; then
|
||||||
exit
|
exit
|
||||||
@ -17,7 +17,7 @@ _togglePipenvShell() {
|
|||||||
|
|
||||||
# activate the shell if Pipfile exists
|
# activate the shell if Pipfile exists
|
||||||
if [[ "$PIPENV_ACTIVE" != 1 ]]; then
|
if [[ "$PIPENV_ACTIVE" != 1 ]]; then
|
||||||
if [[ -a "$PWD/Pipfile" ]]; then
|
if [[ -f "$PWD/Pipfile" ]]; then
|
||||||
export pipfile_dir="$PWD"
|
export pipfile_dir="$PWD"
|
||||||
pipenv shell
|
pipenv shell
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -10,9 +10,14 @@ typeset +H my_orange="$FG[214]"
|
|||||||
|
|
||||||
# separator dashes size
|
# separator dashes size
|
||||||
function afmagic_dashes {
|
function afmagic_dashes {
|
||||||
[[ -n "${VIRTUAL_ENV-}" && -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" && "$PS1" = \(* ]] \
|
local PYTHON_ENV="$VIRTUAL_ENV"
|
||||||
&& echo $(( COLUMNS - ${#VIRTUAL_ENV} - 3 )) \
|
[[ -z "$PYTHON_ENV" ]] && PYTHON_ENV="$CONDA_DEFAULT_ENV"
|
||||||
|| echo $COLUMNS
|
|
||||||
|
if [[ -n "$PYTHON_ENV" && "$PS1" = \(* ]]; then
|
||||||
|
echo $(( COLUMNS - ${#PYTHON_ENV} - 3 ))
|
||||||
|
else
|
||||||
|
echo $COLUMNS
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# primary prompt
|
# primary prompt
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user