is_git_repo and rvm stuff

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
Jack L. Frost 2017-11-09 15:26:42 +03:00
parent a822b302aa
commit f9fdcd4b16
4 changed files with 19 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env watchman
#!/usr/bin/env ssm
service_respawn='true'
service_command='/usr/bin/crond'

View File

@ -40,11 +40,11 @@ dotfiles_dir="$HOME/git/dotfiles"
# PATH
set_misc_path \
"$HOME/.config/alternatives" \
"$HOME/.rvm/bin" \
"$HOME/games/bin" \
"$HOME/.local/bin" \
"$HOME/.nails/bin" \
"$HOME/.winepx/bin"
"$HOME/.winepx/bin" \
"$HOME/.rvm/bin"
# GPG
GPG_TTY=$(tty)

View File

@ -44,6 +44,20 @@ precmd.svn() {
fi
}
precmd.is_git_repo() {
declare _pwd=$PWD
while [[ -n $_pwd ]]; do
if [[ -r "$_pwd/.git/HEAD" ]]; then
return 0
else
_pwd=${pwd%/*}
fi
done
return 1
}
precmd.git() {
declare git_unstaged git_untracked git_status_short git_status_colour git_prompt_msg
@ -51,7 +65,7 @@ precmd.git() {
return 0
fi
if git rev-parse --git-dir &>/dev/null; then
if precmd.is_git_repo; then
git_current_branch=$(git rev-parse --abbrev-ref HEAD)
while IFS= read -r line; do

View File

@ -1,6 +1,6 @@
:set gui=nonavigation
:set autocomplete=false
:map O :tabopen!
:map O :tabopen
:map P :set apptab<CR>
:map D :tabclose!<CR>