is_git_repo and rvm stuff
Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
parent
a822b302aa
commit
f9fdcd4b16
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env watchman
|
||||
#!/usr/bin/env ssm
|
||||
|
||||
service_respawn='true'
|
||||
service_command='/usr/bin/crond'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user