mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
done a bit of refactoring, moved out some stuff I don't need like virtual_env checks and so on.
Also put up a header and license (MIT) … 'tis changeable to whatever as long as it's free to use/modify/redistribute.
This commit is contained in:
parent
fd4454502e
commit
8e53e2e5a1
1 changed files with 18 additions and 23 deletions
|
|
@ -1,9 +1,24 @@
|
||||||
|
##
|
||||||
|
# Developed by NETPUNK#, software services
|
||||||
|
# http://www.netpunk.net (not up ATM)
|
||||||
|
#
|
||||||
|
# License: MIT
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
# THE SOFTWARE.
|
||||||
|
##
|
||||||
|
|
||||||
function prompt_char {
|
function prompt_char {
|
||||||
git branch >/dev/null 2>/dev/null && echo 'GIT ☢ ↪' && return
|
git branch >/dev/null 2>/dev/null && echo 'GIT ☢ ↪' && return
|
||||||
hg root >/dev/null 2>/dev/null && echo 'HG ☢ ↪' && return
|
hg root >/dev/null 2>/dev/null && echo 'HG ☢ ↪' && return
|
||||||
echo ' ☣ ↪'
|
echo ' ☢ ↪'
|
||||||
}
|
}
|
||||||
function battery_charge() {
|
function battery_charge {
|
||||||
if [ -e /usr/local/bin/batcharge.py ]
|
if [ -e /usr/local/bin/batcharge.py ]
|
||||||
then
|
then
|
||||||
echo `python /usr/local/bin/batcharge.py`
|
echo `python /usr/local/bin/batcharge.py`
|
||||||
|
|
@ -18,33 +33,13 @@ function hg_prompt_info {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_pwd() {
|
|
||||||
echo "${PWD/$HOME/~}"
|
|
||||||
}
|
|
||||||
|
|
||||||
function virtualenv_info {
|
|
||||||
[ $VIRTUAL_ENV ] && echo '('on `basename $VIRTUAL_ENV`') '
|
|
||||||
}
|
|
||||||
function spacing {
|
|
||||||
local spacing=""
|
|
||||||
for i in {1..$termwidth}; do
|
|
||||||
spacing="${spacing} "
|
|
||||||
done
|
|
||||||
echo $spacing
|
|
||||||
}
|
|
||||||
function collapse_pwd {
|
|
||||||
echo $(pwd | sed -e "s,^$HOME,~,")
|
|
||||||
}
|
|
||||||
|
|
||||||
if which rbenv &> /dev/null; then
|
if which rbenv &> /dev/null; then
|
||||||
PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%} %~ %{$reset_color%}$(hg_prompt_info)$(git_prompt_info)%{$reset_color%}
|
PROMPT='%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%} %~ %{$reset_color%}$(hg_prompt_info)$(git_prompt_info)%{$reset_color%}
|
||||||
$(prompt_char) '
|
$(prompt_char) '
|
||||||
RPROMPT='using %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%}$(virtualenv_info) %{$fg[magenta]%}$(date "+%Y-%m-%d")%{$reset_color%} BAT: $(battery_charge)'
|
RPROMPT='using %{$fg[red]%}$(rbenv version | sed -e "s/ (set.*$//")%{$reset_color%} %{$fg[magenta]%}$(date "+%Y-%m-%d")%{$reset_color%} BAT: $(battery_charge)'
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%} "
|
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%} "
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[white]%}%{$bg[red]%} ✖ "
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[white]%}%{$bg[red]%} ✖ "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue