1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-12 15:34:50 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Alexey Györi
ecf2240b06
arcanist: add functions which allow copy-pasting of URLS (#8688)
Co-authored-by: Marc Cornellà <marc.cornella@live.com>
2020-03-04 10:54:24 +01:00
chieping
76fb7a258b rbenv: fix rbenv_prompt_info prefix and suffix (#3764)
Closes #3764
2020-03-04 09:21:02 +01:00
Marc Cornellà
22fed4fbcb knife: fix refactor mistake 2020-03-04 09:12:58 +01:00
4 changed files with 40 additions and 10 deletions

View File

@ -11,13 +11,14 @@ plugins=(... arcanist)
## Aliases ## Aliases
| Alias | Command | | Alias | Command |
|---------|------------------------------------| | ------- | ---------------------------------- |
| ara | `arc amend` | | ara | `arc amend` |
| arb | `arc branch` | | arb | `arc branch` |
| arco | `arc cover` | | arco | `arc cover` |
| arci | `arc commit` | | arci | `arc commit` |
| ard | `arc diff` | | ard | `arc diff` |
| ardc | `arc diff --create` | | ardc | `arc diff --create` |
| ardp | `arc diff --preview` |
| ardnu | `arc diff --nounit` | | ardnu | `arc diff --nounit` |
| ardnupc | `arc diff --nounit --plan-changes` | | ardnupc | `arc diff --nounit --plan-changes` |
| ardpc | `arc diff --plan-changes` | | ardpc | `arc diff --plan-changes` |
@ -27,3 +28,14 @@ plugins=(... arcanist)
| arli | `arc lint` | | arli | `arc lint` |
| arls | `arc list` | | arls | `arc list` |
| arpa | `arc patch` | | arpa | `arc patch` |
## Functions
The following functions make copy pasting revision ids from the URL bar of your browser
easier, as they allow for copy pasting the whole URL. For example: `ardu` accepts
both `https://arcanist-url.com/<REVISION>` as well as `<REVISION>`.
| Function | Command |
| ------------------------- | --------------------------------- |
| ardu [URL or revision_id] | `arc diff --update` [revision_id] |
| arpa [URL or revision_id] | `arc patch` [revision_id] |

View File

@ -13,10 +13,25 @@ alias ardc='arc diff --create'
alias ardnu='arc diff --nounit' alias ardnu='arc diff --nounit'
alias ardnupc='arc diff --nounit --plan-changes' alias ardnupc='arc diff --nounit --plan-changes'
alias ardpc='arc diff --plan-changes' alias ardpc='arc diff --plan-changes'
alias ardp='arc diff --preview' # creates a new diff in the phab interface
alias are='arc export' alias are='arc export'
alias arh='arc help' alias arh='arc help'
alias arl='arc land' alias arl='arc land'
alias arli='arc lint' alias arli='arc lint'
alias arls='arc list' alias arls='arc list'
alias arpa='arc patch'
#
# Functions
# (sorted alphabetically)
#
ardu() {
# Both `ardu https://arcanist-url.com/<REVISION>`, and `ardu <REVISION>` work.
arc diff --update "${1:t}"
}
arpa() {
# Both `arpa https://arcanist-url.com/<REVISION>`, and `arpa <REVISION>` work.
arc patch "${1:t}"
}

View File

@ -106,10 +106,10 @@ _knife() {
compadd -Q "$@" show edit list "from file" create delete compadd -Q "$@" show edit list "from file" create delete
;; ;;
bootstrap|clean|cook|prepare) bootstrap|clean|cook|prepare)
compadd "$@" nodes/*.json(N:t:r); done compadd "$@" nodes/*.json(N:t:r)
;; ;;
init) init)
compadd "$@" ./*(/N:t); done compadd "$@" ./*(/N:t)
;; ;;
*) *)
_arguments '3:Subsubcommands:($(_knife_options2))' _arguments '3:Subsubcommands:($(_knife_options2))'

View File

@ -47,11 +47,10 @@ if [[ $FOUND_RBENV -eq 1 ]]; then
} }
function rbenv_prompt_info() { function rbenv_prompt_info() {
if [[ -n $(current_gemset) ]] ; then local ruby=$(current_ruby) gemset=$(current_gemset)
echo "$(current_ruby)@$(current_gemset)" echo -n "${ZSH_THEME_RUBY_PROMPT_PREFIX}"
else [[ -n "$gemset" ]] && echo -n "${ruby}@${gemset}" || echo -n "${ruby}"
echo "$(current_ruby)" echo "${ZSH_THEME_RUBY_PROMPT_SUFFIX}"
fi
} }
else else
alias rubies="ruby -v" alias rubies="ruby -v"
@ -59,7 +58,11 @@ else
function current_ruby() { echo "not supported" } function current_ruby() { echo "not supported" }
function current_gemset() { echo "not supported" } function current_gemset() { echo "not supported" }
function gems() { echo "not supported" } function gems() { echo "not supported" }
function rbenv_prompt_info() { echo "system: $(ruby -v | cut -f-2 -d ' ')" } function rbenv_prompt_info() {
echo -n "${ZSH_THEME_RUBY_PROMPT_PREFIX}"
echo -n "system: $(ruby -v | cut -f-2 -d ' ')"
echo "${ZSH_THEME_RUBY_PROMPT_SUFFIX}"
}
fi fi
unset FOUND_RBENV rbenvdirs dir unset FOUND_RBENV rbenvdirs dir