mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 05:59:46 +08:00
Compare commits
3 Commits
338b9a615a
...
4188b22aea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4188b22aea | ||
|
|
e564793939 | ||
|
|
6925c44af4 |
@ -57,7 +57,7 @@ def pretty_print(cheatsheet, wfilter, group_list=None, groups_only=False):
|
|||||||
pretty_print_group(key, [ alias for alias in aliases if alias[0].find(wfilter)>-1 or alias[1].find(wfilter)>-1], wfilter)
|
pretty_print_group(key, [ alias for alias in aliases if alias[0].find(wfilter)>-1 or alias[1].find(wfilter)>-1], wfilter)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="acs")
|
parser = argparse.ArgumentParser(description="Pretty print aliases.", prog="als")
|
||||||
parser.add_argument('filter', nargs="*", metavar="<keyword>", help="search aliases matching keywords")
|
parser.add_argument('filter', nargs="*", metavar="<keyword>", help="search aliases matching keywords")
|
||||||
parser.add_argument('-g', '--group', dest="group_list", action='append', help="only print aliases in given groups")
|
parser.add_argument('-g', '--group', dest="group_list", action='append', help="only print aliases in given groups")
|
||||||
parser.add_argument('--groups', dest='groups_only', action='store_true', help="only print alias groups")
|
parser.add_argument('--groups', dest='groups_only', action='store_true', help="only print alias groups")
|
||||||
|
|||||||
@ -109,7 +109,9 @@ prompt_git() {
|
|||||||
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then
|
if [[ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]]; then
|
||||||
repo_path=$(git rev-parse --git-dir 2>/dev/null)
|
repo_path=$(git rev-parse --git-dir 2>/dev/null)
|
||||||
dirty=$(parse_git_dirty)
|
dirty=$(parse_git_dirty)
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
||||||
|
ref="◈ $(git describe --exact-match --tags HEAD 2> /dev/null)" || \
|
||||||
|
ref="➦ $(git rev-parse --short HEAD 2> /dev/null)"
|
||||||
if [[ -n $dirty ]]; then
|
if [[ -n $dirty ]]; then
|
||||||
prompt_segment yellow black
|
prompt_segment yellow black
|
||||||
else
|
else
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
|
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
|
||||||
|
|
||||||
function virtualenv_info {
|
function virtualenv_info {
|
||||||
|
[ $CONDA_DEFAULT_ENV ] && echo "($CONDA_DEFAULT_ENV) "
|
||||||
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
|
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user