mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Merge pull request #1 from maazghani/20150930-minor-tweaks
Minor tweaks to directory aliases and agnoster.zsh
This commit is contained in:
commit
c3d52ebec9
2 changed files with 9 additions and 30 deletions
|
|
@ -28,6 +28,3 @@ alias l='ls -lah'
|
||||||
alias ll='ls -lh'
|
alias ll='ls -lh'
|
||||||
alias la='ls -lAh'
|
alias la='ls -lAh'
|
||||||
|
|
||||||
# Push and pop directories on directory stack
|
|
||||||
alias pu='pushd'
|
|
||||||
alias po='popd'
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@
|
||||||
#
|
#
|
||||||
# In order for this theme to render correctly, you will need a
|
# In order for this theme to render correctly, you will need a
|
||||||
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
|
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
|
||||||
# Make sure you have a recent version: the code points that Powerline
|
|
||||||
# uses changed in 2012, and older versions will display incorrectly,
|
|
||||||
# in confusing ways.
|
|
||||||
#
|
#
|
||||||
# In addition, I recommend the
|
# In addition, I recommend the
|
||||||
# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
|
# [Solarized theme](https://github.com/altercation/solarized/) and, if you're
|
||||||
|
|
@ -30,21 +27,12 @@
|
||||||
|
|
||||||
CURRENT_BG='NONE'
|
CURRENT_BG='NONE'
|
||||||
|
|
||||||
# Special Powerline characters
|
# Fix odd char on mac
|
||||||
|
if [[ `uname` == 'Darwin' ]]; then
|
||||||
() {
|
SEGMENT_SEPARATOR='\ue0b0'
|
||||||
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
|
else
|
||||||
# NOTE: This segment separator character is correct. In 2012, Powerline changed
|
SEGMENT_SEPARATOR=''
|
||||||
# the code points they use for their special characters. This is the new code point.
|
fi
|
||||||
# If this is not working for you, you probably have an old version of the
|
|
||||||
# Powerline-patched fonts installed. Download and install the new version.
|
|
||||||
# Do not submit PRs to change this unless you have reviewed the Powerline code point
|
|
||||||
# history and have new information.
|
|
||||||
# This is defined using a Unicode escape sequence so it is unambiguously readable, regardless of
|
|
||||||
# what font the user is viewing this source code in. Do not replace the
|
|
||||||
# escape sequence with a single literal character.
|
|
||||||
SEGMENT_SEPARATOR=$'\ue0b0' #
|
|
||||||
}
|
|
||||||
|
|
||||||
# Begin a segment
|
# Begin a segment
|
||||||
# Takes two arguments, background and foreground. Both can be omitted,
|
# Takes two arguments, background and foreground. Both can be omitted,
|
||||||
|
|
@ -79,24 +67,18 @@ prompt_end() {
|
||||||
# Context: user@hostname (who am I and where am I)
|
# Context: user@hostname (who am I and where am I)
|
||||||
prompt_context() {
|
prompt_context() {
|
||||||
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
|
||||||
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"
|
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@MAAZBOOKPRO"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Git: branch/detached head, dirty status
|
# Git: branch/detached head, dirty status
|
||||||
prompt_git() {
|
prompt_git() {
|
||||||
|
|
||||||
local PL_BRANCH_CHAR
|
|
||||||
() {
|
|
||||||
local LC_ALL="" LC_CTYPE="en_US.UTF-8"
|
|
||||||
PL_BRANCH_CHAR=$'\ue0a0' #
|
|
||||||
}
|
|
||||||
local ref dirty mode repo_path
|
local ref dirty mode repo_path
|
||||||
repo_path=$(git rev-parse --git-dir 2>/dev/null)
|
repo_path=$(git rev-parse --git-dir 2>/dev/null)
|
||||||
|
|
||||||
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
|
if $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then
|
||||||
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 show-ref --head -s --abbrev |head -n1 2> /dev/null)"
|
||||||
if [[ -n $dirty ]]; then
|
if [[ -n $dirty ]]; then
|
||||||
prompt_segment yellow black
|
prompt_segment yellow black
|
||||||
else
|
else
|
||||||
|
|
@ -122,7 +104,7 @@ prompt_git() {
|
||||||
zstyle ':vcs_info:*' formats ' %u%c'
|
zstyle ':vcs_info:*' formats ' %u%c'
|
||||||
zstyle ':vcs_info:*' actionformats ' %u%c'
|
zstyle ':vcs_info:*' actionformats ' %u%c'
|
||||||
vcs_info
|
vcs_info
|
||||||
echo -n "${ref/refs\/heads\//$PL_BRANCH_CHAR }${vcs_info_msg_0_%% }${mode}"
|
echo -n "${ref/refs\/heads\// }${vcs_info_msg_0_%% }${mode}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue