Adding some Go bits, correcting some warts
plus getting to the bottom of shell startup slowness, which appears to be almost entirely due to rbenv.
This commit is contained in:
parent
0f4906c00a
commit
bc0fc62b2f
17
bash_aliases
17
bash_aliases
@ -1,3 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
alias .bp="source $HOME/.bash_profile"
|
alias .bp="source $HOME/.bash_profile"
|
||||||
alias .sa="source $HOME/.ssh/agent.out"
|
alias .sa="source $HOME/.ssh/agent.out"
|
||||||
alias be='bundle exec'
|
alias be='bundle exec'
|
||||||
@ -15,12 +17,13 @@ alias sS='TERM=xterm screen -Rd -S '
|
|||||||
alias scr='TERM=xterm screen -Rd'
|
alias scr='TERM=xterm screen -Rd'
|
||||||
alias sl="screen -ls"
|
alias sl="screen -ls"
|
||||||
|
|
||||||
if [[ "$(uname)" -eq "Linux" ]]
|
case "$(uname | tr '[:upper:]' '[:lower:]')" in
|
||||||
then
|
darwin)
|
||||||
alias l='ls -F --color=auto'
|
alias l='ls -GF'
|
||||||
else
|
;;
|
||||||
# for darwin in particular
|
*)
|
||||||
alias l='ls -GF'
|
alias l='ls -F --color=auto'
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# vim:filetype=sh
|
# vim:filetype=sh
|
||||||
|
57
bash_profile
57
bash_profile
@ -5,7 +5,7 @@ _debug(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_get_hostname(){
|
_get_hostname() {
|
||||||
local hn="$(hostname -a 2>/dev/null || hostname)"
|
local hn="$(hostname -a 2>/dev/null || hostname)"
|
||||||
local ha=""
|
local ha=""
|
||||||
for host in $hn ; do
|
for host in $hn ; do
|
||||||
@ -21,7 +21,7 @@ _get_hostname(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_source_host_specific_rcfile(){
|
_source_host_specific_rcfile() {
|
||||||
local _host_alias="`_get_hostname`"
|
local _host_alias="`_get_hostname`"
|
||||||
if [[ ! -n "$_host_alias" ]] ; then
|
if [[ ! -n "$_host_alias" ]] ; then
|
||||||
_host_alias="`hostname`"
|
_host_alias="`hostname`"
|
||||||
@ -35,35 +35,52 @@ _source_host_specific_rcfile(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_source_bash_extras()
|
_source_if_exists() {
|
||||||
{
|
if [ -e "$1" ] ; then
|
||||||
local _BASH_EXTRAS="
|
_debug "sourcing $1"
|
||||||
$HOME/.bashrc_local
|
if [ -n "$DEBUG" ] ; then
|
||||||
$HOME/.bash_aliases
|
time source "$1"
|
||||||
$HOME/.bash_functions
|
else
|
||||||
/etc/bash_completion
|
source "$1"
|
||||||
$HOME/.bash_completion
|
|
||||||
$HOME/.autoenv/activate.sh
|
|
||||||
"
|
|
||||||
for ext in $_BASH_EXTRAS ; do
|
|
||||||
if [ -e "$ext" ] ; then
|
|
||||||
_debug "sourcing $ext"
|
|
||||||
source $ext
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_source_bash_extras() {
|
||||||
|
local _bash_extras="
|
||||||
|
$HOME/.bashrc_local
|
||||||
|
$HOME/.bash_aliases
|
||||||
|
$HOME/.bash_functions
|
||||||
|
/etc/bash_completion
|
||||||
|
$HOME/.bash_completion
|
||||||
|
$HOME/.autoenv/activate.sh
|
||||||
|
"
|
||||||
|
for ext in $_bash_extras ; do
|
||||||
|
_source_if_exists "$ext"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_bash_profile_main()
|
_bash_profile_main() {
|
||||||
{
|
|
||||||
source "$HOME/.bash_vars_common"
|
source "$HOME/.bash_vars_common"
|
||||||
_source_host_specific_rcfile
|
_source_host_specific_rcfile
|
||||||
_source_bash_extras
|
_source_bash_extras
|
||||||
|
|
||||||
get_ssh_agent
|
get_ssh_agent
|
||||||
get_gpg_agent
|
get_gpg_agent
|
||||||
|
|
||||||
eval "$(rbenv init -)"
|
if [ -n "$DEBUG" ] ; then
|
||||||
test -f "$HOME/.gvm/scripts/gvm" && source "$HOME/.gvm/scripts/gvm"
|
export RBENV_DEBUG=1
|
||||||
|
time eval "$(rbenv init -)"
|
||||||
|
unset RBENV_DEBUG
|
||||||
|
else
|
||||||
|
eval "$(rbenv init -)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
_source_if_exists "$HOME/.gvm/scripts/gvm"
|
||||||
|
_source_if_exists "$HOME/.gvmrc"
|
||||||
|
_source_if_exists "$HOME/src/gocode/src/.env"
|
||||||
|
|
||||||
unset _get_hostname
|
unset _get_hostname
|
||||||
unset _source_host_specific_rcfile
|
unset _source_host_specific_rcfile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user