diff options
author | Marvin Borner | 2020-03-16 23:33:42 +0100 |
---|---|---|
committer | Marvin Borner | 2020-03-16 23:33:42 +0100 |
commit | 0e9ddbb0bf0cd34500155ea4b03de2e2a38d8ab2 (patch) | |
tree | 719da1c7fe5dabb872fe9ff1582c39b55ccd488e /.oh-my-zsh/plugins/fossil | |
parent | e5d38956336ab1be954bdbd12808c5f98f8bd925 (diff) |
Well I'm using Arch again
Diffstat (limited to '.oh-my-zsh/plugins/fossil')
-rw-r--r-- | .oh-my-zsh/plugins/fossil/README.md | 7 | ||||
-rw-r--r-- | .oh-my-zsh/plugins/fossil/fossil.plugin.zsh | 89 |
2 files changed, 0 insertions, 96 deletions
diff --git a/.oh-my-zsh/plugins/fossil/README.md b/.oh-my-zsh/plugins/fossil/README.md deleted file mode 100644 index 5bb47b7..0000000 --- a/.oh-my-zsh/plugins/fossil/README.md +++ /dev/null @@ -1,7 +0,0 @@ -## Fossil Plugin - -This plugin adds completion support and prompt for fossil repositories. -The prompt will display the current branch and status been dirty or clean. - -### CONTRIBUTOR - - Jefferson González ([jgmdev](https://github.com/jgmdev)) diff --git a/.oh-my-zsh/plugins/fossil/fossil.plugin.zsh b/.oh-my-zsh/plugins/fossil/fossil.plugin.zsh deleted file mode 100644 index 1ae166e..0000000 --- a/.oh-my-zsh/plugins/fossil/fossil.plugin.zsh +++ /dev/null @@ -1,89 +0,0 @@ -_FOSSIL_PROMPT="" - -# Prefix at the very beginning of the prompt, before the branch name -ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:(%{$fg_bold[red]%}" - -# At the very end of the prompt -ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})" - -# Text to display if the branch is dirty -ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖" - -# Text to display if the branch is clean -ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔" - -function fossil_prompt_info () { - local _OUTPUT=`fossil branch 2>&1` - local _STATUS=`echo $_OUTPUT | grep "use --repo"` - if [ "$_STATUS" = "" ]; then - local _EDITED=`fossil changes` - local _EDITED_SYM="$ZSH_THEME_FOSSIL_PROMPT_CLEAN" - local _BRANCH=`echo $_OUTPUT | grep "* " | sed 's/* //g'` - - if [ "$_EDITED" != "" ]; then - _EDITED_SYM="$ZSH_THEME_FOSSIL_PROMPT_DIRTY" - fi - - echo "$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \ - "$_BRANCH" \ - "$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \ - "$_EDITED_SYM"\ - "%{$reset_color%}" - fi -} - -function _fossil_get_command_list () { - fossil help -a | grep -v "Usage|Common|This is" -} - -function _fossil () { - local context state state_descr line - typeset -A opt_args - - _arguments \ - '1: :->command'\ - '2: :->subcommand' - - case $state in - command) - local _OUTPUT=`fossil branch 2>&1 | grep "use --repo"` - if [ "$_OUTPUT" = "" ]; then - compadd `_fossil_get_command_list` - else - compadd clone init import help version - fi - ;; - subcommand) - if [ "$words[2]" = "help" ]; then - compadd `_fossil_get_command_list` - else - compcall -D - fi - ;; - esac -} - -function _fossil_prompt () { - local current=`echo $PROMPT $RPROMPT | grep fossil` - - if [ "$_FOSSIL_PROMPT" = "" -o "$current" = "" ]; then - local _prompt=${PROMPT} - local _rprompt=${RPROMPT} - - local is_prompt=`echo $PROMPT | grep git` - - if [ "$is_prompt" = "" ]; then - export RPROMPT="$_rprompt"'$(fossil_prompt_info)' - else - export PROMPT="$_prompt"'$(fossil_prompt_info) ' - fi - - _FOSSIL_PROMPT="1" - fi -} - -compdef _fossil fossil - -autoload -U add-zsh-hook - -add-zsh-hook precmd _fossil_prompt |