abra zsh config 2.0

This commit is contained in:
Andrey Anurin
2018-08-12 15:26:21 +03:00
parent 201abd09c4
commit 6b114440e2
1195 changed files with 68948 additions and 10539 deletions

View File

@@ -0,0 +1 @@
gitdir: ../../../../.git/modules/modules/prompt/external/powerline

View File

@@ -15,19 +15,19 @@ ZSH_THEME_REP_TIME_SINCE_COMMIT_LONG="%{$fg[red]%}"
ZSH_THEME_REP_TIME_SINCE_COMMIT_NEUTRAL="%{$fg[cyan]%}"
# returns the time since last git commit
function git_time_details() {
git_time_details()() {
# only proceed if there is actually a git repository
if `git rev-parse --git-dir > /dev/null 2>&1`; then
if $(git rev-parse --git-dir > /dev/null 2>&1); then
# only proceed if there is actually a commit
if [[ $(git log 2>&1 > /dev/null | grep -c "^fatal: bad default revision") == 0 ]]; then
# get the last commit hash
# lc_hash=`git log --pretty=format:'%h' -1 2> /dev/null`
# lc_hash=$(git log --pretty=format:'%h' -1 2> /dev/null)
# get the last commit time
lc_time=`git log --pretty=format:'%at' -1 2> /dev/null`
lc_time=$(git log --pretty=format:'%at' -1 2> /dev/null)
now=`date +%s`
now=$(date +%s)
seconds_since_last_commit=$((now-lc_time))
lc_time_since=`time_since_commit $seconds_since_last_commit`
lc_time_since=$(time_since_commit $seconds_since_last_commit)
echo "$lc_time_since"
else
@@ -39,7 +39,7 @@ function git_time_details() {
}
# returns the time by given seconds
function time_since_commit() {
time_since_commit()() {
seconds_since_last_commit=$(($1 + 0))
# totals
@@ -60,7 +60,7 @@ function time_since_commit() {
fi
}
function rvm_info_for_prompt {
rvm_info_for_prompt() {
if [[ -d ~/.rvm/ ]]; then
local ruby_version=$(~/.rvm/bin/rvm-prompt)
if [ -n "$ruby_version" ]; then
@@ -71,7 +71,7 @@ function rvm_info_for_prompt {
fi
}
function prompt_powerline_precmd {
prompt_powerline_precmd() {
# Check for untracked files or updated submodules since vcs_info doesn't.
if [[ ! -z $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then
fmt_branch="%b%u%c${__PROMPT_SKWP_COLORS[4]}●%f"
@@ -86,7 +86,7 @@ function prompt_powerline_precmd {
# zstyle ':prezto:module:ruby' rvm '%r'
}
function prompt_powerline_setup {
prompt_powerline_setup() {
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
prompt_opts=(cr percent subst)
@@ -166,8 +166,8 @@ function prompt_powerline_setup {
POWERLINE_COLOR_FG_LIGHT_GRAY=%F{240}
POWERLINE_COLOR_FG_WHITE=%F{255}
POWERLINE_SEPARATOR=$'\u2b80'
POWERLINE_R_SEPARATOR=$'\u2b82'
POWERLINE_SEPARATOR=$'\uE0B0'
POWERLINE_R_SEPARATOR=$'\uE0B2'
POWERLINE_LEFT_A="%K{green}%F{white} %~ %k%f%F{green}%K{blue}"$POWERLINE_SEPARATOR
POWERLINE_LEFT_B="%k%f%F{white}%K{blue} "'${vcs_info_msg_0_}'" %k%f%F{blue}%K{black}"$POWERLINE_SEPARATOR